• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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
Hello,

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 ]
 
Bartender
Posts: 2968
6
  • 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.
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic