• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Why would an wsdl document have a targetnamespace attribute set?

Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have an xml document, namely a WSDL file and I am trying to understand why the "definitions" element have "targetNamespace" attribute set???

I thought this attribute was only for schemas. Is this not confusing? Is this legal? Why wsdl files don't have a schema to validate themselves from?

Here is my document:

[ May 16, 2006: Message edited by: Julien Martin ]
Posts: 2968
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XML namespaces are not a feature XML Schema. They are simply a feature of XML and their use is governed by the Namespaces in XML document (see also Ronald Bourret's XML Namespaces FAQ). Their function is similar to that of packages in Java � insofar as both help avoid naming collisions.

XML Schema is simply an XML application used to define, constrain and validate other XML Applications (XML Markup Languages). There are Schema alternatives like Schematron or RELAX NG. Namespaces can be used in DTDs. In WSDL you can only reference XML Schema though.

WSDL is an XML application that is used to describe web services. XML Schema was designed to define XML elements and attributes and constrain them for other markup langauges. WSDL requires definition of higher level concepts such as method parameters (part), method signatures (message, input, output), methods (operation), port interfaces (portType), and bindings (binding, service, port) for them which are outside of the scope of XML Schema � so it needs to put these definitions somewhere and it puts them into the targetNamespace.
    Bookmark Topic Watch Topic
  • New Topic