aspose file tools*
The moose likes Web Services and the fly likes AXIS2 Axis fault SOAPEnvelope must contain a body element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "AXIS2 Axis fault SOAPEnvelope must contain a body element" Watch "AXIS2 Axis fault SOAPEnvelope must contain a body element" New topic
Author

AXIS2 Axis fault SOAPEnvelope must contain a body element

Rodrigo Soto
Greenhorn

Joined: Oct 13, 2009
Posts: 11
Hi all, I am developing a client that generates a soap messages and sends it to a public registry. When I create this messages it does not goes through and returns a Axisfault here is the stack trace:


Here is the method that creates the soap message:

I thank you in advance.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Apparently your SOAP message does not contain a SOAP body element or perhaps it is in the wrong place.
Try printing out the SOAP message before you send it to check that it is a valid SOAP message. The easiest way that I know is to apply a null XSLT transform with the destination being System.out.
Best wishes!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
The SoapUI tool or TCPMON will let you examine exactly what is being sent.

Bill
Rodrigo Soto
Greenhorn

Joined: Oct 13, 2009
Posts: 11
Thank you for your prompt responses. I have used the TCPMon and this the soap messages does have a soapenv:Body, here it is the message

I hope this helps to narrow the problem down. Thank you in advance.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I am not entirely sure why you have problems, but after having checked the SOAP message, I discovered the following:
1. In the headerblock <wsa:Action>, the namespace prefix soapEnv is used, despite it not having been declared (only the namespace with the prefix soapenv is declared).

2. I ran the SOAP message through an XML validator. There are some values that should be wrapped in CDATA sections:

I inserted CDATA section in all but the last two. In the two last ones, the value of the value attribute causes validation problems.
Hope this helps!
Rodrigo Soto
Greenhorn

Joined: Oct 13, 2009
Posts: 11
Well the I dont know if the problem is really that because when I send the soap message to the server it tries to validate the message against some xsd but I do not have control over that. The problem is that the server is sending a fault message stating that there does not exist a WS-Action but it is there. I have been working on this problem and have not find any solution. Any other thoughts on how to solve this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AXIS2 Axis fault SOAPEnvelope must contain a body element