I've been able to place multiple methods in a single service.  My WSDL is a follows 
(note that although my service is using a message interface, ie Document 
<method>(Document in), the WSDL specifies "rpc" although I believe that "document" 
works just as well and the input part names match the method names):

<definitions name="TestCase"
        ...
  <types>
    <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema";
                targetNamespace="TestCase">
      <xsd:complexType name="WsTestOp1Type">
        ...
      </xsd:complexType>
      <xsd:complexType name="WsTestOp2Type">
        ...
      </xsd:complexType>
    </xsd:schema>
  </types>

  <message name="WsTestOp1In">
    <part name="WsTestOp1Wrapper" type="typens:WsTestOp1Type"/>
  </message>
  <message name="WsTestOp1Out">
    <part name="WsTestOp1"        type="typens:WsTestOp1Type"/>
  </message>

  <message name="WsTestOp2In">
    <part name="WsTestOp2Wrapper" type="typens:WsTestOp2Type"/>
  </message>
  <message name="WsTestOp2Out">
    <part name="WsTestOp2"        type="typens:WsTestOp2Type"/>
  </message>

  <portType name="TestCasePort">
    <operation name="WsTestOp1">
      <input message="wsdlns:WsTestOp1In"/>
      <output message="wsdlns:WsTestOp1Out"/>
    </operation>

    <operation name="WsTestOp2">
      <input message="wsdlns:WsTestOp2In"/>
      <output message="wsdlns:WsTestOp2Out"/>
    </operation>

  </portType>

  <binding name="TestCaseBinding"  type="wsdlns:TestCasePort">
    <soap:binding style="rpc"      transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="WsTestOp1">
      <soap:operation soapAction="TestCase"/>
      <input>
        <soap:body namespace="http://localhost:8080/axis/services/TestCase"; 
use="literal"/>
      </input>
      <output>
        <soap:body namespace="http://localhost:8080/axis/services/TestCase"; 
use="literal"/>
      </output>
    </operation>
    <operation name="WsTestOp2">
      <soap:operation soapAction="TestCase"/>
      <input>
        <soap:body namespace="http://localhost:8080/axis/services/TestCase"; 
use="literal"/>
      </input>
      <output>
        <soap:body namespace="http://localhost:8080/axis/services/TestCase"; 
use="literal"/>
      </output>
    </operation>
  </binding>

  <service name="TestCase">
    <documentation>
    </documentation>
    <port name="TestCasePort"      binding="wsdlns:TestCaseBinding">
      <soap:address location="http://localhost:8080/axis/services/TestCase"/>
    </port>
  </service>
</definitions>

-----Original Message-----
From: Steve Pannier [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 5:29 PM
To: [EMAIL PROTECTED]
Subject: Does Message style support only one method per service?


I'm using Message style, and when I have one method defined
everything works OK.  But, when I add another method to my
service, I get the following exception:

Couldnt find an appropriate operation for XML QName {0}

I've searched the mailing list for information regarding this, and
found a comment that Message style supports only one method
(i.e. operation) per service.  Is this true?

Or is there a way for me to somehow indicate the operation name
in the Soap request for Message style services?


Here is the WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DocStyle.test.com";
                  xmlns="http://schemas.xmlsoap.org/wsdl/";
                  xmlns:apachesoap="http://xml.apache.org/xml-soap";
                  xmlns:impl="http://DocStyle.test.com";
                  xmlns:intf="http://DocStyle.test.com";
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
                  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 targetNamespace="http://DocStyle.test.com";
          xmlns="http://www.w3.org/2001/XMLSchema";>
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <xsd:element name="JISoapHeader">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="configFile" nillable="true" type="xsd:string"/>
      <xsd:element name="sessionName" nillable="true" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="StockSymbol_XSD" type="xsd:string">
     </xsd:element>
   <xsd:element name="StockPrice_XSD" type="xsd:string">
     </xsd:element>
  </schema>
 </wsdl:types>

   <wsdl:message name="JIHeaderRequest">
      <wsdl:part element="intf:JISoapHeader" name="JIHeader"/>
   </wsdl:message>

   <wsdl:message name="stockQuoteRequest">
      <wsdl:part element="intf:StockSymbol_XSD" name="InVar_0"/>
   </wsdl:message>

   <wsdl:message name="stockQuoteResponse">
      <wsdl:part element="intf:StockPrice_XSD" name="OutVar_0"/>
   </wsdl:message>

   <wsdl:portType name="DocStyleImpl">
      <wsdl:operation name="stockQuote" parameterOrder="InVar_0">
         <wsdl:input message="intf:stockQuoteRequest"
                     name="stockQuoteRequest"/>
         <wsdl:output message="intf:stockQuoteResponse"
                      name="stockQuoteResponse"/>
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="DocStyle" type="intf:DocStyleImpl">
      <wsdlsoap:binding style="document"
                        transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="stockQuote">
         <wsdlsoap:operation soapAction=""/>
         <wsdl:input name="stockQuoteRequest">
            <wsdlsoap:body namespace="http://DocStyle.test.com"; use
="literal"/>
            <wsdlsoap:header message="intf:JIHeaderRequest"
                             namespace="http://DocStyle.test.com";
                             part="JIHeader" use="literal">
            </wsdlsoap:header>
         </wsdl:input>
         <wsdl:output name="stockQuoteResponse">
            <wsdlsoap:body namespace="http://DocStyle.test.com"; use
="literal"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="DocStyle">
      <wsdl:port binding="intf:DocStyle" name="DocStylePort">
         <wsdlsoap:address location
="http://localhost:8091/axis/services/DocStyle"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>


Here is my WSDD with the 2nd method defined in allowedMethods:

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

    <service name="DocStyle" provider="Handler" style="message">
        <wsdlFile>/DocStyle.wsdl</wsdlFile>
        <parameter name="className" value
="com.test.DocStyle.DocStyleImpl"/>
        <parameter name="handlerClass" value="com.test.MyMsgProvider"/>
        <parameter name="allowedMethods" value="MyDebug stockQuote"/>
    </service>
</deployment>


Here is the request my .NET client is generating, which results in the
above exception:

<?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>
    <StockSymbol_XSD
               xmlns="http://DocStyle.test.com";>XYZ</StockSymbol_XSD>
  </soap:Body>
</soap:Envelope>


Regards.

Steve Pannier



Reply via email to