Seeing Invalid URI in AXL response

Version 1
    This document was generated from CDN thread

    Created by: Pala Sudh on 19-02-2009 03:12:11 PM
    I am writing a Java Program to reterive the list of phones configured in CCM 6.
    Following is the request i am framing in the Java Code
    sAXLSOAPRequest = "POST :8443/axl/ HTTP/1.0\r\n";
    sAXLSOAPRequest += "Host:10.10.13.70:8443\r\n";
    sAXLSOAPRequest += "Authorization: Basic " + authorization + "=="+"\r\n";
    sAXLSOAPRequest += "Accept: text/*\r\n";
    sAXLSOAPRequest += "Content-type: text/xml\r\n";
    sAXLSOAPRequest += "SOAPAction: \"CUCMB ver=6.0\"\r\n";
    sAXLSOAPRequest += "Content-length: ";
    sAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"[url=javascript:newWin('http://schemas.xmlsoap.org/soap/envelope/')]http://schemas.xmlsoap.org/soap/envelope/\" ";
    sAXLRequest += "xmlns:xsi=\"[url=javascript:newWin('http://www.w3.org/2001/XMLSchema-instance')]http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"[url=javascript:newWin('http://www.w3.org/2001/XMLSchema')]http://www.w3.org/2001/XMLSchema\"> ";
    sAXLRequest +="<SOAP-ENV:Body> <axl:listPhoneByName xmlns:axl=\"[url=javascript:newWin('http://www.cisco.com/AXL/API/6.0')]http://www.cisco.com/AXL/API/6.0\" " +
    " xsi:schemaLocation=\"[url=javascript:newWin('http://www.cisco.com/AXL/API/6.0')]http://www.cisco.com/AXL/API/6.0 [url=javascript:newWin('http://ccmserver/schema/axlsoap.xsd')]http://ccmserver/schema/axlsoap.xsd\" " +
    "sequence=\"1234\"> <searchString>%</searchString> " +
    "</axl:listPhoneByName> </SOAP-ENV:Body> </SOAP-ENV:Envelope>";

    Would you please let me know whether the request i am framing is correct
     

    Subject: RE: Seeing Invalid URI in AXL response
    Replied by: David Staudt on 19-02-2009 05:46:52 PM
    Are you getting an error message?  What is returned?  What do you see in the AXL service logs?
     
    The request looks right, with a few quirks in the header area.  Follows is a working request on my CM7 system, generated using the SoapUI tool.  I can see your request is missing the content-length's value, and maybe a blank line between header and content:
     
    POST https://10.88.131.133:8443/axl/ HTTP/1.1
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "CUCMB ver=7.0 listPhoneByName"
    User-Agent: Jakarta Commons-HttpClient/3.1
    Content-Length: 309
    Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjbyExMjM=
    Host: 10.88.131.133:8443
     
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/7.0">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:listPhoneByName sequence="1234">
             <searchString>%</searchString>
          </ns:listPhoneByName>
       </soapenv:Body>
    </soapenv:Envelope>

    Subject: RE: Seeing Invalid URI in AXL response
    Replied by: Pala Sudh on 19-02-2009 06:22:00 PM
    When i put traces for request and response message it is showing as follows
    Request Message Being sent
     
    POST :8443/axl/ HTTP/1.1
    Host:10.10.13.70:8443
    Authorization: Basic YWRtaW46dmVyaW50Nzgx
    Accept: text/*
    Content-type: text/xml
    SOAPAction: "CUCMB ver=6.0"
    Content-length: 459
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <axl:listPhoneByName xmlns:axl="http://www.cisco.com/AXL/API/6.0"  xsi:schemaLocation="http://www.cisco.com/AXL/API/6.0 http://ccmserver/schema/axlsoap.xsd" sequence="1234"> <searchString>%</searchString> </axl:listPhoneByName> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
     Response from
    CCMHTTP/1.1 400 Invalid URI
    Server: Apache-Coyote/1.1
    Content-Length: 0
    Date: Thu, 19 Feb 2009 18:20:06 GMT
    Connection: close
     
    Even i tried with Empty SOAP body, still i am seeing invalid URI

    Subject: RE: Seeing Invalid URI in AXL response
    Replied by: David Staudt on 19-02-2009 07:56:57 PM
    Can you confirm the AXL service is running in UCM Serviceability?
     
    Next step would be to look in to the AXL service logs via the RTMT tool.  You can attach here if you see something you don't understand.

    Subject: RE: Seeing Invalid URI in AXL response
    Replied by: Pala Sudh on 20-02-2009 11:07:21 AM
    I had confirmed that AXL service is running by [url=https://<myCCMServer>:8443/AXL]https://<myCCMServer>:8443/AXL
     
    <h1>Cisco CallManager: AXL Web Service</h1>
    The AXL Web Service is working and accepting requests. Use HTTP POST to send a request.
     
    I have enabled the AXL service and CISCO SOAP service in CCM.
     
    Please let me know how to proceed further

    Subject: RE: Seeing Invalid URI in AXL response
    Replied by: David Staudt on 20-02-2009 04:24:38 PM
    I think the problem is with the POST header, it appears to be very picky.  This worked on my CM7 system:
     
    POST /axl/ HTTP/1.1
    Host:10.88.131.133:8443
    Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjbyExMjM=
    Accept: text/*
    Content-type: text/xml
    Content-length: 453

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><axl:listPhoneByName xmlns:axl="http://www.cisco.com/AXL/API/6.0"  xsi:schemaLocation="http://www.cisco.com/AXL/API/6.0 http://ccmserver/schema/axlsoap.xsd" sequence="1234"><searchString>%</searchString></axl:listPhoneByName></SOAP-ENV:Body></SOAP-ENV:Envelope>