« Back to Technical Questions

Test page for XML API

Combination View Flat View Tree View
Threads [ Previous | Next ]
Using a CUCME with IOS 15.0(1)XA3a (actually a UC560 device), i can point a browser to http://<ip_address>/xml-test.html and get the XML api test page.
But when submitting any of the API methods from this page(ex: ISgetGlobal), the CME returns the http error 405 (method not allowed).
Any idea why this is happening?
the CME is configured according to the XML api configuration guide at: http://www.cisco.com/en/US/docs/voice_ip_comm/cucme/admin/configuration/guide/cmeapi.html
 
the content of the http query is:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/1999/XMLSchema">
 <SOAP-ENV:Body>
    <axl xsi:type="request"
         xmlns="http://www.cisco.com/AXL/1.0"
         xsi:schemaLocation="http://www.cisco.com/AXL/1.0
                 http://gkar.cisco.com/schema/axlsoap.xsd">
      <request xsi:type="ISgetGlobal">
        <ISgetGlobal></ISgetGlobal>
      </request>
    </axl>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
thanks,
-Sebastien

Hi,

This forum is for UCXSI, so I think most likely won't have XML API expert will come here to address this question.
By the way
The xml-test page was deprecated long time ago. It was just for testing.
User should use the CME XML interface directly.


Thanks !

I'm working with Sebastien on this issue and have attempted to use the
CME XML interface directly but am getting an error when I attempt to get
the response.
 
You mention that this forum is not the correct location to ask questions about this API. Could you suggest an alternative? Or maybe someone knows the answer?
 
I'm sending this:
<SOAP-ENV:Envelope>
    <SOAP-ENV:Body>
        <axl>
            <request xsi:type="ISgetGlobal"><ISgetGlobal></ISgetGlobal></request>
        </axl>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

to our CME server:
http://<IP Address of the CME>/ISApi/AXL/V1/soapisapi.is

and getting this error:
The underlying connection was closed: The connection was closed unexpectedly.
 
Any help would be appreciated.
 
Thanks,
Darcy

A small update...
 
I've tried another address for the CME API as well with a slightly different result.
 
Hitting the page at:
http://<CME SERVER ADDRESS>/ios_xml_app/cme
 
results in an empty reponse (actually, one space character).
 
Not really sure how to proceed as the documentation is fairly sparse. Anyone have any further information on the API?

Have you checked out the following document ?
 
http://www.cisco.com/en/US/docs/voice_ip_comm/cucme/admin/configuration/guide/cmeapi.html
 
Thank !
 
 

Thanks for the link!
 
As far as I know the server has been configured but I'll pass this on to the engineer and go from there.
 
By the way, I also found the Admininstration XML site which I believe is the more appropriate support forum for these questions so I'll be posting any follow up questions over there.
 
Thanks for your help Yaw-Ming.

Don't know what is your applicatio but just like to let you know that provisionign SDK in UCXSI is using AXL.
The Java APIs provided in the SDK are built to communicate with Cisco Unified CME via the existing XML interface
 
The following is an example of using XML "ISgetGlobal" method by using UCXSI
 
    response = cme_http.getGlobal();


        System.out.println("\n>>>>> Class : ISGlobal, including ISVoiceMail, ISUrlServices and ISUrlService<<<<\n ");
        System.out.println("CME Mode = " + response.getISGlobal().getISMode());
        System.out.println("CME Version = " + response.getISGlobal().getISVersion());
        System.out.println("quantity of current registered ephone = " + response.getISGlobal().getISDeviceRegistered());
        System.out.println("quantity of ever registered ephone = " + response.getISGlobal().getISPeakDeviceRegistered());
        System.out.println("ephone registered Time, hundredths of a second since system bootup = " + response.getISGlobal().getISPeakDeviceRegisteredTime());
        System.out.println("Keep Alive Interval in second = " + response.getISGlobal().getISKeepAliveInterval());
        System.out.println("quantity of configured ephone = " + response.getISGlobal().getISConfiguredDevice());
        System.out.println("quantity of configured extension = " + response.getISGlobal().getISConfiguredExtension());
        System.out.println("IP of the service engine (CUE) = " + response.getISGlobal().getISServiceEngine());
        System.out.println("CME router hostname = " + response.getISGlobal().getISName());
        System.out.println("Skinny Port Number = " + response.getISGlobal().getISPortNumber());
        System.out.println("max number of conference allowed = " + response.getISGlobal().getISMaxConference());
        System.out.println("max number of redirect allowed = " + response.getISGlobal().getISMaxRedirect());
        System.out.println("max number of ephone allowed = " + response.getISGlobal().getISMaxEphone());
        System.out.println("max number of ephone-dn allowed = " + response.getISGlobal().getISMaxDN());
        System.out.println("Voice Mail = " + response.getISGlobal().getISVoiceMail());        //ISVoiceMail   
        for (ISUrlService a: response.getISGlobal().getISUrlServices().getISUrlService()){  // ISUrlServices and ISUrlService
             System.out.println(
             "URL link = "+a.getISUrlLink()+"  "+
             "URL Type = "+a.getISUrlType());
        }

I'm actually using a C# application to send Web requests directly to the API url.
 
The following is my test code.

//////////////////////// code sample /////////////////////
// build the soap request
string soapRequest = BuildRequest(postData);

/***** POST DATA NOW LOOKS LIKE THIS
<SOAP-ENV:Envelope>
    <SOAP-ENV:Body>
        <axl>
            <request xsi:type="ISgetGlobal"><ISgetGlobal></ISgetGlobal></request>
        </axl>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
*****/

// convert the request into a byte array
UTF8Encoding encoding = new UTF8Encoding();
byte[] postBytes = encoding.GetBytes(soapRequest);

// grab the CME url and user credentials from configuration
string ciscoUrl = ConfigurationManager.AppSettings["CiscoExpressServerAddress"];
string ciscoUsername = ConfigurationManager.AppSettings["CiscoLogon"];
string ciscoPassword = ConfigurationManager.AppSettings["CiscoPassword"];

// create the request object
WebRequest request = WebRequest.Create(string.Format("http://{0}/ios_xml_app/cme", ciscoUrl));

// set the username and password that is valid for this CME server
request.Credentials = new NetworkCredential(ciscoUsername, ciscoPassword);

// setup the request
request.Method = "POST";
request.ContentLength = postData.Length;
request.ContentType = "text/xml";

// send the request to the CME server
Stream dataStream = request.GetRequestStream();
dataStream.Write(postBytes, 0, postBytes.Length);
dataStream.Close();

// get the response
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());

// convert the response into a string to send back to the caller
StringBuilder result = new StringBuilder();
string str = reader.ReadLine();
while (str != null)
{
    result.AppendLine(str);
    str = reader.ReadLine();
}

return result.ToString();

After I make the web request the following information is logged to the CME diagnostic log.
 
Does the error message make any sense to you?
 
043094: Oct  6 22:09:38.389: its_urlhook url: /ios_xml_app/cme, method 2

043095: Oct  6 22:09:38.389: Wed, 06 Oct 2010 22:09:38 GMT 139.126.176.158 /ios_xml_app/cme auth_required

    Protocol = HTTP/1.1 Method = POST

043096: Oct  6 22:09:38.389:     Content-Type = text/xml

    Content-Length = 69



043097: Oct  6 22:09:38.545: HTTP: Priv level granted 15

043098: Oct  6 22:09:38.549: CME got a raw XML message.

043099: Oct  6 22:09:38.549: doc 0x8B660FAC, doc->doc_type 4, req 0x8ADE7BF8

043100: Oct  6 22:09:38.549: Cannot extract bad formatted XML document

043101: Oct  6 22:09:41.549: its_urlhook url: /spa525G.cfg, method 1

043102: Oct  6 22:09:41.549: lds_urlhook, url=/spa525G.cfg

043103: Oct  6 22:09:41.621: its_urlhook url: /Cisco/SPA525G/68efbd28f5d2.cfg, method 1

043104: Oct  6 22:09:41.621: lds_urlhook, url=/Cisco/SPA525G/68efbd28f5d2.cfg
 

Ahhh...found the problem with the Bad Request. I made an error when setting the content length of the post so the request was failing.
 
I'm now able to query the CUCME Axl service and am getting data back.
 
Again, thanks for your help.
 
Darcy

Hi,
Is there anyone who tried XML APIwith .NET serialization ?

Hi Yusuf,

As this forum is for UCXSI, You can try to post on the following tech center to get an answer for your query related to XML API

http://developer.cisco.com/web/axl/home

Thanks,
Anusha

Hi Anusha,
I try to develop a CUCME interface, so i think requested link is not going to work for me.
Actually i try to migrate UCXSI to .NET C# and my problem is about xml responses from CUCME Axl service.
Response xml is not well formed to deserialize, i recieved the response;

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
<SOAP-ENV:Body>
<axl xmlns="cisco_cme_xml_namespace" >
<response >
<ISexecCLIResponse>1</ISexecCLIResponse>
<ISexecCLIError>Invalid CLI in XML message: ephone 4 exempt</ISexecCLIError>
</response>
</axl>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I am waiting for a response as ;
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >
<SOAP-ENV:Body>
<axl xmlns="cisco_cme_xml_namespace" >
<response >
<ISexecCLIRersult>
<ISexecCLIResponse>1</ISexecCLIResponse>
<ISexecCLIError>Invalid CLI in XML message: ephone 4 exempt</ISexecCLIError>
</ISexecCLIRersult>
</response>
</axl>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Thanks,
Yusuf