I think that when you use doc/lit operations, you must provide a each with a
distinct SoapAction in the bindings, e.g.
wsdlsoap:soapAction="http://mycompany.com/mySubtract"; .

This might not be necessary if the Wrapped style is used, but better to be
safe.

Jeff
----- Original Message ----- 
From: "Yakulis, Ross (Ross)" <[EMAIL PROTECTED]>
To: "Axis User (E-mail)" <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 2:45 PM
Subject: Is this a bug?


Given below ( the interface, the client, the generated WSDL and the SOAP
messages generated).  When I use the generated stubs, methods with the same
signature ( int add( int ) and int subtract( int ) ) are not distinguished
on the server side.  What happens is that add gets called when subtract
should.  This seems like a bug?
Things work fine if I use RPC Encoded though. I am using Axis 1.1 release
build.

Ross


------------ Intergace ------------------------
public interface Doit {
public int add( int value );
public int subtract( int value );
public String getString();
}
------------- Client ----------------------------------------
   DoitServiceLocator locator = new DoitServiceLocator();
   Doit doit = locator.getDoit(new
URL("http://localhost:6060/axis/services/Doit";));
   org.apache.axis.client.Stub stub = (Stub) doit;
   stub.setTimeout(45000);//in milliseconds
   stub.setMaintainSession(true);
   // Invoke Service
   int result = doit.add(5);
   result = doit.subtract(2);
   String str = doit.getString();
------------ Java2WSDL --------------------------------------------
java -org.apache.axis.wsdl.Java2WSDL  -oC:\eclipse\runtime-workspace\Doit/ws
dl/doit.wsdl -lhttp://localhost:8080/doit -T1.2 -yDocument -uLiteral -nurn:N
S.doit Doit
------------ WSDL2Java --------------------------------------------
java
org.apache.axis.wsdl.WSDL2Java  -T1.2 -O45 -dSession -s -Sfalse -px.y -oC:\e
clipse\runtime-workspace\doit/.
C:/eclipse/runtime-workspace/Doit/wsdl/doit.wsdl
------------------WSDL-------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:avaya.test.Doit"
xmlns:impl="urn:avaya.test.Doit" xmlns:intf="urn:avaya.test.Doit"
xmlns:apachesoap="http://xml.apache.org/xml-soap";
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns="http://schemas.xmlsoap.org/wsdl/";>
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema";
targetNamespace="urn:avaya.test.Doit">
   <element name="in0" type="xsd:int"/>
   <element name="addReturn" type="xsd:int"/>
   <element name="getStringReturn" type="soapenc:string"/>
   <element name="in0" type="xsd:int"/>
   <element name="subtractReturn" type="xsd:int"/>
  </schema>
 </wsdl:types>
   <wsdl:message name="subtractResponse">
      <wsdl:part name="subtractReturn" element="impl:subtractReturn"/>
   </wsdl:message>
   <wsdl:message name="addRequest">
      <wsdl:part name="in0" element="impl:in0"/>
   </wsdl:message>
   <wsdl:message name="subtractRequest">
      <wsdl:part name="in0" element="impl:in0"/>
   </wsdl:message>
   <wsdl:message name="getStringRequest">
   </wsdl:message>
   <wsdl:message name="getStringResponse">
      <wsdl:part name="getStringReturn" element="impl:getStringReturn"/>
   </wsdl:message>
   <wsdl:message name="addResponse">
      <wsdl:part name="addReturn" element="impl:addReturn"/>
   </wsdl:message>
   <wsdl:portType name="Doit">
      <wsdl:operation name="add" parameterOrder="in0">
         <wsdl:input name="addRequest" message="impl:addRequest"/>
         <wsdl:output name="addResponse" message="impl:addResponse"/>
      </wsdl:operation>
      <wsdl:operation name="getString">
         <wsdl:input name="getStringRequest"
message="impl:getStringRequest"/>
         <wsdl:output name="getStringResponse"
message="impl:getStringResponse"/>
      </wsdl:operation>
      <wsdl:operation name="subtract" parameterOrder="in0">
         <wsdl:input name="subtractRequest" message="impl:subtractRequest"/>
         <wsdl:output name="subtractResponse"
message="impl:subtractResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="DoitSoapBinding" type="impl:Doit">
      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="add">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="addRequest">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:input>
         <wsdl:output name="addResponse">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="getString">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="getStringRequest">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:input>
         <wsdl:output name="getStringResponse">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="subtract">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="subtractRequest">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:input>
         <wsdl:output name="subtractResponse">
            <wsdlsoap:body use="literal" namespace="urn:avaya.test.Doit"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="DoitService">
      <wsdl:port name="Doit" binding="impl:DoitSoapBinding">
         <wsdlsoap:address location="http://localhost:8080/Doit"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
-------------------------------------------------
SOAP MESSAGES

(add request )
POST /axis/services/Doit HTTP/1.0 Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1 Host: localhost Cache-Control: no-cache Pragma:
no-cache SOAPAction: "" Content-Length: 329
<?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>
  <in0 xsi:type="xsd:int" xmlns="urn:avaya.test.Doit">5</in0>
 </soapenv:Body>
</soapenv:Envelope>

(subtract request)
POST /axis/services/Doit HTTP/1.0 Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1 Host: localhost Cache-Control: no-cache Pragma:
no-cache SOAPAction: "" Content-Length: 329 Cookie:
JSESSIONID=831C6114C07150699BBC1DB773F2E740
<?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>
  <in0 xsi:type="xsd:int" xmlns="urn:avaya.test.Doit">2</in0>
 </soapenv:Body>
</soapenv:Envelope>

(get String request)
POST /axis/services/Doit HTTP/1.0 Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1 Host: localhost Cache-Control: no-cache Pragma:
no-cache SOAPAction: "" Content-Length: 310 Cookie:
JSESSIONID=831C6114C07150699BBC1DB773F2E740
<?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>
  <getString xmlns="urn:avaya.test.Doit"/>
 </soapenv:Body>
</soapenv:Envelope>

-------------------------------
------------------WSDD -------------
<deployment
    xmlns="http://xml.apache.org/axis/wsdd/";
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>

  <!-- Services from DoitService WSDL service -->

  <service name="Doit" provider="java:RPC" style="document" use="literal">
      <parameter name="wsdlTargetNamespace" value="urn:avaya.test.Doit"/>
      <parameter name="wsdlServiceElement" value="DoitService"/>
      <parameter name="wsdlServicePort" value="Doit"/>
      <parameter name="className" value="x.y.DoitSoapBindingImpl"/>
      <parameter name="wsdlPortType" value="Doit"/>
      <operation name="add" qname="operNS:add"
xmlns:operNS="urn:avaya.test.Doit" returnQName="retNS:addReturn"
xmlns:retNS="urn:avaya.test.Doit" returnType="rtns:int"
xmlns:rtns="http://www.w3.org/2001/XMLSchema"; >
        <parameter qname="pns:in0" xmlns:pns="urn:avaya.test.Doit"
type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
      </operation>
      <operation name="getString" qname="operNS:getString"
xmlns:operNS="urn:avaya.test.Doit" returnQName="retNS:getStringReturn"
xmlns:retNS="urn:avaya.test.Doit" returnType="rtns:string"
xmlns:rtns="http://schemas.xmlsoap.org/soap/encoding/"; >
      </operation>
      <operation name="subtract" qname="operNS:subtract"
xmlns:operNS="urn:avaya.test.Doit" returnQName="retNS:subtractReturn"
xmlns:retNS="urn:avaya.test.Doit" returnType="rtns:int"
xmlns:rtns="http://www.w3.org/2001/XMLSchema"; >
        <parameter qname="pns:in0" xmlns:pns="urn:avaya.test.Doit"
type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
      </operation>
      <parameter name="allowedMethods" value="add getString subtract"/>
      <parameter name="scope" value="Session"/>

  </service>
</deployment>

Reply via email to