You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Bruno <qu...@verizon.net> on 2008/04/12 20:51:14 UTC

simple HTTP POST soap xml 'No such operation'

It must be so simple to POST a SOAP envelope but I've hit a brick wall and hope you know the "magic" solution.

Things work fine when calling the web service using Axis - but now I'm in an environment where there is no Axis.

So I grabbed the SOAP XML from tcpmon and am sending the SOAP envelope with a simple HTTP POST. It seems to me that the only arguments
I've got to work "magic" with are :
       
            String url = "http://eranger.us/axis/services";
            String soapAction = "eRanger-campground_vending/findSites";

In the axis version, I used 'call.setOperationName( new QName("eRanger-campground_vending", "findSites" )' - perhaps that QName thingy (???) is now missing? All I'm doing now is:
          
           HttpClient client = new HttpClient();
           PostMethod postMethod = new PostMethod(  url  );
          
               StringBuffer request = new StringBuffer();
               request.append( soapRequestXML );
               postMethod.setRequestBody(request.toString());
               postMethod.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
          
           postMethod.setRequestHeader("SOAPAction",  soapAction  );
           client.executeMethod(postMethod);  
          
But alas, I just can not get past the "No such operation 'findSites'" error response (see below) no matter what url/soapAction I try:

What do I need to set for 'url/soapAction' - or am I missing something altogether? .

thank you for any help - got a deadline to meet in about 60 hours (Google's Android Challenge - SOS :< )
bruno@eranger.us

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

Here's the soapRequestXML:

    String soapRequestXML =
        "<?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>" +
                "<ns1:findSites " +
                   
"soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" " +
                    "xmlns:ns1=\"eRanger-campground-vending\"> +" +
                    "<ns1:arg0 href=\"#id0\"/>" +
                    "<ns1:arg1 href=\"#id1\"/>" +
                "</ns1:findSites>" +
                "<multiRef id=\"id0\" soapenc:root=\"0\"
soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"
xsi:type=\"soapenc:int\"
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
                    "18" +
                "</multiRef>" +
                "<multiRef id=\"id1\" soapenc:root=\"0\"
soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"
xsi:type=\"soapenc:int\"
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\">" +
                    "3" +
                "</multiRef>" +
            "</soapenv:Body>" +
        "</soapenv:Envelope>";


Here's the error response:


    <?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>
            <soapenv:Fault>
                <faultcode>Server.userException</faultcode>
                <faultstring>No such operation 'findSites'</faultstring>
                <detail>
                    <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
                        oslo
                    </ns1:hostname>
                </detail>
            </soapenv:Fault>
        </soapenv:Body>
    </soapenv:Envelope>


Here's the WSDL:

−
    <wsdl:definitions
targetNamespace="http://www.eranger.us/axis/services/eRanger-campground-vending">
−
    <!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
−
    <wsdl:message name="cancelSiteRequest">
<wsdl:part name="site" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:message name="bookSiteResponse">
<wsdl:part name="bookSiteReturn" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:message name="findSitesResponse">
<wsdl:part name="findSitesReturn" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:message name="bookSiteRequest">
<wsdl:part name="preferredSites" type="xsd:string"/>
<wsdl:part name="reservationNumber" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:message name="cancelSiteResponse">
<wsdl:part name="cancelSiteReturn" type="xsd:boolean"/>
</wsdl:message>
−
    <wsdl:message name="findSitesRequest">
<wsdl:part name="lengthRv" type="xsd:int"/>
<wsdl:part name="noTents" type="xsd:int"/>
</wsdl:message>
−
    <wsdl:message name="checkinReservationResponse">
<wsdl:part name="checkinReservationReturn" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:message name="checkinReservationRequest">
<wsdl:part name="reservationNumber" type="xsd:string"/>
</wsdl:message>
−
    <wsdl:portType name="Vending">
−
    <wsdl:operation name="checkinReservation"
parameterOrder="reservationNumber">
<wsdl:input message="impl:checkinReservationRequest"
name="checkinReservationRequest"/>
<wsdl:output message="impl:checkinReservationResponse"
name="checkinReservationResponse"/>
</wsdl:operation>
−
    <wsdl:operation name="findSites" parameterOrder="lengthRv noTents">
<wsdl:input message="impl:findSitesRequest" name="findSitesRequest"/>
<wsdl:output message="impl:findSitesResponse" name="findSitesResponse"/>
</wsdl:operation>
−
    <wsdl:operation name="bookSite" parameterOrder="preferredSites
reservationNumber">
<wsdl:input message="impl:bookSiteRequest" name="bookSiteRequest"/>
<wsdl:output message="impl:bookSiteResponse" name="bookSiteResponse"/>
</wsdl:operation>
−
    <wsdl:operation name="cancelSite" parameterOrder="site">
<wsdl:input message="impl:cancelSiteRequest" name="cancelSiteRequest"/>
<wsdl:output message="impl:cancelSiteResponse" name="cancelSiteResponse"/>
</wsdl:operation>
</wsdl:portType>
−
    <wsdl:binding name="eRanger-campground-vendingSoapBinding"
type="impl:Vending">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
−
    <wsdl:operation name="checkinReservation">
<wsdlsoap:operation soapAction=""/>
−
    <wsdl:input name="checkinReservationRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://services.eRanger.us" use="encoded"/>
</wsdl:input>
−
    <wsdl:output name="checkinReservationResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eranger.us/axis/services/eRanger-campground-vending"
use="encoded"/>
</wsdl:output>
</wsdl:operation>
−
    <wsdl:operation name="findSites">
<wsdlsoap:operation soapAction=""/>
−
    <wsdl:input name="findSitesRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://services.eRanger.us" use="encoded"/>
</wsdl:input>
−
    <wsdl:output name="findSitesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eranger.us/axis/services/eRanger-campground-vending"
use="encoded"/>
</wsdl:output>
</wsdl:operation>
−
    <wsdl:operation name="bookSite">
<wsdlsoap:operation soapAction=""/>
−
    <wsdl:input name="bookSiteRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://services.eRanger.us" use="encoded"/>
</wsdl:input>
−
    <wsdl:output name="bookSiteResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eranger.us/axis/services/eRanger-campground-vending"
use="encoded"/>
</wsdl:output>
</wsdl:operation>
−
    <wsdl:operation name="cancelSite">
<wsdlsoap:operation soapAction=""/>
−
    <wsdl:input name="cancelSiteRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://services.eRanger.us" use="encoded"/>
</wsdl:input>
−
    <wsdl:output name="cancelSiteResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eranger.us/axis/services/eRanger-campground-vending"
use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
    <wsdl:service name="VendingService">
−
    <wsdl:port binding="impl:eRanger-campground-vendingSoapBinding"
name="eRanger-campground-vending">
<wsdlsoap:address
location="http://www.eranger.us/axis/services/eRanger-campground-vending"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

<!-- the end -->


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org