Gary and Anne,

Thanks for the excellent answers.  I was not aware of this attribute and it
all now makes complete sense.  I was confused because the TerraService web
service (if you have ever seen it) requires qualified namespaces whereas the
axis examples I was working with do not.  And I was beginning to wonder if
it was a problem between the differences of the .net implementation and the
axis implementation.  I am glad it is not.  I checked out the terraservice
wsdl and lo-and-behold it has this attribute set.  Excellent!

Thanks,

Chris

> -----Original Message-----
> From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 25, 2003 8:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: namespace question
>
>
> Per your schema, the element <text> is a local element, which
> means that it
> should not be namespace qualified. Hence Axis does produce an accurate
> realization of your element. Since the <operation> has a default
> namespace,
> you must use xmlns="" to turn off the default namespace.
>
> If you added elementFormDefault="qualified" to your <schema>
> element, then
> all of your local elements would also have qualified names, in which case
> they would inherit their namespace from their parent element.
>
> Anne
>
> At 05:20 PM 9/25/2003 -0500, you wrote:
> >Hello,
> >
> >I have a question about namespaces while using document style
> web service...
> >
> >Say I have a method defined by the schema...
> >
> ><schema
> >     targetNamespace="http://www.domain.com/namespace";
> >     xmlns="http://www.w3.org/2001/XMLSchema";>
> >   <element name="operation">
> >     <complexType>
> >       <sequence>
> >         <element maxOccurs="1" name="text" type="xsd:string"/>
> >       </sequence>
> >     </complexType>
> >   </element>
> >...
> ></schema>
> >
> >It appears that the code that is generated by WSDL2Java
> generates a message
> >that would look something like this...
> >
> ><operation xmlns="http://www.domain.com/namespace";>
> >   <text xmlns="">
> >     blah
> >   </text>
> ></operation>
> >
> >Why does this add xmlns="" to the text element?  Should this not
> be there so
> >that the top level namespace persists?
> >
> >I want to know this because I am of the opinion that the namespace should
> >persist to the elements defined inside the element and you
> should be able to
> >check against the namespace of these elements on the server.  With the
> >client adding xmlns="", the namespace is null and I can't check
> against the
> >namespace.  Is it acceptable for the namespace to be null or the
> namespace
> >defined by targetNamespace?
> >
> >Thanks for any help,
> >
> >Chris
>

Reply via email to