axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anoop Elias <mailme_...@yahoo.com>
Subject Re: simple HTTP POST soap xml 'No such operation'
Date Sun, 13 Apr 2008 03:04:31 GMT
Please find the response I got....

I guess you have to read it from xml file rather than applying from a String variable. It
could be looking for an EOF or something.
Will check if we can use String variable itself. Will keep you posted.

Thanks,
Anoop

<?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:findSitesResponse
            soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:ns1="eRanger-campground-vending">
        <findSitesReturn xsi:type="xsd:string">
    6@25.0,7@25.0,13@25.0,18@25.0,20@25.0,22@25.0,23@25.0,25@25.0,26@25.0,27@25.0,28@25.0,29@25.0,31@25.0,32@25.0,34@25.0,35@25.0,39@25.0,43@25.0,44@25.0
    
    </findSitesReturn>
        </ns1:findSitesResponse>
    </soapenv:Body>
</soapenv:Envelope>

----- Original Message ----
From: Bruno <quatrohund@verizon.net>
To: axis-user@ws.apache.org
Sent: Saturday, April 12, 2008 7:13:58 PM
Subject: Re: simple HTTP POST soap xml 'No such operation'

  Elias,

Thanks for the input, but running your code I get:

    "Server returned HTTP response code: 500 for URL:http://eranger.us/axis/services"

Did you get a good response that looks something like:

 6@25.0,7@25.0,18@25.0,19@25.0,20@25.0,21@25.0,22@25.0,23@25.0,25@25.0,26@25.0,28@25.0,29@25.0,31@25.0,32@25.0,34@25.0,35@25.0,39@25.0,40@25.0,41@25.0,42@25.0,43@25.0,44@25.0,48@25.0,49@25.0,50@25.0,51@25.0,52@25.0,53@25.0,54@25.0,55@25.0,57@25.0

Looks like you're on a Windows platform, so maybe it works there butnot where I'm at ?

bfn, Bruno


Anoop Elias wrote:  This is what I had tried, and it worked for me!..


    public static void main(String[] args) throws Exception {
        URL url = new URL("http://eranger.us/axis/services");

        URLConnection conn = url.openConnection();
        conn.addRequestProperty("SOAPAction",
                "eRanger-campground_vending/findSites");
        conn.setDoOutput(true);

        PrintWriter writer = new PrintWriter(new OutputStreamWriter(conn
                .getOutputStream()));

        InputStream contents = new FileInputStream("C:/Technical/WebServices/SOAPRequest.xml");
        BufferedReader buff = new BufferedReader(
                new InputStreamReader(contents));

        String line;
        while ((line = buff.readLine()) != null) {
            writer.write(line);
        }

        writer.flush();
        InputStream input = null;
        try {
            input = conn.getInputStream();
        } catch (Exception e) {
            e.printStackTrace();
        }

        BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(input));
        StringBuffer buffer = new StringBuffer();

        String s;
        while ((s = bufferedReader.readLine()) != null) {
            buffer.append(s);
        }
        System.out.println(buffer.toString());
    }


Thanks,
Anoop

----- Original Message ----
From: Bruno <quatrohund@verizon.net>
To: axis-user@ws.apache.org
Sent: Saturday, April 12, 2008 11:51:14 AM
Subject: 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





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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


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




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
View raw message