cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
805
Views
0
Helpful
6
Replies

doLdapSync is giving 5003 error

rajeran2
Level 1
Level 1

Hi,

We are tying to perform LDAP sync using Python. Except for doLdapSync all other axl calls are happening.

Please help me get out of this dead lock.

Request: (credentials removed)

AXL_LDAPSYNC = """<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5">

   <soapenv:Header/>

   <soapenv:Body>

      <ns:doLdapSync sequence="12345">

         <name>OpenDJ_BLR_SDP (10.104.194.159)</name>

         <sync>true</sync>

      </ns:doLdapSync>

   </soapenv:Body>

</soapenv:Envelope>"""

data = AXL_LDAPSYNC

import urllib,urllib2

import base64,requests

base64string = base64.encodestring('%s:%s' % ('*****', '****')).replace('\n', '')

request = urllib2.Request("https://10.104.194.237:8443/axl/doLdapSync", data=data, headers={'Content-Type': 'text/xml','Authorization': "Basic %s" % base64string})

result = urllib2.urlopen(request)

print result.geturl()

print result.read()

Response:

<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>No method found for processing request</faultstring><detail><axl:Error xmlns:axl="http://www.cisco.com/AXL/API/1.0"><axl:code>5003</axl:code><axl:message>No method found for processing request</axl:message><request>doLdapSync</request></axl:Error></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Note : The same request is working if I post it using SOAPUI.

Thanks and Regards,

Rajeev

6 Replies 6

npetrele
Cisco Employee
Cisco Employee

Is "OpenDJ_BLR_SDP (10.104.194.159)" really the correct name for your LDAP?  The IP address in parens is part of the name?

I'm wondering if Python is tripping up on that name.  Obviously the problem is somewhere with Python, since SoapUI is handling the same request properly. 

Yes, Nicholas, "OpenDJ_BLR_SDP (10.104.194.159)" is the correct 'LDAP Configuration Name'.

1.  I have tried the same request for another CUCM with a LDAP name which is without any space but that too gives the same result.

2. Python should not be problem as other AXL request with the same code are working fine. Also while debugging I observed what xml is it sending, which was exactly same as expected.

If the same action with SoapUI works, that pretty much eliminates CUCM/AXL as the problem, leaving only Python or the python libraries as the potential problem.  I encountered a similar problem with Python in the past, and updating to a beta version of the library fixed it (I think it was requests, if I recall correctly, but I could be mistaken).  I've also experienced problems with how Python libraries interpret the WSDL. 

Since you can preview the XML, can you post an example of what XML the Python program is sending?  Also, it might be useful if you can watch the actual transactions using Wireshark or Fiddler.

Thanks

Have you made any progress on this?  Can you post the XML?  I'd like to find out where things go wrong.  It would help other Python developers. 

I can't reproduce the problem at my lab.  It works for me.  I did have to change one thing, though.  I removed the doLdapSync from the URL in this line:

request = urllib2.Request("https://ds-ucm105.cisco.com:8443/axl/", data=data, headers={'Content-Type': 'text/xml','Authorization': "Basic %s" % base64string})

Hi Nicholas,

I have posted the exact (non-parametrized) code with the question, similar code works for other requests. I did also tried many other ways using different libraries but without any success.

Due to my time lines and unable to move ahead I had to use some old java code as a service, written by some other team which had worked earlier. This java code worked.

Later while I was analyzing, only difference I could identify between Java and Python code was; Java was using the axl WSDL. From Python I was making direct soap calls. Probably some APIs like 'doLdapSync' does not work without WSDL reference.

Thanks

Hi Rajeev,

I don't think it's a WSDL reference.  Like I said above, the Python worked fine for me.  I used your exact code (with my username/password and server).  All I had to do to make it work was remove the doLdapSync from the URL.  But I didn't get a 5003 error, I got a 404 error. 

I just noticed, however, that you're using AXL 8.5.  Perhaps that's the difference.  We have an 8.6.2 server we can use for testing.  Is that the version of CUCM you have?