HI Anne,

Thanks for you reply. Your were right, the elementFormDefault="qualified"
worked for this schema definition; I got no more empty xmlns attributs. I am
just wondering why this is not the default value.

Thanks a lot for your help,
Felix

PS: . I have attached the google wsdl including the schema definition that I
have used

-----Ursprungligt meddelande-----
Från: Anne Thomas Manes [mailto:[EMAIL PROTECTED] 
Skickat: den 29 september 2006 23:10
Till: axis-user@ws.apache.org
Ämne: Re: xmlns="" in soap calls

We need to see the schema to determine where the problem is.

My guess is that the schema defines the "safeSearch" and "maxResults"
elements as local elements to the "doGoogleSearch" type. By default,
local elements are not included in the targetNamespace, therefore they
must not be qualified in an instance document. e.g., the schema is
defined thus:

<schema targetNamespace="urn:GoogleSearch">
  <element name="doGoogleSearch>
    <complexType>
      <sequence>
        <element name="safeSearch" type="boolean"/>
        <element name="maxResults type="int"/>
      </sequence>
    </complexType>
   </element>
</schema>

Given that the document instance uses a default namespace
(xmlns="urnGoogleSearch), you must override the default in the child
elements (xmlns="") in order to make them not qualified.

If, on the other hand, the schema specified
elementFormDefault="qualified", then the local elements would be
qualified.

Is the service, by chance, implemented with .NET? If so, then the
problem is with the service, and the only way to resolve it is by
adding elementFormDefault="qualified" to the schema. e.g.,

<schema targetNamespace="urn:GoogleSearch" elementFormDefault="qualified">
  <element name="doGoogleSearch>
    <complexType>
      <sequence>
        <element name="safeSearch" type="boolean"/>
        <element name="maxResults type="int"/>
      </sequence>
    </complexType>
   </element>
</schema>

See
http://atmanes.blogspot.com/2006/07/short-explanation-of-xml-namespaces.html
for a more detailed discussion of namespaces.

Anne

On 9/29/06, Felix Sprick <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi all,
>
>
>
>
>
> I have problems with xmlns="" in element tags when making soap calls. The
> server side has difficulties when parsing/validating the call. I ran
> wsdl2java of the latest nightly-build of axis2 on the google.wsdl as well
as
> on others. When I print out the soap call before sending to the server
side,
> it looks like that:
>
>
>
> <?xml version='1.0' encoding='utf-8'?>
>
> <soapenv:Envelope
>
>
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>
>       <soapenv:Header />
>
>       <soapenv:Body>
>
>             <doGoogleSearch xmlns="urn:GoogleSearch">
>
>                   <safeSearch xmlns="">false</safeSearch>
>
>                   <maxResults xmlns="">1</maxResults>
>
>             </doGoogleSearch>
>
>       </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
>
>
> Where do the xmlns="" come from? How can I get rid of them? Is that a bug
of
> wsdl2java? Any ideas?
>
>
>
> Thanks for your help,
>
> Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: GoogleSearch.wsdl
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to