Blogs

Showing 1 - 20 of 21 results.
Items per Page 20
of 2

Forums

« Back to Cisco Webdialer Questions

RE: What's wrong with this isClusterUserSoap message?

Combination View Flat View Tree View
Threads [ Previous | Next ]
I basically copied and pasted the example from the developer guide and swapped out the userid... and I get a HTTP error 500 from Tomcat. I put webdialer trace level to debug and I'm not getting a single entry when sending the command..
 
What am I missing here?
 
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:WebdialerSoap" xmlns:types="urn:WebdialerSoap/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <tns:isClusterUserSoap><userid xsi:type="xsd:string">sste</userid></tns:isClusterUserSoap></soap:Body></soap:Envelope>
 
By the way.. same thing happens with the other samples in the devguide. 
I successfully managed to get things going with a .NET stub but in order to figure out what's different I need to see the plaintext going over the wire and I cannot find it in the logs - and in the end I need it in my Java lib.

Just checking - is the Webdialer service activated/running?
 
Are you posting to the right URL? 
 
https://10.88.131.133/webdialer/services/WebdialerSoapService70 or
https://10.88.131.133/webdialer/services/WebdialerSoapService
 
HTTP headers good?
 
POST https://10.88.131.133/webdialer/services/WebdialerSoapService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 10.88.131.133
Content-Length: 513
 
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WD70">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:isClusterUserSoap soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <in0 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">dstaudt</in0>
      </urn:isClusterUserSoap>
   </soapenv:Body>
</soapenv:Envelope>

David... yes the webdialer is up and running (confirmed by calling methods on the .NET stub that work) and the url is correct (again.. with the .NET stub that is bound to the same address it works).
 
I'd very much like to see the output you're showing.. but where can I get that from? It used to be so easy with HTTP.. fire up Wireshark and you're good to analyze. I managed to get WCF tracing going on .NET and compared the messages.. don't see anything very wrong.
 
Then I took a simple webpage that allows posting (normally use that to push content to phones to see if it works) and I got a response that got me on the way... it tells me there's no SOAPAction header. However, what am I supposed to put in the SOAPAction header? Looking at the WSDL I think it's urn:isClusterUserSoap but that doesn't work. Neither does putting an empty SOAPAction header.
 
Here's my Java code:
 
String myReq = "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Header><Action s:mustUnderstand=\"1\" xmlns=\"http://schemas.microsoft.com/ws/2005/05/addressing/none\">urn:isClusterUserSoap</Action></s:Header>"
                    + "<s:Body s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"
                    + "<q1:isClusterUserSoap xmlns:q1=\"urn:WebdialerSoap\"><userid xsi:type=\"xsd:string\" xmlns=\"\">sste</userid></q1:isClusterUserSoap>"
                    + "</s:Body></s:Envelope>";


            String result = dialer.sendRequest(myReq, "urn:isClusterUserSoap");
 
public String sendRequest(String request, String action) throws CommunicationException
    {
        try
        {
            String soapRequest = request;
            tracer.Trace("AXL request: " + soapRequest, 5);
            URL url = new URL("https://10.145.206.141/webdialer/services/WebdialerSoapService");
            HttpsURLConnection conn = (HttpsURLConnection)url.openConnection ();
            conn.setDoInput(true);
            conn.setDoOutput(true);
            conn.setFollowRedirects(true);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "text/xml");
            conn.setRequestProperty("Content-Length", "" + soapRequest.length());
            conn.setRequestProperty("Authorization", "Basic " + this.authentication);
            conn.setRequestProperty("SOAPAction", action);
            conn.connect();
            PrintWriter pout = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(), "UTF-8"), true);
            pout.print(soapRequest);
            pout.flush();
            int status = conn.getResponseCode();
            if (status >= 400) // we have an error (30x should be handled since we set followredirect)
            {
                conn.disconnect();
               
                    throw new CommunicationException("Error executing POST Request. Status: " + status + " error: " + conn.getResponseMessage());
            }
            String response = readServerResponse(conn.getInputStream(), true);
            return processResponse(response, soapRequest);
        }
        catch (MalformedURLException m)
        {
            throw new CommunicationException("Malformed url: " + this.webServicePath + "\r\nOriginal message: " + m.getMessage());
        }
        catch (IOException i)
        {
            throw new CommunicationException("IO problem: " + i.getMessage());
        }
    }
 
It's a CCM 6.1 BTW.. so no 7 in the url.

The port is missing from the request URL: 8443, though I doubt that is it.
 
Looking closer at your request, it looks like "urn:isClusterUserSoap" is added as a _SOAP_ header, not an _HTTP_ header (see my previous raw HTTP request.)  Trying your version just now I also get a HTTP 500 response - so I think that's the culprit.
 
 

Side note, I use soapUI a lot to test web services - that's where I got the raw HTTP request info.
 
Other developers use Fiddler (freeware Windows) or Charles (trialware java) to debug raw HTTPS traffic - these tools are setup as 'man in the middle' proxies, useful when using opaque clients like .NET.

It's not the port... the .NET stub works on 443.. but I tried anyway and as expected, no joy.
 
Also, HttpsURLConnection.setRequestProperty(String key, String value) sets HTTP headers as per the J2SE Javadoc: http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLConnection.html#setRequestProperty%28java.lang.String,%20java.lang.String%29
 
I'm using the same code for AXL and AXL Serviceability and they do work (for AXL it's the CUCMB ver=6.0 string, for Serviceability it's http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice string) . I recall having the 500 error on serviceability before putting the proper SOAPAction header.
 
Now.. I installed fiddler  (there's really no place in CCM to catch this? Seems like a very important debugging feature is missing) and managed to trace it down.. now that I see the response as well (I must be calling the wrong method.. the server actually tells what's wrong with the request) I managed to fix things.
 
Bottom line.. if I use the .net notation in java, it fails (something about the mustsupport being MS specific and requiring another element in the soapenv header). If I use my original copy&paste from the documentation, it works. But.. I must add a SOAPAction HTTP header. It does not seem to matter what I put in there though.. I managed to call getProfileSoap with urn:isClusterSoap, as well as with an empty SOAPHeader - that seems kinda weird.
 
Anyway.. I just wished that WSDLs would be tested against at least one framework for the major languages. I also work with other PBXes that offer Webservices.. and you can be sure that if you import their WSDL into either .NET or Java (they test against Axis and I believe their end uses Axis as well), it always works out of the box.
 
And might I suggest tha the SOAPAction thing be added to future documentation.. it's there for AXL & Servieability.. but anybody trying on their own (whether it is that their chosen toolkit doesn't import the WSDL or cannot deal with all the responses (e.g. .NET cannot handle the getProfileSoap response deserialization) will run into this trap.


Anyway.. I just wished that WSDLs would be tested against at least one framework for the major languages.

Totally agree. It would also be nice if some Cisco people kept an eye on these forums. So many questions are just left un-answered. Other companie "get" the fact that developers can help sell their products. Cisco don't :-(
 
GTG

Collateral


No files available