1

Hi I have a service SOAP that is in .NET (from a closed source provider). I managed, after like 12 hrs, to write a client for it with authentication and all through 'wsimport'. Now my requests are coming through and being answered properly but they contain invalid characters according to Java. I get this problem:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]: [1,1338]
Message: Character reference "&#


at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)
at com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:81)
at    com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:400)
... 61 more

I replicated the request in PHP, took 30 minutes. Damnit. Anyhow, those characters ARE there.

I understand you can do LogicalHandlers and MessageHandlers, but they both happen after the deserialization process (or they trigger it, from SoapContext, to get the message).

How do I fix this problem? How do I tell Java to ignore, or how do I filter those characters out of the SOAP Response before it tries to deserialize them?

mlegris
  • 181
  • 2
  • 6
  • Can you show the offending code? Out of general Java experience, I'm pretty sure you'll need to tell it which encoding the service uses. Depending on what the service does, it likely does not make sense to remove the offending characters. It would surprise me if you could tell Java to ignore them. But lets see some code :) – larslars Jul 28 '16 at 20:10
  • you mean the xml or the java? it's carriage returns that get converted into I think. – mlegris Jul 30 '16 at 18:04

0 Answers0