Doing a rest POST call to the AXL server

Version 1
    This document was generated from CDN thread

    Created by: Nicholas Ocket on 04-09-2013 09:45:02 AM
    Hey everybody, 

    I have built a webapplication using JTapi which intercepts incoming calls. The entire point of this all would be that directly after interception, I would fetch additional information using AXL as a means to get this caller information. I would like to do this by using a POST htpp request to the AXL server. But i run into some trouble. 

    First, the request 'getUser' is no problem. This works just fine, even when doing the rest call programmatically. But the 'getPhone' request doesn't work at all using the rest client. However, when i recreate the situation using SOAPUI, it works fine after some finetuning of the request. But using the same xml request programmatically doesn't work. 

    So, here is the SOAPUI setup: 
    I need to use preemptive authorisation type. 
    In the header, i have to put the following property  (I dont have to do this for getUser though...):
    SOAPAction="CUCM: DB ver=8.5 (Do mind: between CUCM: and DB there is no space, but if i put in here without a space, i get a smiley).

    this is the xml request i send:

    1<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header SOAPAction="CUCM:DB ver=8.5"/><SOAP-ENV:Body><getPhone xmlns="http://www.cisco.com/AXL/API/8.5"><name>SEP002155D6E877</name></getPhone></SOAP-ENV:Body></SOAP-ENV:Envelope>
    this is the response i get: 
    1<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>schema_reference.4: Failed to read schema document '/usr/local/thirdparty/jakarta-tomcat/webapps/axl/schema/6.1/SoapEnvelope.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;.</faultstring><detail><axl:Error xmlns:axl="http://www.cisco.com/AXL/API/1.0"><axl:code>5001</axl:code><axl:message>schema_reference.4: Failed to read schema document '/usr/local/thirdparty/jakarta-tomcat/webapps/axl/schema/6.1/SoapEnvelope.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;.</axl:message><request>getPhone</request></axl:Error></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    Can somebody point me in the right direction here please? 

    Subject: RE: Doing a rest POST call to the AXL server
    Replied by: David Staudt on 04-09-2013 10:43:10 AM
    In your XML request I'm not sure where '<SOAP-ENV:Header SOAPAction="CUCMB ver=8.5"/>' is coming from.  Note the 'SOAPAction' value needs to a HTTP header, not part of the SOAP envelope header.  If you can make the request successfully in soapUI, take a look at the 'Raw' request, which will show all the HTTP headers and XML that need to be sent.

    Subject: RE: Doing a rest POST call to the AXL server
    Replied by: Nicholas Ocket on 05-09-2013 02:26:55 AM
    Hello David, 

    You have no idea how stupid I feel right now. I have looked at the build-up of my request about 100 times and it never hit me that I was putting the 'SOAPAction' in the wrong header. 

    Anyway, thanks a lot for hte fast reply. This really helped me out.

    I have one remark though: The request 'getUser' does work with httpheader entry: 
    while 'getPhone' doesn't. Is it supposed to act like this? 

    Kind regards