I'm sorry if this is a repeat. I seems like it might be a common issue but I was not able to find an answer with my searches.
I am experimenting with writing a web service client using JAX-RPC and using weather.gov as a known working service host. My client appears to be working except that I get an error processing the result. I can see the correct result/return in the error message. What am I missing to have the result handled correctly?
Here is my code.
Here is the result:
Exception in thread "main" deserialization error: XML reader error: unexpected character content: "<?xml version='1.0' ?>
<dwml version='1.0' xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/mdl/survey/pgb_survey/dev/DWMLgen/schema/DWML.xsd">
<latLonList>34.0995,-118.414</latLonList>
</dwml>
"
at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233)
at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155)
at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:350)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:103)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:492)
at com.fireproofmatches.webservice.client.Test.main(Test.java:39)
CAUSE:
XML reader error: unexpected character content: "<?xml version='1.0' ?>
<dwml version='1.0' xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/mdl/survey/pgb_survey/dev/DWMLgen/schema/DWML.xsd">
<latLonList>34.0995,-118.414</latLonList>
</dwml>
"
at com.sun.xml.rpc.streaming.XMLReaderBase.nextElementContent(XMLReaderBase.java:43)
at com.sun.xml.rpc.encoding.soap.SOAPResponseSerializer.doDeserialize(SOAPResponseSerializer.java:356)
at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192)
at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:155)
at com.sun.xml.rpc.client.dii.CallInvokerImpl._readFirstBodyElement(CallInvokerImpl.java:350)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:103)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:492)
at com.fireproofmatches.webservice.client.Test.main(Test.java:39)
Java Result: 1
*Edited to make line number (Test.java:39) match the correct line number in code shown.