Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AXIS2 Axis fault SOAPEnvelope must contain a body element

 
Rodrigo Soto
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SoapUI tool or TCPMON will let you examine exactly what is being sent.

Bill
 
Rodrigo Soto
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic