cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2214
Views
0
Helpful
11
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Wes Schochet on 08-04-2010 06:19:01 PM
Hi All-
 
I am having an issue trying to associate a phone to an application user.  Everything looks as if it succeded, but the user's associations are not updated.  I send:
 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<SOAP-ENV:Body>   
  <axl:updateAppUser xmlns:axl="http://www.cisco.com/AXL/API/1.0" sequence="12055">        
    <userid>appusr</userid>        
    <password>xxx</password>        
    <associatedDevices>
      <device>SEP001BD458B404</device>
      <device>SEP00233341D33B</device>        
    </associatedDevices>   
  </axl:updateAppUser >
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
and get back:
 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
  <axl:updateAppUserResponse xmlns:axl="http://www.cisco.com/AXL/API/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sequence="12055">
    <return>true</return>
  </axl:updateAppUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
the AXL log file shows ths:
 
2010-04-08 13:10:46,727 INFO  [http-8443-Processor24] axl6_0.Handler - Handler initializing
2010-04-08 13:10:46,781 INFO  [http-8443-Processor24] axl.AXLRouter - <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><SOAP-ENV:Body><axl:updateAppUserResponse xmlns:axl="http://www.cisco.com/AXL/API/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sequence="12055"><return>true</return></axl:updateAppUserResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
2010-04-08 13:10:46,782 INFO  [http-8443-Processor24] axl.AXLRouter - Request 1258428714443 was process in 123ms

 
but the phone is not associated with the user.   Has anyone been able to do this or  have any ideas?
 
Thanks,
 
Wes

Subject: RE: Associate a phone device to application user
Replied by: David Staudt on 08-04-2010 06:47:05 PM
For historical reasons, the AXL updateAppUser request for versions 5.x through 6.x accepted only four fields for update: userid, password, digestCredetials, passwordCredentials.  If additional app user configurations needed to made, they had to be done via executeSQLUpdate.
 
UCM  7.x brought updateAppUser up to par with updateUser - accepting all other fields, including the associated devices list.
 
Note however, UCM checks the 'SOAPAction' HTTP on each request to determine which AXL version is being targeted.  Even if your UCM is version 7.x or higher, if the app provides no SOAPAction header, for backward compatibility reasons AXL then  defaults to using the 6.0(1) AXL schema - which, remember, accepts only a few fields for update, ignoring the rest.  (See the XML Developer Guide for details on how AXL versioning is implemented.)
 
If you are using UCM 7/8, ensure you are sending the correct SOAPAction header:
 
...
Host:10.77.31.194:8443
Authorization: Basic Q0NNQWRtaW5pc3RyYXRvcjpjaXNjb19jaXNjbw==
Accept: text/*
Content-type: text/xml
SOAPAction: "CUCMB ver=7.0"
Content-length: 427
...

Subject: RE: Associate a phone device to application user
Replied by: Wes Schochet on 08-04-2010 08:28:21 PM
 OK - I did get the sql update to work.  It seems you can just pop the keys into the applicationuserdevicemap table.  I alway get a little nervous doing these types of things - I'd hate to inject a bad record.
 
Comments

Any chance you could share that sqlUpdate you used?

Chidananda S
Level 1
Level 1

Any progress on this? I can use 'updateAppUser' to add device to the AppUser's Controlled Device list but it erases all other devices except the one added just now. any help is much appreciated

dstaudt
Cisco Employee
Cisco Employee

<updateAppUser><associatedDevices> replaces the current set of devices with whatever you pass in.

If you want to just add a new device, you would first retrieve the current set of associated devices via <getAppUser>, modify the <associatedDevices> list to add your new device, then submit that updated list via <updateAppUser>.

Chidananda S
Level 1
Level 1

buddy, thanks for the reply. yes I read the same on another post. I am able to use the approach if I am doing it manually and it works perfectly. how to do it if we have to use automation using Python+SoapUI? Refering to documentations and other blogs I have reached the point where I can do POST Request to make changes on the CUCM but finding no help on how to use GET the data.  I am keeping my baby steps into all these things. any guidance is much appreciated

dstaudt
Cisco Employee
Cisco Employee

This set of samples may be helpful for that: https://github.dev/CiscoDevNet/axl-python-zeep-samples

There isn't a sample covering your specific scenario, but this one does show using a <getXXX> request and then parsing out data from it: https://github.dev/CiscoDevNet/axl-python-zeep-samples/blob/master/axl_add_update_User.py

Chidananda S
Level 1
Level 1

Thanks sir for guiding into correct direction. I am trying to explore Zeep now. This seems to be very different than what i have been doing all these while. All these while i was using regular SOAP request using the AXL provided in the WSDL file. at first glance, i didn't see specific 'GET request' rather I see 'append' option is being used here. I will continue to explore.

Chidananda S
Level 1
Level 1

hmm, one more hurdle i am getting below error when i am trying to manually add more then one device name

 
def UpdateAppAuser():
    # this works fine, but adds only one device at once.
    # Create an associated devices object
    devices = {
            'device': []
        }
    devices['device'].append("TESTPhone1", "TESTPhone2")
 
    try:
        resp = service.updateAppUser(
            userid = 'TEST_AppUser,
            associatedDevices = devices
            )

TypeError: list.append() takes exactly one argument (2 given)

 

By the error i got it looks like it doesn't allow more then one device to be added using ".append " function. 

dstaudt
Cisco Employee
Cisco Employee

Correct list.append() accepts a single item: https://docs.python.org/3/tutorial/datastructures.html

You should be able to use list.extend() with a list, e.g.:

devices['device'].extend(["TESTPhone1", "TESTPhone2"])

or just add the items one at a time in a loop:

for newDevice in ["TESTPhone1", "TESTPhone2"]:

    devices['device'].append(newDevice)

 

Chidananda S
Level 1
Level 1

Thanks a lot @dstaudt your guidance defiantly gave me the confidence and assurance that this is possible!!

however as i was not much comfortable using Zeep i used regular post requests and achieved what i was planning to implement. i had to make few tweaks on the script and added few loops to complete it.

i think i need some more help how can we make similar changes on PCCE and UCCE environment? Is there a WSDL file available for these?

dstaudt
Cisco Employee
Cisco Employee

Good to hear your progress
For contact center questions, I would suggest posting here to get the best visibility for experts in that area (I'm not a big CC guy...): https://community.cisco.com/t5/contact-center/bd-p/j-disc-dev-contact-center

Chidananda S
Level 1
Level 1

thanks again buddy, i just posted the query there, hoping to move on with PCCE/UCCE automation things

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links