CUCM 6.13 - How to build SOAP Message for executeSQLQuery

Version 1
    This document was generated from CDN thread

    Created by: Keith Lunn on 28-06-2009 03:05:15 PM
    Folks,
    We are using CUICM 6.13 and the closest devleoper guide I can find is 6.01. It shows a SOAP message example for executeSQLQuery in C.(pg 1-14). There is also an example for "getphone" in Java (pg 1-17). I have noticed the SOAP message is being built differently in each example, (understanding that one is executeSQLQuery" and the other is "getphone".
    Now on pg 1-19 they have a paragraph "Using executeSQLQuery" and that has again a different way of building the SOAP message - so I am very confused on which method to follow....
    Differences noted:
    axl sequence number placed in different locations
    xmlns info in different parts of soap message: envelope vs body
    m:executeSQLQuery vs axlapi:executeSQLQuery
    Examples:
    C Example pg1-14:
    strAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=";
    strAXLRequest += "\"http://schemas.xmlsoap.org/soap/envelope/\"";
    strAXLRequest += " xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"";
    strAXLRequest += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
    strAXLRequest += " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> ";
    strAXLRequest += "<SOAP-ENV:Body> ";
    strAXLRequest += "<m:executeSQLQuery xmlns:m=\"http://www.cisco.com/AXL/API/1.0\"
    sequence=\"" + seqNum + "\"> ";
    strAXLRequest += "<m:sql> ";
    strAXLRequest += "SELECT * FROM Device ";
    strAXLRequest += "</m:sql> ";
    strAXLRequest += "</m:executeSQLQuery> ";
    strAXLRequest += "</SOAP-ENV:Body> ";
    strAXLRequest += "</SOAP-ENV:Envelope>";
     
    ======================
    Java example pg 1-17:
     
    // Build the SOAP payload
    sAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" ";
    sAXLRequest += "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> ";
    sAXLRequest += "<SOAP-ENV:Body> <axl:getPhone xmlns:axl=\"http://www.cisco.com/AXL/1.0\" ";
    sAXLRequest += " xsi:schemaLocation=\"http://www.cisco.com/AXL/1.0 http://
    ccmserver/schema/axlsoap.xsd\" ";
    sAXLRequest += "sequence=\"1234\"> SEP000000000009";
    sAXLRequest += "</axl:getPhone> </SOAP-ENV:Body> </SOAP-ENV:Envelope>";
    ==================================
    Using executeSQLQuery - pg 1-19:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
    <axlapi:executeSQLQuery sequence="1"
    xmlns:axlapi="http://www.cisco.com/AXL/API/1.0"
    xmlns:axl="http://www.cisco.com/AXL/API/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.cisco.com/AXL/API/1.0 axlsoap.xsd">
    <sql>SELECT * from numplan</sql>
    </axlapi:executeSQLQuery>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    =============

    Subject: RE: CUCM 6.13 - How to build SOAP Message for executeSQLQuery
    Replied by: Keith Lunn on 06-07-2009 06:44:25 PM
    According to TAC:
    The dopcumentation does have descrepancies on building the SOAP Message and the recommended format is:
    This is a discrepancy in the request headers in the tool kit sample client. This does not affect the AXL response. We have plans to provide new sample client codes for different platforms (.NET, AXIS, perl) in 8.0.
     
    Also, the sequence attribute should come in the Body. BY the way, I will be raising a defect for changing the documentation in versions prior to 8.0.
     
    This is a sample request generated by a tool called SOAP UI which can be downloaded for free. This generates AXL requests from the WSDL and schema. This will generate the requests with appropriate namespaces defined in the schema itself. As a proper coding guideline, you can follow this request format.
     
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/7.1">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:executeSQLQuery sequence="?">
             <sql>select * from timeschedule</sql>
          </ns:executeSQLQuery>
       </soapenv:Body>
    </soapenv:Envelope>
     

    Subject: RE: CUCM 6.13 - How to build SOAP Message for executeSQLQuery
    Replied by: Keith Lunn on 07-07-2009 05:10:35 PM
    THe SOAP format that TAC gave me did not work - gave axl soap error, i corrected and informed TAC what the correction is.
    Here's the standrad using cucm 6.13:
     
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="http://www.cisco.com/AXL/API/6.1">
     <SOAP-ENV:Header/>
     <SOAP-ENV:Body>
     <ns:executeSQLQuery sequence="600">
      <sql>
      SELECT numplan.dnorpattern, r
    outepartition.name, callforwarddynamic.cfavoicemailenabled, callforwarddynamic.c
    fadestination FROM numplan,routepartition,callforwarddynamic WHERE routepartitio
    n.pkid = numplan.fkroutepartition AND callforwarddynamic.fknumplan = numplan.pki
    d and routepartition.name like 'CL_DNPT%' AND (callforwarddynamic.cfavoicemailen
    abled = 't' OR callforwarddynamic.cfadestination != '');
    </sql>
    </ns:executeSQLQuery>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    They have also opened a BUG ID to get their documentation descrepacies in the Developers Guide update too:
    TAC:
    I have raised a bug for correcting the documentation, highlighting all the discrepancies pointed by you, the defect Id is: CSCta56315