You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Dovholuk, Clint" <Cl...@GlobalCrossing.com> on 2005/07/22 22:44:35 UTC

xmlns="" for me too, calling axis from .NET - piggy backing on: RE: .NET server, Axis 1.2.1 client, poorly formed messages

Hi Anne (and everyone)

I have a similar issue but I have a .NET client consuming an Axis
webservice and I'm seeing the xmlns="" in the response...  I've setup my
wsdl to use doc/lit, so while it's related, I don't think it's an
"RPC-thing"?

I have a class which I let Axis generate a wsdl for (below) and I've
also attached my wsdd entry...

Unfortunately the search hits so many results, finding the right pointer
has been impossible...

Thanks for any pointers,
-Clint

****************************** WSDD ENTRY ******************************

  <service name="myTestService" provider="java:RPC" style="document"
use="literal">
    <parameter name="allowedMethods" value="createLocation" />
    <parameter name="className" value="com.myNamespace.MyService" />
    <namespace>http://http://my-namespace.com</namespace>
    
    --- BEAN MAPPINGS --- 
    
  </service>
****************************** END WSDD ENTRY
****************************** 

****************************** WSDL ****************************** 
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://http://my-namespace.com"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://http://my-namespace.com"
xmlns:intf="http://http://my-namespace.com"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified"
targetNamespace="http://http://my-namespace.com"
xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType abstract="true" name="AbstractLocation">
    <sequence/>
   </complexType>
   <complexType name="NewLocation">
    <complexContent>
     <extension base="impl:AbstractLocation">
      <sequence>
       <element name="accountNumber" nillable="true" type="xsd:string"/>
       <element name="address" nillable="true" type="xsd:string"/>
       <element name="city" nillable="true" type="xsd:string"/>
       <element name="country" nillable="true" type="xsd:string"/>
       <element name="county" nillable="true" type="xsd:string"/>
       <element name="floor" nillable="true" type="xsd:string"/>
       <element name="phoneNumber" nillable="true" type="xsd:string"/>
       <element name="postalCode" nillable="true" type="xsd:string"/>
       <element name="siteName" nillable="true" type="xsd:string"/>
       <element name="state" nillable="true" type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
   <element name="locs">
    <complexType>
     <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="item"
type="impl:NewLocation"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="ArrayOf_xsd_anyType">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item"
type="xsd:anyType"/>
    </sequence>
   </complexType>
   <complexType name="ReturnedItems">
    <sequence>
     <element name="errorsExist" type="xsd:boolean"/>
     <element name="returnedItems" nillable="true"
type="impl:ArrayOf_xsd_anyType"/>
    </sequence>
   </complexType>
   <element name="createLocationReturn" type="impl:ReturnedItems"/>
  </schema>
 </wsdl:types>
   <wsdl:message name="createLocationRequest">
      <wsdl:part element="impl:locs" name="locs"/>
   </wsdl:message>
   <wsdl:message name="createLocationResponse">
      <wsdl:part element="impl:createLocationReturn"
name="createLocationReturn"/>
   </wsdl:message>
   <wsdl:portType name="MyService">
      <wsdl:operation name="createLocation" parameterOrder="locs">
         <wsdl:input message="impl:createLocationRequest"
name="createLocationRequest"/>
         <wsdl:output message="impl:createLocationResponse"
name="createLocationResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="myTestServiceSoapBinding" type="impl:MyService">
      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="createLocation">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="createLocationRequest">
            <wsdlsoap:body use="literal"/>
         </wsdl:input>
         <wsdl:output name="createLocationResponse">
            <wsdlsoap:body use="literal"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="MyServiceService">
      <wsdl:port binding="impl:myTestServiceSoapBinding"
name="myTestService">
         <wsdlsoap:address
location="http://10.60.93.22:40000/eon/services/myTestService"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
****************************** END WSDL ****************************** 





















-----Original Message-----
From: John Baker [mailto:jbaker@sasami.atomised.org] 
Sent: Wednesday, July 20, 2005 5:42 AM
To: axis-user@ws.apache.org; Anne Thomas Manes
Subject: Re: .NET server, Axis 1.2.1 client, poorly formed messages

Anne,

You are absolutely correct. The .NET server is exposing
style="document"; style="rpc" came about to fix a broken client (to
Axis) getting confused about what to do when style="document" is present
in the WSDL.

I'll change it back and try this all again :)


John

On Tue, Jul 19, 2005 at 10:07:43AM -0400, Anne Thomas Manes wrote:
> John,
> 
> The empty namespace on the child element of the SOAP Body is caused by

> the fact that the WSDL specifies "rpc" style in the <soap:binding> 
> definition, but it doesn't specify a namespace attribute in the 
> <soap:body> definitions. (When using RPC style, you must specify a 
> namespace attribute in <soap:body>.)
> 
> I'm really astonished to see a .NET server exposing a WSDL that uses 
> RPC/Literal -- .NET doesn't support RPC/Literal. This WSDL is totally 
> wrong for an RPC style service. It looks like a wrapped 
> document/literal style service. As I said in another response I made 
> to you yesterday, you should change the style to "document", and then 
> it should work. (As I mentioned yesterday, you do have a number of 
> elements defined in the schema with no types defined -- you should 
> also define their types.)
> 
> Anne
> 
> On 7/14/05, John Baker <jb...@sasami.atomised.org> wrote:
> > Hello,
> > 
> > I am using Axis (1.2.1) to connect to a .NET server, but the server 
> > isn't deserialising the Axis generated message correctly.
> > 
> > I've used this wsdl:
> > http://www.javasystemsolutions.com/serviceRequestConnector.wsdl
> > 
> > And I've used the wsdl2java program to create my Java stubs.
> > 
> > Now this is what Axis generates for the SubmitGeneralServiceRequest
method:
> > 
> > <?xml version="1.0" encoding="UTF-8"?> <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>
> >   <SubmitGeneralServiceRequest xmlns="">
> >     <ns1:SubmittedGeneralServiceRequest
xmlns:ns1="http://www.caps-solutions.co.uk/schema/uniform/72b/servicereq
uest/sr/srtypes">
> >       <ns1:ServiceRequestIdentification
> > 
> > (etc.)
> > 
> > The .NET server replies:
> > 
> > Server was unable to process request. A valid 
> > SubmittedGeneralServiceRequestType object is required
> > 
> > Now it strikes me that xmlns="" looks wrong.
> > 
> > Does anyone have any ideas what's going on?
> > 
> > Thanks,
> > 
> > 
> > John
> >

Re: xmlns="" for me too, calling axis from .NET - piggy backing on: RE: .NET server, Axis 1.2.1 client, poorly formed messages

Posted by Anne Thomas Manes <at...@gmail.com>.
Clint,

If you want to enable interop with .NET then do the following:

1- use style="wrapped" rather than style="document" in your WSDD.
2- edit your generated WSDL as follows: 
  a- Remove the abstract type and define NewLocation as a simple sequence 
      rather than as an extension of AbstractLocation. 
  b- Replace all nillable="true" attributes with nillible="false"
minOccurs="0".
  c- Replace the ArrayOf_xsd_anyType (and its child item element) with 
      specific type definitions (i.e., don't use type="xsd:anyType").
3- regen your server from the edited WSDL.

Anne

On 7/22/05, Dovholuk, Clint <Cl...@globalcrossing.com> wrote:
> Hi Anne (and everyone)
> 
> I have a similar issue but I have a .NET client consuming an Axis
> webservice and I'm seeing the xmlns="" in the response...  I've setup my
> wsdl to use doc/lit, so while it's related, I don't think it's an
> "RPC-thing"?
> 
> I have a class which I let Axis generate a wsdl for (below) and I've
> also attached my wsdd entry...
> 
> Unfortunately the search hits so many results, finding the right pointer
> has been impossible...
> 
> Thanks for any pointers,
> -Clint
> 
> ****************************** WSDD ENTRY ******************************
> 
>   <service name="myTestService" provider="java:RPC" style="document"
> use="literal">
>     <parameter name="allowedMethods" value="createLocation" />
>     <parameter name="className" value="com.myNamespace.MyService" />
>     <namespace>http://http://my-namespace.com</namespace>
> 
>     --- BEAN MAPPINGS ---
> 
>   </service>
> ****************************** END WSDD ENTRY
> ******************************
> 
> ****************************** WSDL ******************************
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://http://my-namespace.com"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://http://my-namespace.com"
> xmlns:intf="http://http://my-namespace.com"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <!--WSDL created by Apache Axis version: 1.2.1
> Built on Jun 14, 2005 (09:15:57 EDT)-->
>  <wsdl:types>
>   <schema elementFormDefault="qualified"
> targetNamespace="http://http://my-namespace.com"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <complexType abstract="true" name="AbstractLocation">
>     <sequence/>
>    </complexType>
>    <complexType name="NewLocation">
>     <complexContent>
>      <extension base="impl:AbstractLocation">
>       <sequence>
>        <element name="accountNumber" nillable="true" type="xsd:string"/>
>        <element name="address" nillable="true" type="xsd:string"/>
>        <element name="city" nillable="true" type="xsd:string"/>
>        <element name="country" nillable="true" type="xsd:string"/>
>        <element name="county" nillable="true" type="xsd:string"/>
>        <element name="floor" nillable="true" type="xsd:string"/>
>        <element name="phoneNumber" nillable="true" type="xsd:string"/>
>        <element name="postalCode" nillable="true" type="xsd:string"/>
>        <element name="siteName" nillable="true" type="xsd:string"/>
>        <element name="state" nillable="true" type="xsd:string"/>
>       </sequence>
>      </extension>
>     </complexContent>
>    </complexType>
>    <element name="locs">
>     <complexType>
>      <sequence>
>       <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="impl:NewLocation"/>
>      </sequence>
>     </complexType>
>    </element>
>    <complexType name="ArrayOf_xsd_anyType">
>     <sequence>
>      <element maxOccurs="unbounded" minOccurs="0" name="item"
> type="xsd:anyType"/>
>     </sequence>
>    </complexType>
>    <complexType name="ReturnedItems">
>     <sequence>
>      <element name="errorsExist" type="xsd:boolean"/>
>      <element name="returnedItems" nillable="true"
> type="impl:ArrayOf_xsd_anyType"/>
>     </sequence>
>    </complexType>
>    <element name="createLocationReturn" type="impl:ReturnedItems"/>
>   </schema>
>  </wsdl:types>
>    <wsdl:message name="createLocationRequest">
>       <wsdl:part element="impl:locs" name="locs"/>
>    </wsdl:message>
>    <wsdl:message name="createLocationResponse">
>       <wsdl:part element="impl:createLocationReturn"
> name="createLocationReturn"/>
>    </wsdl:message>
>    <wsdl:portType name="MyService">
>       <wsdl:operation name="createLocation" parameterOrder="locs">
>          <wsdl:input message="impl:createLocationRequest"
> name="createLocationRequest"/>
>          <wsdl:output message="impl:createLocationResponse"
> name="createLocationResponse"/>
>       </wsdl:operation>
>    </wsdl:portType>
>    <wsdl:binding name="myTestServiceSoapBinding" type="impl:MyService">
>       <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>       <wsdl:operation name="createLocation">
>          <wsdlsoap:operation soapAction=""/>
>          <wsdl:input name="createLocationRequest">
>             <wsdlsoap:body use="literal"/>
>          </wsdl:input>
>          <wsdl:output name="createLocationResponse">
>             <wsdlsoap:body use="literal"/>
>          </wsdl:output>
>       </wsdl:operation>
>    </wsdl:binding>
>    <wsdl:service name="MyServiceService">
>       <wsdl:port binding="impl:myTestServiceSoapBinding"
> name="myTestService">
>          <wsdlsoap:address
> location="http://10.60.93.22:40000/eon/services/myTestService"/>
>       </wsdl:port>
>    </wsdl:service>
> </wsdl:definitions>
> ****************************** END WSDL ******************************
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: John Baker [mailto:jbaker@sasami.atomised.org]
> Sent: Wednesday, July 20, 2005 5:42 AM
> To: axis-user@ws.apache.org; Anne Thomas Manes
> Subject: Re: .NET server, Axis 1.2.1 client, poorly formed messages
> 
> Anne,
> 
> You are absolutely correct. The .NET server is exposing
> style="document"; style="rpc" came about to fix a broken client (to
> Axis) getting confused about what to do when style="document" is present
> in the WSDL.
> 
> I'll change it back and try this all again :)
> 
> 
> John
> 
> On Tue, Jul 19, 2005 at 10:07:43AM -0400, Anne Thomas Manes wrote:
> > John,
> >
> > The empty namespace on the child element of the SOAP Body is caused by
> 
> > the fact that the WSDL specifies "rpc" style in the <soap:binding>
> > definition, but it doesn't specify a namespace attribute in the
> > <soap:body> definitions. (When using RPC style, you must specify a
> > namespace attribute in <soap:body>.)
> >
> > I'm really astonished to see a .NET server exposing a WSDL that uses
> > RPC/Literal -- .NET doesn't support RPC/Literal. This WSDL is totally
> > wrong for an RPC style service. It looks like a wrapped
> > document/literal style service. As I said in another response I made
> > to you yesterday, you should change the style to "document", and then
> > it should work. (As I mentioned yesterday, you do have a number of
> > elements defined in the schema with no types defined -- you should
> > also define their types.)
> >
> > Anne
> >
> > On 7/14/05, John Baker <jb...@sasami.atomised.org> wrote:
> > > Hello,
> > >
> > > I am using Axis (1.2.1) to connect to a .NET server, but the server
> > > isn't deserialising the Axis generated message correctly.
> > >
> > > I've used this wsdl:
> > > http://www.javasystemsolutions.com/serviceRequestConnector.wsdl
> > >
> > > And I've used the wsdl2java program to create my Java stubs.
> > >
> > > Now this is what Axis generates for the SubmitGeneralServiceRequest
> method:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?> <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>
> > >   <SubmitGeneralServiceRequest xmlns="">
> > >     <ns1:SubmittedGeneralServiceRequest
> xmlns:ns1="http://www.caps-solutions.co.uk/schema/uniform/72b/servicereq
> uest/sr/srtypes">
> > >       <ns1:ServiceRequestIdentification
> > >
> > > (etc.)
> > >
> > > The .NET server replies:
> > >
> > > Server was unable to process request. A valid
> > > SubmittedGeneralServiceRequestType object is required
> > >
> > > Now it strikes me that xmlns="" looks wrong.
> > >
> > > Does anyone have any ideas what's going on?
> > >
> > > Thanks,
> > >
> > >
> > > John
> > >
>