- This topic has 4 replies, 3 voices, and was last updated 15 years, 9 months ago by Loyal Water.
-
AuthorPosts
-
javaarielMemberHi everybody:
I have a problem with a web service I am doing, I have made a web service that returns a collection of objects, the objects have a set of properties, there is one property that is a String, consist in a text fragment that could have some characters that are considered special in XML like &, <, >, ” and that’s why when I execute the service from a client an exception is thrown:
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT. at [row,col {unknown-source}]: [9,646] org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT. at [row,col {unknown-source}]: [9,646] at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89) at org.codehaus.xfire.client.Client.onReceive(Client.java:410) at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139) at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114) at org.codehaus.xfire.client.Client.invoke(Client.java:336) at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy0.search(Unknown Source) at cu.co.cenatav.webservices.client.Client.main(Client.java:26)
I know that this is happening because special characters are sent by the soap message but I don’t know how to solve this problem.
How could I avoid this exception ?
I hope you can help me.
Regards.
Ariel
Loyal WaterMemberAriel,
This seems like an XFire issue and I would suggest you cross post this query on the XFire forums as well.
javaarielMemberI have generated this web services with MyEclipse 6.0, are there bugs in the XFire libraries ???
Why could I solve this problem ??? Should I use another library instead of XFire ???
Regards
Ariel
Ton HuismanMemberXML Special characters should be xml-ified, with & for &, < for <, > for >, and " for “. This is explained in detail on this w3c page
HTH
Ton
Loyal WaterMemberThanks for the information.
-
AuthorPosts