The problem is caused by the fact that you don't provide unique
signatures to differentiate the two methods, therefore .NET sends the
same message (an empty <soap:Body/>) for both methods, and Axis always
invokes the first method. (I'm unclear why it works with the Axis
client, because it also should send identical messages.)

I've take the liberty of fixing your WSDL so that it supports the
"wrapped" style, which should fix your problem. I didn't fix your
first method, only the getPerson and getPersons methods.

<?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"/>

     <!-- ATM: request wrapper elements created/modified to provide unique 
          signatures for getPerson and getPersons operations. 
          Both wrapper elements are defined to be type tns:Void -->

     <xsd:element name="getPerson" type="tns:Void"/>
     <xsd:element name="getPersons" type="tns:Void"/>

     <!-- ATM: response wrapper elements (unchanged) -->

     <xsd:element name="getPersonResponse" type="tns:Person"/>
     <xsd:element name="getPersonsResponse" type="tns:PersonsContainer"/>

     <!-- ATM: types used by request and response wrapper elements -->

     <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:complexType name="PersonsContainer">
       <xsd:sequence>
          <xsd:element name="count" type="xsd:int"></xsd:element>
            <!-- ATM: changed name from "persons" to "person" 
            (assuming you want each person element to be named "person") 
            and removed nillable="true" (better to return empty
element than nil element) -->
          <xsd:element name="person" type="tns:Person" minOccurs="0"
            maxOccurs="unbounded"></xsd:element>
       </xsd:sequence>
     </xsd:complexType>

     <!-- ATM added Void type to be used as input to getPerson and
getPersons operations -->
     <xsd:complexType name="Void">
       <xsd:sequence/>
     </xsd:complexType>

   </xsd:schema>
 </wsdl:types>

      <!-- ATM: changed names of message parts to "parameters" to
follow "wrapped" convention -->

 <wsdl:message name="NewOperationResponse">
   <wsdl:part name="parameters" element="tns:NewOperationResponse"/>
 </wsdl:message>
 <wsdl:message name="NewOperationRequest">
   <wsdl:part name="parameters" element="tns:NewOperationRequest"/>
 </wsdl:message>

 <wsdl:message name="getPersonResponse">
       <wsdl:part name="parameters" element="tns:getPersonResponse"/>
 </wsdl:message>
 <wsdl:message name="getPersonRequest">
       <wsdl:part name="parameters" element="tns:getPerson"/>
 </wsdl:message>

 <wsdl:message name="getPersonsResponse">
       <wsdl:part name="parameters" element="tns:getPersonsResponse"/>
 </wsdl:message>
 <wsdl:message name="getPersonsRequest">
       <wsdl:part name="parameters" element="tns:getPersons"/>
 </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>

Regards,
Anne

On 5/6/05, James Black <[EMAIL PROTECTED]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> shantanu chawla wrote:
> > 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.
> 
>   One solution, which I haven't used, is to modify the wsdl file by
> hand. If you look at some of the archives you will find references about
> that.
> 
>   What I do is convert my array of beans into an xml file, and pass it
> as a string, and just convert the xml file back into an array of beans
> on the .net side.  C# has a wonderful way to handle xml files.
> 
>   There are known interop issues between java and .net, and I hope that
> at some point it is fixed.
> 
> - --
> Corruptisima republica plurimae leges. [The more corrupt a republic, the
> more laws.]
> Tacitus from Annals III, 116AD
> Blogs: http://jamesruminations.blogspot.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.0 (MingW32)
> 
> iD8DBQFCe/S+J/zyYkX46joRAiINAJ9bie/Zvy7eUJoNLECZh8BjWmd1CQCgi1Nm
> dAavAFhIgSM4qqUcM3WmFbE=
> =HO5Z
> -----END PGP SIGNATURE-----
>

Reply via email to