• 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

question about SOAP structure

 
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do we use prefix:


when we can do this:


The latter is way less verbose, so why do the first one?
Thanks
 
Ranch Hand
Posts: 31
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both are same if all the elements used in the soap message comes under the same targetNameSpace. (ie. if 'http://schemas.xmlsoap.org/soap/envelope/' is your default namespace).

But in webservices it is a common practice to define the complex elements in an XSD. While creating the SOAP message, these elements should be have a prefix that refers to the targetNameSpace of that XSD.

For eg.
if the XSD that defines the complex element 'Employee' has a targetNameSpace "http://www.sometns.com/", SOAP message looks as given below.



Unless we prefix Employee element, the receiver will not be able to understand the 'Employee' element. Having prefix, receiver can relate it to the corresponding XSD and identify the element.
 
reply
    Bookmark Topic Watch Topic
  • New Topic