cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
676
Views
0
Helpful
1
Replies

302 from AXL API server

I am trying to use the CUCM AXL API on 10.5.2. My end goal is to be able to make a query from a CCX script, but I am trying to debug the intermediate stuff before I go any further on that. The problem is when I post my query to AXL, it gives me back a 302. CURL has some options to resubmit the query which work and give me the expected output. What I am trying to determine is if there is something else I should send to AXL, or if I can POST it another way so I don't have to send it twice. Here is a transcript of what I get from CURL (sans passwords).

E:\tmp\curl_745_0_ssl>curl -k -v -u ccmadmin:PhonyPassword -H "Content-type: text/xml;" -H "SOAPAction:CUCM:DB ver=10.5" -L --post302 -d @xmldata.txt https://fon-ccx-cm01/axl
*   Trying 10.236.12.23...
* Connected to fon-ccx-cm01 (10.236.12.23) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES256-SHA
* Server certificate:
*        subject: C=US; O=Orlando Health; OU=Information Services; CN=fon-ccx-cm
01.orhs.org; ST=Florida; L=Orlando
*        start date: Feb  5 21:13:34 2015 GMT
*        expire date: Feb  4 21:13:33 2020 GMT
*        issuer: C=US; O=Orlando Health; OU=Information Services; CN=fon-ccx-cm0
1.orhs.org; ST=Florida; L=Orlando
*        SSL certificate verify result: self signed certificate (18), continuing
 anyway.
* Server auth using Basic with user 'ccmadmin'
> POST /axl HTTP/1.1
> Host: fon-ccx-cm01
> Authorization: Basic BasicAUthString
> User-Agent: curl/7.45.0
> Accept: */*
> Content-type: text/xml;
> SOAPAction:CUCM:DB ver=10.5
> Content-Length: 349
>
* upload completely sent off: 349 out of 349 bytes
< HTTP/1.1 302 Found
< Location: https://fon-ccx-cm01/axl/
< Transfer-Encoding: chunked
< Date: Fri, 20 Nov 2015 19:39:03 GMT
< Server:
<
* Ignoring the response-body
* Connection #0 to host fon-ccx-cm01 left intact
* Issue another request to this URL: 'https://fon-ccx-cm01/axl/'
* Found bundle for host fon-ccx-cm01: 0x1601ef8
* Re-using existing connection! (#0) with host fon-ccx-cm01
* Connected to fon-ccx-cm01 (10.236.12.23) port 443 (#0)
* Server auth using Basic with user 'ccmadmin'
> POST /axl/ HTTP/1.1
> Host: fon-ccx-cm01
> Authorization: Basic BasicAUthString
> User-Agent: curl/7.45.0
> Accept: */*
> Content-type: text/xml;
> SOAPAction:CUCM:DB ver=10.5
> Content-Length: 349
>
* upload completely sent off: 349 out of 349 bytes
< HTTP/1.1 200 OK
< Set-Cookie: JSESSIONIDSSO=375ECA70451F3BE6E811650148E02B40; Path=/; Secure; Ht
tpOnly
< Set-Cookie: JSESSIONID=EA9FEEB8B1EDF9113F0F65431906768C; Path=/axl/; Secure; H
ttpOnly
< X-Frame-Options: SAMEORIGIN
< Content-Type: text/xml;charset=UTF-8
< Content-Length: 418
< Date: Fri, 20 Nov 2015 19:39:03 GMT
< Server:
<
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://sc
hemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:executeSQLQueryResponse xmln
s:ns="http://www.cisco.com/AXL/API/10.5"><return><row><pkid>3f51b73a-b921-8af0-1
863-1b57834c85db</pkid><name>EBD</name><authorizationlevel>40</authorizationleve
l><code>27313</code></row></return></ns:executeSQLQueryResponse></soapenv:Body><
/soapenv:Envelope>* Connection #0 to host fon-ccx-cm01 left intact

1 Reply 1

Ahmed Shaier
Level 1
Level 1

Hello Elliot,

i know it is very late for answering after 6 years but I had the same issue recently and I spend a lot of time trying to fix it and i came through your post and i found no one replied so i think it is better to document the solution if someone else has encountered the same issue

the issue is that your are missing / in the end of the url

 

if you look in the url you typed in curl

https://fon-ccx-cm01/axl

and the url the server returned in 302 location header

Location: https://fon-ccx-cm01/axl/

you will see that the cucm is redirecting you to the url with / in the end 

 

so bottom line the url should be https://cucm-ip-or-FQDN:8443/axl/ with / in the end

 

hope this is helpful