私はこのようなコードの塊を持っています:
AxiomSoapMessage message = (AxiomSoapMessage)webServiceMessage;
SoapHeader soapHeader = message.getSoapHeader();
SOAPMessage soapMessage = message.getAxiomMessage();
TransportContext transContext = TransportContextHolder.getTransportContext();
HttpServletConnection connection = (HttpServletConnection)transContext.getConnection();
HttpServletRequest httpRequest = connection.getHttpServletRequest();
InputStream inputStream = httpRequest.getInputStream();
SniffedXmlInputStream sniffedXmlInputStream = new SniffedXmlInputStream(inputStream);
String encoding = sniffedXmlInputStream.getXmlEncoding();
sniffedXmlInputStream.close();
String soapVersion = message.getVersion().toString();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
**soapMessage.serialize(baos);** //THIS LINE
これは、上記のようにSOAPMessageを抽出する Spring ws のWebServiceMessageを受け取るクラスの一部です。
上記のコードの「THIS LINE」でマークされた太字の行で、「時々」次の例外が発生します
org.springframework.integration.MessageHandlingException:
org.apache.axiom.om.OMException:
javax.xml.stream.XMLStreamException:
ParseError at [row,col]:[1,4090] Message: Stream closed
解決策はありますか?