File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes XML in Payload, fault returned. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "XML in Payload, fault returned." Watch "XML in Payload, fault returned." New topic
Author

XML in Payload, fault returned.

James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
I'M getting the following fault msg returned -


WHEN I send over this SOAP Msg in my document style web service:

I'm using apache axis with tomcat.

Any advice regarding what this fault msg means or how to fix my
problem is appreciated.

org.xml.sax.SAXException: SimpleDeserializer encountered a child
element, which is NOT expected, in something it was trying to
deserialize.

James
[ January 05, 2005: Message edited by: James Clinton ]
Alex Beekman
Greenhorn

Joined: Dec 22, 2004
Posts: 9
I got that same exception when I was using DOCUMENT, LITERAL.
I changed it to WRAPPED, LITERAL and it parses correctly. ymmv
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Thanks I'll give that ago.

Also, I have just relised the service I have been deploying which drops an XML message directly into the payload should be decalred as type 'message' (which I was confusing with 'document'). Making a change in my deploy.wsdd file might solve my origial problem.
[ January 05, 2005: Message edited by: James Clinton ]
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
James- I think if we are tranferring any custom types between consumer and provider then we need to register them using wsdd file using <<beanMapping> tag.


RR Kumaran
SCJP 1.4
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Nritya - what you are referring to is (as I understand it) only required if sending through a complex type, which I am not.

I'm simply adding XML into the Body.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
btw - changing the web service type to 'message' in the wsdd file fixed the problem.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
Further findings - might be of help

I have now managed to get this working using and RPC/Document Literal style web service.



This only seems possible if you build the service classes from the WSDL because you need to add in the schema details for your complex types. (wsdl2java).

Why bother? It has all the advantages and flexibility of Document (async etc) and RPC (invoking methods using a stub instead of parsing XML etc) together.

Payload looks like this

..instead of this.


Comments welcome.
[ January 07, 2005: Message edited by: James Clinton ]
 
wood burning stoves
 
subject: XML in Payload, fault returned.
 
Similar Threads
web service exception handling..
Server.userException: Exception while executing Client
Error : Axis Engine Cudn't find the target
Axis Fault: no such operation
WAS v6.1 + WS-Security