Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Services and the fly likes JAX-WS generated client request missing SOAP body Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS generated client request missing SOAP body" Watch "JAX-WS generated client request missing SOAP body" New topic
Author

JAX-WS generated client request missing SOAP body

Roger Irvin
Greenhorn

Joined: Jul 24, 2003
Posts: 5
I generated a Web Service client from a WSDL using JAX-WS. The generated code is placing the the Web Service pararameter into the Header of the SOAP envelope and not in the SOAP Body when the request is being instantiated. Can anyone tell me what JAX-WS embedded binding declarations that I might place into the WSDL file to get the Web Service parameter to be included in the SOAP Body. Thanks much!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18993
    
    8

"carStuffCoder", please check your private messages regarding an important administrative matter.

Thank you.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Would it be possible to have a look at the WSDL, or an equivalent WSDL?
Best wishes!
Roger Irvin
Greenhorn

Joined: Jul 24, 2003
Posts: 5
RatingService WSDL

As you can see from the WSDL mark up, this service was created with .NET. I have always had to customize a .NET WSDL to get wsimport to generate acceptable java code, but this one really has me befuddled! The oXygen SOAP analyser tool, generates an appropriate request message from this WSDL and it utilizes Java APIs to do so. It may not be using JAX-WS though.

Thank you, again.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Sad to say, I cannot seem to access the WSDL using the link you provided. I tried with both soapUI and Firefox, but with no luck.
Roger Irvin
Greenhorn

Joined: Jul 24, 2003
Posts: 5

shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
Even with SOAP UI, generated SOAP envelope is having request param in header. Problem is with your wsdl. Remove all four header element from the binding.

<soap:header message="tns:Get_Termsevent" part="event" use="literal"/>
<soap:header message="tns:Get_TermsseResults" part="seResults" use="literal"/>
<soap12:header message="tns:Get_Termsevent" part="event" use="literal"/>
<soap12:header message="tns:Get_TermsseResults" part="seResults" use="literal"/>


SCJP 1.5(97%) My Blog
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Thanks, I got it now!
After having had a quick look, it looks as if request parameter and response data can either be located in the SOAP Body OR in a SOAP Header.
For instance the Get_Terms operation:
The data type of the input data that can be enclosed in the SOAP Body is Get_TermsSoapIn, which is of this type:

All elements in the above data structure are, as you can see, optional.
In the binding for the same operation, you can see that the header can contain data of the type Get_Termsevent.
This data structure is an <event> element - the same as the data that can be in the SOAP Body.
Again, all elements in the data structure are optional.

Have you tried to issue requests enclosing request data only in the SOAP body?
Can the WSDL be changed or is that beyond your control?
I'll try to run the WSDL through wsimport tomorrow and see what fun stuff comes out...
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAX-WS generated client request missing SOAP body