axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DealRaider.com" <sr...@dealraider.com>
Subject No such operation error using document/literal service
Date Wed, 22 Oct 2003 04:48:09 GMT
Hello,

    Thanks to slight hints in previous responses, I think I am now able 
to better explain my current issue:

I have a pre-specified WSDL document I'm creating a new Web Service for. 
It specifies a doc/literal type style.

I've attached the full WSDL, and also list here some of the key excerpts 
for the example in this message:

<types>
    <schema targetNamespace="urn:LibraryDemo\srvcGeneral\srvcdoc" 
elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" 
xmlns:ns="urn:LibraryDemo\srvcGeneral\srvcdoc" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <complexType name="CollectionOfOrder">
            <sequence>
                <element name="Order" minOccurs="0" 
maxOccurs="unbounded" type="ns:Order"/>
            </sequence>
        </complexType>
        <element name="x_GetOutstandingOrders" 
type="ns:GetOutstandingOrders"/>
        <complexType name="GetOutstandingOrders">
            <sequence>
                <element name="PrderIdentification" minOccurs="1" 
maxOccurs="1" type="xsd:int"/>
            </sequence>
        </complexType>
        <element name="x_GetOutstandingOrdersResponse" 
type="ns:CollectionOfOrder"/>
</types>
<message name="GetOutstandingOrders">
    <part name="parameter" element="ns:x_GetOutstandingOrders"/>
</message>
<message name="GetOutstandingOrdersResponse">
    <part name="return" element="ns:x_GetOutstandingOrdersResponse"/>
</message>
<portType name="ElectronicMarket">
    <operation name="GetOutstandingOrders">
        <documentation>It returns all the orders placed by a party that 
didn't match any other.</documentation>
        <input message="ns:GetOutstandingOrders"/>
        <output message="ns:GetOutstandingOrdersResponse"/>
    </operation>
</portType>
<binding name="ElectronicMarket" type="ns:ElectronicMarket">
   <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="GetOutstandingOrders" selector="getOutstandingOrders:">
      <soap:operation soapAction=""/>
      <input>
          <soap:body use="literal" 
namespace="urn:LibraryDemo\srvcGeneral\srvcdoc"/>
      </input>
      <output>
          <soap:body use="literal" 
namespace="urn:LibraryDemo\srvcGeneral\srvcdoc"/>
      </output>
  </operation>
</binding>

Here were the steps I completed:
1. Run WSDL2Java on this WSDL file to generate stubs, classes and 
interfaces.
2. Replaced occurrences of the urn:LibraryDemo\srvcGeneral\srvcdoc in 
the code with double-backslashes to enable compilation (I reported this 
as a bug earlier, since Axis should allow backslashes in the URI)
3. Created a simple session bean that implements the ElectronicMarket 
interface.
4. Deployed the service using the following settings (excerpt from the 
server-config.wsdd file)
5. Tried a test client using a generated stub to call the service method 
GetOutstandingOrders (this gives the No such operation error I mention here)

excerpt from server-config.wsdd:
<service name="ElectronicMarketService" provider="java:EJB" 
style="document" use="literal">
  <wsdlFile>ElectronicMarket.wsdl</wsdlFile>
  <requestFlow>
   <handler name="soapmonitor" 
type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </requestFlow>
  <responseFlow>
   <handler name="soapmonitor" 
type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </responseFlow>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="jndiURL" value="jnp://localhost:1099"/>
  <parameter name="className" 
value="edu.uiuc.cs427.j2e3.service.ElectronicMarketServiceBean"/>
  <parameter name="jndiContextClass" 
value="org.jnp.interfaces.NamingContextFactory"/>
  <parameter name="remoteInterfaceName" 
value="edu.uiuc.cs427.j2e3.service.ElectronicMarketServiceLocal"/>
  <parameter name="beanJndiName" value="ElectronicMarketServiceLocal"/>
  <parameter name="homeInterfaceName" 
value="edu.uiuc.cs427.j2e3.service.ElectronicMarketServiceLocalHome"/>
 </service>

TestClient sample code:
ElectronicMarketStub marketStub =
   new ElectronicMarketStub(new URL(endpoint), null);
CollectionOfOrder coll = marketStub.getOutstandingOrders(new 
GetOutstandingOrders());

---------------------

Now, to the error:

The error I get when running this is:

No such operation 'x_GetOutstandingOrders'
    at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
    at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
    at 
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1015)
    at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
    at org.apache.crimson.parser.Parser2.content(Unknown Source)
    at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
    at org.apache.crimson.parser.Parser2.content(Unknown Source)
    at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
    at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
    at org.apache.crimson.parser.Parser2.parse(Unknown Source)
    at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at 
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:2248)
    at org.apache.axis.client.Call.invoke(Call.java:2171)
    at org.apache.axis.client.Call.invoke(Call.java:1691)
    at 
edu.uiuc.cs427.soap.ElectronicMarketStub.getOutstandingOrders(Unknown 
Source)
    at 
edu.uiuc.cs427.j2e3.service.test.TestSOAPClient.main(TestSOAPClient.java:30)

-------------------

This is the TCP message that is being sent:

POST /axis/services/ElectronicMarketService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/#axisVersion#
Host: 127.0.0.1
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 414

<?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>
  <x_GetOutstandingOrders xmlns="urn:LibraryDemo\srvcGeneral\srvcdoc">
   <PrderIdentification>0</PrderIdentification>
  </x_GetOutstandingOrders>
 </soapenv:Body>
</soapenv:Envelope>

--------------------------

I've tried setting the SOAPAction to "GetOutstandingOrders" instead of 
"", but this resulted in the same error. The application shows up when I 
list the deployed web services in Axis.

One other thing I've tried:
In the deploy.wsdd, I'm unsure if Axis parses in the \ as an 
escape-character or not, so I've tried setting the namespace there to both:
xmlns:ns="urn:LibraryDemo\\srvcGeneral\\srvcdoc"
and
xmlns:ns="urn:LibraryDemo\srvcGeneral\srvcdoc"

both give an error. Which is the right way btw?

------------------

So, can anyone please help with why this is telling me No such 
operation? I am bound to use the doc/literal since I'm forced to conform 
to this WSDL.

I've read an interesting article here: 
http://www.javaworld.com/javaworld/jw-10-2003/jw-1003-wsstyles-p2.html
which flat-out claims Axis does not truly support doc/literal. I'm 
hoping this is wrong given the time I've invested into it so far. 
However, if this is true, I'm going to leave Axis for GLUE or WASP or 
any other recommendations?

Thank you in advance, let me know if you need more information.

Mime
View raw message