axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shantanu chawla <shantanuchawl...@gmail.com>
Subject Unable to retrieve complex type in .net client
Date Fri, 06 May 2005 22:41:24 GMT
On my course of learning of  webservices on Axis. I created a complex
type Person containing age and name attributes.
I tried to create another complextype PersonsContainer which contains
a Person array and count. My wsdl has two functions getPerson()
returning Person and getPersons() returning PersonsContainer.

I uses wsdl2java to generate the server and client java codes. and I
deploy the service on Axis  1.2RC3. The java client works fine with
the service but when I try to access the service with .net client I am
able to receive the person with getPerson() but I am unable to get
PersonsContainer using getPersons(). When looking at the soap
responses. It seems the getPersons() is getting getPerson() function
kinda weird.

My wsdl is :

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="PersonTest"
targetNamespace="http://shantanu.org/PersonTest/"
xmlns:tns="http://shantanu.org/PersonTest/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://shantanu.org/PersonTest/">
      <xsd:element name="NewOperationResponse" type="xsd:string"/>
      <xsd:element name="NewOperationRequest" type="xsd:string"/>
      <xsd:complexType name="Person">
      	<xsd:sequence>
      		<xsd:element name="name" type="xsd:string"></xsd:element>
      		<xsd:element name="age" type="xsd:int"></xsd:element>
      	</xsd:sequence>
      </xsd:complexType>

      <xsd:element name="getPersonResponse" type="tns:Person"></xsd:element>
      <xsd:element name="getPersonRequest" type="xsd:string"></xsd:element>
      <xsd:complexType name="PersonsContainer">
      	<xsd:sequence>
      		<xsd:element name="count" type="xsd:int"></xsd:element>
      		<xsd:element name="persons" type="tns:Person" minOccurs="0"
maxOccurs="unbounded" nillable="true"></xsd:element>
      	</xsd:sequence>
      </xsd:complexType>

      <xsd:element name="getPersonsResponse"
      	type="tns:PersonsContainer">
      </xsd:element>
      <xsd:element name="getPersonsRequest" type="xsd:string"></xsd:element>
        </xsd:schema>
  </wsdl:types>
  <wsdl:message name="NewOperationResponse">
    <wsdl:part name="NewOperationResponse" element="tns:NewOperationResponse"/>
  </wsdl:message>
  <wsdl:message name="NewOperationRequest">
    <wsdl:part name="NewOperationRequest" element="tns:NewOperationRequest"/>
  </wsdl:message>
  <wsdl:message name="getPersonResponse">
  	<wsdl:part name="getPersonResponse"
  		element="tns:getPersonResponse">
  	</wsdl:part>
  </wsdl:message>
  <wsdl:message name="getPersonRequest">
  </wsdl:message>
  <wsdl:message name="getPersonsResponse">
  	<wsdl:part name="getPersonsResponse"
  		element="tns:getPersonsResponse">
  	</wsdl:part>
  </wsdl:message>
  <wsdl:message name="getPersonsRequest">
  </wsdl:message>
  <wsdl:portType name="PersonTest">
    <wsdl:operation name="NewOperation">
      <wsdl:input message="tns:NewOperationRequest"/>
      <wsdl:output message="tns:NewOperationResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getPerson">
    	<wsdl:input message="tns:getPersonRequest"></wsdl:input>
    	<wsdl:output message="tns:getPersonResponse"></wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getPersons">
    	<wsdl:input message="tns:getPersonsRequest"></wsdl:input>
    	<wsdl:output message="tns:getPersonsResponse"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="PersonTestSOAP" type="tns:PersonTest">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="NewOperation">
      <soap:operation soapAction="http://shantanu.org/PersonTest/NewOperation"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getPerson">
    	<soap:operation
soapAction="http://localhost:9090/axis/services/PersonTestSOAP/getPerson"/>
    	<wsdl:input>
    		<soap:body use="literal"/>
    	</wsdl:input>
    	<wsdl:output>
    		<soap:body use="literal"/>
    	</wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getPersons">
    	<soap:operation
soapAction="http://localhost:9090/axis/services/PersonTestSOAP/getPersons"/>
    	<wsdl:input>
    		<soap:body use="literal"/>
    	</wsdl:input>
    	<wsdl:output>
    		<soap:body use="literal"/>
    	</wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="PersonTest">
    <wsdl:port name="PersonTestSOAP" binding="tns:PersonTestSOAP">
      <soap:address
location="http://localhost:9090/axis/services/PersonTestSOAP"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

The soap messages exchanged in the .net client with axis webservices is:

for getPerson():

POST /axis/services/PersonTestSOAP HTTP/1.1

VsDebuggerCausalityData: AAA

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.573)

Content-Type: text/xml; charset=utf-8

SOAPAction: "http://localhost:9090/axis/services/PersonTestSOAP/getPerson"

Content-Length: 236

Expect: 100-continue

Connection: Keep-Alive

Host: 127.0.0.1:9050

<?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
/></soap:Envelope>

Reply:

HTTP/1.1 100 Continue

HTTP/1.1 200 OK

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Fri, 06 May 2005 22:08:16 GMT

Server: Apache-Coyote/1.1

19c

<?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><getPersonResponse
xmlns="http://shantanu.org/PersonTest/"><name xmlns="">Shantanu
Chawla</name><age
xmlns="">27</age></getPersonResponse></soapenv:Body></soapenv:Envelope>

0


for getPersons():

POST /axis/services/PersonTestSOAP HTTP/1.1

VsDebuggerCausalityData: AwAAAA

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client
Protocol 1.1.4322.573)

Content-Type: text/xml; charset=utf-8

SOAPAction: "http://localhost:9090/axis/services/PersonTestSOAP/getPersons"

Content-Length: 236

Expect: 100-continue

Connection: Keep-Alive

Host: 127.0.0.1:9050

<?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
/></soap:Envelope>
Reply:

HTTP/1.1 100 Continue

HTTP/1.1 200 OK

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Fri, 06 May 2005 22:09:32 GMT

Server: Apache-Coyote/1.1

19c

<?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><getPersonResponse
xmlns="http://shantanu.org/PersonTest/"><name xmlns="">Shantanu
Chawla</name><age
xmlns="">27</age></getPersonResponse></soapenv:Body></soapenv:Envelope>

0

As you can see the getPersons() function reply is getPerson() reply.

Can someone provide any insight into it. I have tried it so many time
that I have run out of ideas.

Thanks 

Shantanu
-- 
Graduate Student 
Department of Computer Science,
San Diego State University

Mime
View raw message