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 <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 Spring in Action this week in the Spring 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
Author

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

D Arnott
Greenhorn

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!

Thanks!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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: http://www.slideshare.net/krizsan
D Arnott
Greenhorn

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
Greenhorn

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: <Soap:Body> vs <SOAP-ENV:Body> Parser Error