• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

deserialization error: XML reader error: unexpected character content: "<?xml version='1.0' ?>

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic