• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Empty Namespace in SOAP (Axis 1.4)

 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm using Axis 1.4 in my project. Below is the fictitious WSDL to illustrate the similar problem that I face.
WSDL:


SOAP request:

I don't know why Axis always generates empty namespace in the request element of the SOAP request above. Actually I am expecting the SOAP request to be like this (without the xmlns="").
SOAP request:

If I expect the SOAP request to be like that, do I need to do in my WSDL?

Thanks in advance.

[ UD: added linebreaks for better readability ]
[ November 07, 2007: Message edited by: Ulf Dittmer ]
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately your "desired" SOAP request does not comply with the rules for interoperable RPC/literal mode of messaging as specified by WS-I Basic 1.0a which clarifies some ambiguities in SOAP 1.1/ WSDL 1.1.

Basic Profile Version 1.0: 5.6.20 Namespace for Part Accessors


For rpc-literal SOAP messages, WSDL 1.1 is not clear what namespace, if any, the accessor elements for parameters and return value are a part of. Different implementations make different choices, leading to interoperability problems.

R2735 A MESSAGE described with an rpc-literal binding MUST place the part accessor elements for parameters and return value in no namespace.

Settling on one alternative is crucial to achieving interoperability. The Profile places the part accessor elements in no namespace as doing so is simple, covers all cases, and does not lead to logical inconsistency.



So Axis is in effect enforcing this rule by undeclaring the default namespace to ensure that the part element is in no namespace - which is the correct action to take.

You get more control of the content of the SOAP body by going with the Document/literal mode of messaging.
[ November 06, 2007: Message edited by: Peer Reynders ]
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First convert the WSDL to Document/literal




This leads to the followng Java Interface



and the following Request/Response pairs:


As you will notice the elements corresponding to the operation name have disappeared - this is normal in the document/literal mode of messaging. You are submitting a document- it is up to the service to decide what to do with the document based on its type or content - there is no concept of an operation.

If - for whatever reason - you still need the wrapping operation element you apply the wrapped document/literal convention.


WSDL employing the wrapped document/literal convention.




This leads to the following Java Interface:




and the following Request/Response:




Java client code:
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's very clear. Thanks a lot, Peer I owe you one.
 
reply
    Bookmark Topic Watch Topic
  • New Topic