Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Why would an wsdl document have a targetnamespace attribute set?

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic