You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by babloosony <ba...@gmail.com> on 2005/04/04 11:54:47 UTC

No namespace for elements in soap message from .NET

Hi All,

Can anyone please tell me why .NET does not include any namespace for
'in0' in below soap message. Is there anything else I can do in my
WSDL posted here so that .NET includes namespace for the element
'in0'. Please suggest ...


SOAP Message from AXIS 1.2 RC2
-------------------------------------------------------
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <getDummyBean xmlns="http://DefaultNamespace">
         <in0 xmlns:tns1="http://DefaultNamespace">
            <ns1:i xmlns:ns1="http://www.ram.com/schema/types">9999</ns1:i>
            <ns2:st xmlns:ns2="http://www.ram.com/schema/types">BLAH
BLAH</ns2:st>
         </in0>
      </getDummyBean>
   </soapenv:Body></soapenv:Envelope>


SOAP Message from .NET Framework 1.1
--------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
   <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
         <getDummyBean xmlns="http://DefaultNamespace">
            <in0>
               <i xmlns="http://www.ravi.com/schema/types">0</i>
               <st xmlns="http://www.ravi.com/schema/types">stray</st>
            </in0>
         </getDummyBean>
      </soap:Body>
   </soap:Envelope




WSDL
-----------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://localhost:8090/axis/services/TypesService"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8090/axis/services/TypesService"
xmlns:intf="http://localhost:8090/axis/services/TypesService"
xmlns:tns1="http://DefaultNamespace"
xmlns:tns2="http://www.ram.com/schema/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <schema elementFormDefault="qualified"
targetNamespace="http://DefaultNamespace"
xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://www.ram.com/schema/types"/>
   <element name="getDummyBean">
    <complexType>
     <sequence>
      <element name="in0" type="tns2:InputBean"/>
     </sequence>
    </complexType>
   </element>
   <element name="getDummyBeanResponse">
    <complexType>
     <sequence>
      <element name="getDummyBeanReturn" type="tns2:DummyBean"/>
     </sequence>
    </complexType>
   </element>
  </schema>
  <schema elementFormDefault="qualified"
targetNamespace="http://www.ram.com/schema/types"
xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType name="InputBean">
    <sequence>
     <element name="i" type="xsd:int"/>
     <element name="st" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="DummyBean">
    <sequence>
     <element name="i" type="xsd:int"/>
     <element name="st" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getDummyBeanResponse">

      <wsdl:part element="tns1:getDummyBeanResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="getDummyBeanRequest">

      <wsdl:part element="tns1:getDummyBean" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="Types">

      <wsdl:operation name="getDummyBean">

         <wsdl:input message="impl:getDummyBeanRequest"
name="getDummyBeanRequest"/>

         <wsdl:output message="impl:getDummyBeanResponse"
name="getDummyBeanResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="TypesServiceSoapBinding" type="impl:Types">

      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getDummyBean">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getDummyBeanRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getDummyBeanResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="TypesService">

      <wsdl:port binding="impl:TypesServiceSoapBinding" name="TypesService">

         <wsdlsoap:address
location="http://localhost:9999/axis/services/TypesService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>





Thanks & Regards,
Kumar.

Re: No namespace for elements in soap message from .NET

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
You should read the XML Namespaces spec.

xmlns:tns1="http://DefaultNamespace" means "In the scope of this element, that is, the element, its descendants and contained attributes, unless overridden somewhere in that scope, the prefix tns1 used in an element or attribute name refers to the namespace 'http://DefaultNamespace'".

It only affects elements and attributes that use the tns1 prefix in their names.  In the particular document we're discussing, there are no such elements and attributes.  In particular, it does not affect the in0 element.

Jeff

babloosony wrote:

>Jeff - 
>
>Ok, then can you please tell me how can I get this <tns1:in0
>xmlns:tns1="http://DefaultNamespace"> instead of <in0>
>
>Also, I dont understand why you say that <in0
>xmlns:tns1="http://DefaultNamespace"> does not make sense. Can you
>please clarify since I can use such element generated by AXIS Client
>using my AXIS Server.
>
>
>- Kumar.
>
>
>  
>


Re: No namespace for elements in soap message from .NET

Posted by babloosony <ba...@gmail.com>.
Jeff - 

Ok, then can you please tell me how can I get this <tns1:in0
xmlns:tns1="http://DefaultNamespace"> instead of <in0>

Also, I dont understand why you say that <in0
xmlns:tns1="http://DefaultNamespace"> does not make sense. Can you
please clarify since I can use such element generated by AXIS Client
using my AXIS Server.


- Kumar.

Re: No namespace for elements in soap message from .NET

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
The only way this would make any sense is if you got

<tns1:in0 xmlns:tns1="http://DefaultNamespace">

Otherwise the namespace declaration you're asking for is completely 
irrelevant to in0 and the rest of the document as your previous message 
presented it.

Jeff

----- Original Message ----- 
From: "babloosony" <ba...@gmail.com>
To: "Jeff Greif" <jg...@alumni.princeton.edu>
Cc: <ax...@ws.apache.org>
Sent: Monday, April 04, 2005 8:38 AM
Subject: Re: No namespace for elements in soap message from .NET


| Hi Jeff,
|
| Thank you for the response. But what else can I configure in my WSDL
| so that .NET adds this xmlns:tns1="http://DefaultNamespace" to in01
| element
|
| that is I want this  <in0 xmlns:tns1="http://DefaultNamespace"> instead of 
<in0>
|
| Please suggest ...
|
|
| - Kumar.
| 



Re: No namespace for elements in soap message from .NET

Posted by babloosony <ba...@gmail.com>.
Hi Jeff,

Thank you for the response. But what else can I configure in my WSDL
so that .NET adds this xmlns:tns1="http://DefaultNamespace" to in01
element

that is I want this  <in0 xmlns:tns1="http://DefaultNamespace"> instead of <in0>

Please suggest ...


- Kumar.

Re: No namespace for elements in soap message from .NET

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
These soap messages are both correct.  The Axis version uses an extraneous 
namespace prefix declaration for xmlns:tns1 (extraneous because tns1 is 
unused in the message).  In both cases, in0 is specified to be in the 
default namespace (the namespace corresponding to the null prefix), which is 
specified by xmlns="..." in the containing element.

Jeff

----- Original Message ----- 
From: "babloosony" <ba...@gmail.com>
To: <ax...@ws.apache.org>; <ax...@ws.apache.org>
Sent: Monday, April 04, 2005 2:54 AM
Subject: No namespace for elements in soap message from .NET


| Hi All,
|
| Can anyone please tell me why .NET does not include any namespace for
| 'in0' in below soap message. Is there anything else I can do in my
| WSDL posted here so that .NET includes namespace for the element
| 'in0'. Please suggest ...
|
|
| SOAP Message from AXIS 1.2 RC2
| -------------------------------------------------------
| <soapenv:Envelope
| xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|   <soapenv:Body>
|      <getDummyBean xmlns="http://DefaultNamespace">
|         <in0 xmlns:tns1="http://DefaultNamespace">
|            <ns1:i xmlns:ns1="http://www.ram.com/schema/types">9999</ns1:i>
|            <ns2:st xmlns:ns2="http://www.ram.com/schema/types">BLAH
| BLAH</ns2:st>
|         </in0>
|      </getDummyBean>
|   </soapenv:Body></soapenv:Envelope>
|
|
| SOAP Message from .NET Framework 1.1
| --------------------------------------------------------------
| <?xml version="1.0" encoding="utf-8"?>
|   <soap:Envelope
| xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|      <soap:Body>
|         <getDummyBean xmlns="http://DefaultNamespace">
|            <in0>
|               <i xmlns="http://www.ravi.com/schema/types">0</i>
|               <st xmlns="http://www.ravi.com/schema/types">stray</st>
|            </in0>
|         </getDummyBean>
|      </soap:Body>
|   </soap:Envelope
|
|
|
|
| WSDL
| -----------
| <?xml version="1.0" encoding="UTF-8"?>
| <wsdl:definitions
| targetNamespace="http://localhost:8090/axis/services/TypesService"
| xmlns:apachesoap="http://xml.apache.org/xml-soap"
| xmlns:impl="http://localhost:8090/axis/services/TypesService"
| xmlns:intf="http://localhost:8090/axis/services/TypesService"
| xmlns:tns1="http://DefaultNamespace"
| xmlns:tns2="http://www.ram.com/schema/types"
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
| xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <wsdl:types>
|  <schema elementFormDefault="qualified"
| targetNamespace="http://DefaultNamespace"
| xmlns="http://www.w3.org/2001/XMLSchema">
|   <import namespace="http://www.ram.com/schema/types"/>
|   <element name="getDummyBean">
|    <complexType>
|     <sequence>
|      <element name="in0" type="tns2:InputBean"/>
|     </sequence>
|    </complexType>
|   </element>
|   <element name="getDummyBeanResponse">
|    <complexType>
|     <sequence>
|      <element name="getDummyBeanReturn" type="tns2:DummyBean"/>
|     </sequence>
|    </complexType>
|   </element>
|  </schema>
|  <schema elementFormDefault="qualified"
| targetNamespace="http://www.ram.com/schema/types"
| xmlns="http://www.w3.org/2001/XMLSchema">
|   <complexType name="InputBean">
|    <sequence>
|     <element name="i" type="xsd:int"/>
|     <element name="st" nillable="true" type="xsd:string"/>
|    </sequence>
|   </complexType>
|   <complexType name="DummyBean">
|    <sequence>
|     <element name="i" type="xsd:int"/>
|     <element name="st" nillable="true" type="xsd:string"/>
|    </sequence>
|   </complexType>
|  </schema>
| </wsdl:types>
|
|   <wsdl:message name="getDummyBeanResponse">
|
|      <wsdl:part element="tns1:getDummyBeanResponse" name="parameters"/>
|
|   </wsdl:message>
|
|   <wsdl:message name="getDummyBeanRequest">
|
|      <wsdl:part element="tns1:getDummyBean" name="parameters"/>
|
|   </wsdl:message>
|
|   <wsdl:portType name="Types">
|
|      <wsdl:operation name="getDummyBean">
|
|         <wsdl:input message="impl:getDummyBeanRequest"
| name="getDummyBeanRequest"/>
|
|         <wsdl:output message="impl:getDummyBeanResponse"
| name="getDummyBeanResponse"/>
|
|      </wsdl:operation>
|
|   </wsdl:portType>
|
|   <wsdl:binding name="TypesServiceSoapBinding" type="impl:Types">
|
|      <wsdlsoap:binding style="document"
| transport="http://schemas.xmlsoap.org/soap/http"/>
|
|      <wsdl:operation name="getDummyBean">
|
|         <wsdlsoap:operation soapAction=""/>
|
|         <wsdl:input name="getDummyBeanRequest">
|
|            <wsdlsoap:body use="literal"/>
|
|         </wsdl:input>
|
|         <wsdl:output name="getDummyBeanResponse">
|
|            <wsdlsoap:body use="literal"/>
|
|         </wsdl:output>
|
|      </wsdl:operation>
|
|   </wsdl:binding>
|
|   <wsdl:service name="TypesService">
|
|      <wsdl:port binding="impl:TypesServiceSoapBinding" 
name="TypesService">
|
|         <wsdlsoap:address
| location="http://localhost:9999/axis/services/TypesService"/>
|
|      </wsdl:port>
|
|   </wsdl:service>
|
| </wsdl:definitions>
|
|
|
|
|
| Thanks & Regards,
| Kumar.
|