Jump to content

WSDL - schema in types element

Recommended Posts

I have a wsdl something like this<?xml version="1.0" ?><definitions targetNamespace="http://abc.com/namespace/wsif/samples/abc" xmlns:tns="http://abc.com/namespace/wsif/samples/abc" xmlns:typens="urn:xml-soap-address-demo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <!-- type defs --> <types> <xsd:schema xmlns="urn:xml-soap-address-demo" targetNamespace="urn:xml-soap-address-demo" elementFormDefault="qualified"> <xsd:complexType name="phone"> <xsd:element name="areaCode" type="xsd:int"/> <xsd:element name="exchange" type="xsd:string"/> <xsd:element name="number" type="xsd:string"/> </xsd:complexType> <xsd:complexType name="address"> <xsd:element name="streetNum" type="xsd:int"/> <xsd:element name="streetName" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:int"/> <xsd:element name="phoneNumber" type="typens:phone"/> </xsd:complexType> </xsd:schema> </types>.......</definitions>My doubt is as elements declared in schema are in default name space is below delartion valid<xsd:element name="phoneNumber" type="phone"/> instead of<xsd:element name="phoneNumber" type="typens:phone"/>Can any one please confirm me ?Can we declare names spaces again (here declared in schema) apart from the one declared in root element here <definition> element

Link to post
Share on other sites

That's an interesting question. And one that I have yet to answer myself. But I believe non-qualified names are associated with the target namespace. In your case, this is "urn:xml-soap-address-demo" which is the same as the typens URI, so I think that, yes, they are both possible and have the same effect.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...