aspose file tools*
The moose likes Web Services and the fly likes setting namespaces in SOAP request payload from a java client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "setting namespaces in SOAP request payload from a java client " Watch "setting namespaces in SOAP request payload from a java client " New topic
Author

setting namespaces in SOAP request payload from a java client

Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
All - I currently have to write a java client which consumes a RPC web service.

I did use the SOAPUI utility to verify the web service and I am able to see the response from the web service. But only when i pass the SOAP request and all the containing elements in the body contain namespace qualified attributes something like this

<com:testOperation>
<testInputObject xsi:type="ns1:com_example_app_model_TestInput" xmlns:ns1="http://com.example.app.facade/TestWebService1.xsd">
<scoreDto xsi:type="ns1:com_example_app_model_ScoreInput">
<requestType xsi:type="xsd:string">N</requestType>


If I don't provide the namespace attributes I run into "No Deserializer found error"

For the java web service client I am using generated stubs. How can I set the namespace attributes for each and every element I pass in the java equivalent of the SOAP request payload.

Do let me know your thoughts.

Thanks,
Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
Can someone respond.

The WSDL we have created in this scenario is a combinations of the WSDL's from two other web services. Is there a way where in we can provide an instruction to suppress the need for namespace in SOAP payloads or to automatically set the namespace attributes in the SOAP payloads.

When I use the underlying web service WSDL directly to generate the w/service client stubs and use the same from the java front end apps it seems to be generating the SOAP request payloads correctly.
aruna sydu
Ranch Hand

Joined: Jan 21, 2008
Posts: 98

Udayan Kumar wrote:Can someone respond.

The WSDL we have created in this scenario is a combinations of the WSDL's from two other web services. Is there a way where in we can provide an instruction to suppress the need for namespace in SOAP payloads or to automatically set the namespace attributes in the SOAP payloads.

When I use the underlying web service WSDL directly to generate the w/service client stubs and use the same from the java front end apps it seems to be generating the SOAP request payloads correctly.


Hi Uday,

As far as I understood the problem, the appending of namespaces to each element and attribute in the SOAPUI project is because of these two atttributes
attributeFormDefault="qualified" elementFormDefault="qualified" mentioned in your WSDL or XSD.
To make them unqualified try setting attributeFormDefault="unqualified" elementFormDefault="unqualified" in your schema definition.
Validate your WSDL,build the soapUI project and test again.

2.While calling the webservice provider from client using the Stub , The JAX-RPC or JAX-WS depending on the webservice stack you are using will take care of building the SOAP request for you with or without namspaces .


Aruna.





Attitude Determines Altitude

SCJP4/SCWCD4/SCDJWS5/Preparing SCEA Part I
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting namespaces in SOAP request payload from a java client