This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Web Services and the fly likes <Soap:Body> vs <SOAP-ENV:Body> Parser Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "<Soap:Body> vs <SOAP-ENV:Body> Parser Error" Watch "<Soap:Body> vs <SOAP-ENV:Body> Parser Error" New topic

<Soap:Body> vs <SOAP-ENV:Body> Parser Error

D Arnott

Joined: Oct 13, 2011
Posts: 7
Hi all!

I am trying to parse a soap response file but the parser is throwing an error saying missing <SOAP-ENV:Body>. The file is not formated with that type of body tag it is formated with <Soap:body>. I've been searching online tyring to find the difference to no avail. Any of your web service guru's have any clue on the difference here? Is this an encoding thing? Can I change the response from my client? Any details would be great!

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
The namespace prefix, which in your examples are either "SOAP-ENV" or "Soap", should be defined in the message.
Namespace prefixes can have arbitrary names, as long as they are defined.
The <Body> element must be spelled just like that, though - with a capital "B". Thus "body" is not correct.
Best wishes!

My free books and tutorials:
D Arnott

Joined: Oct 13, 2011
Posts: 7
That helps explain things. The <soap:Body> tag is setup with propr case. One followup question is where is teh namespace prefixes defined? Shouldnt the <soap:Body> have a xmlns:ns in the tag?

Sorry, for the noob question. I am new to web services. I guess I am trying to determine if it is a problem with the parser I am using or the soap response itself. Here is a snippet from the soap response:

Tejas Aryan

Joined: Apr 12, 2009
Posts: 22
There is no need to define the namespace prefix separately for <soap:Body>. The namespace prefix is already defined in . The other thing I see missing is end tags for <soap:Body> and <soap:Enveloper>. Check if the response has the end tags as well.
jQuery in Action, 3rd edition
subject: <Soap:Body> vs <SOAP-ENV:Body> Parser Error
It's not a secret anymore!