10-29-2020 08:05 AM
public AXLAPI11::UpdateUserReq UpdateUserReq11(string userId,string[] associatedDevices)
{
AXLAPI11::UpdateUserReq updateUserReq = new AXLAPI11::UpdateUserReq()
{
ItemElementName = AXLAPI11::ItemChoiceType6.userid,
Item = userId,
associatedDevices = associatedDevices,
};
return updateUserReq;
}
I'm using this simple script to associate a device to a phone, but when do the call to cucm to update the user
i receive an error.
ERROR [http-bio-443-exec-9] axlapiservice.AXLAPIServiceSkeleton - com.cisco.www.axlapiservice.AXLAPIServiceSkeleton@9f68e1
java.lang.NullPointerException
The updaterequest need all fields filled with old/new values or i can update a single parameter?
Thx you
Solved! Go to Solution.
10-30-2020 12:43 PM
This seems to be an issue previously identified in https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvu98594
The workaround is what you found below, i.e. either ommit the problematic xsi:nil tags, or provide them as empty.
10-29-2020 04:43 PM
All the elements (besides the ID) should be optional - just provide what should be updated.
Can you get output of the actual HTTP request/XML object that gets sent to AXL? If you have a small working sample of the code that might be helpful...
I usually test requests out first using SoapUI before implementing in code - if you can get it working there, it may help understanding what your WSDL autogen code is doing.
10-30-2020 04:13 AM - edited 10-30-2020 04:13 AM
Thx you dstaudt,
i did a sniffing to retrieve the soap request originated by code sended to CUCM and this is the result:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <updateUser xmlns="http://www.cisco.com/AXL/API/11.5"> <userid xmlns="">3129</userid> <userLocale xsi:nil="true" xmlns="" /> <associatedDevices xmlns=""> <device>SEP000000003129</device> </associatedDevices> <associatedGroups xmlns=""> <userGroup> <name>Standard CCM End Users</name> <userRoles> <userRole>Standard CCM End Users</userRole> <userRole>Standard CCMUSER Administration</userRole> </userRoles> </userGroup> </associatedGroups> <digestCredentials xsi:nil="true" xmlns="" /> <subscribeCallingSearchSpaceName xsi:nil="true" xmlns="" /> <mlppPassword xsi:nil="true" xmlns="" /> <serviceProfile xsi:nil="true" xmlns="" /> <directoryUri xsi:nil="true" xmlns="" /> <selfService xsi:nil="true" xmlns="" /> <userProfile xsi:nil="true" xmlns="" /> <ldapDirectoryName xsi:nil="true" xmlns="" /> <ipccExtension xsi:nil="true" xmlns="" /> <convertUserAccount xsi:nil="true" xmlns="" /> </updateUser> </soap:Body> </soap:Envelope>
Below the server response:
<?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server</faultcode> <faultstring></faultstring> <detail> <axlError> <axlcode>-1</axlcode> <axlmessage></axlmessage> <request>updateUser</request> </axlError> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>
And the c# Code is very simple:
AXLAPI11::UpdateUserReq updateUserReq11 = new UpdateUserRequest().UpdateUserReq11(user.userid); string[] assUserArr = new string[getUserRes9.@return.user.associatedDevices.Length]; int counter = 0; foreach (string userass in getUserRes9.@return.user.associatedDevices) { assUserArr[counter] = userass; counter++; } foreach (AXLAPI9::RUserUserGroup Ru in getUserRes9.@return.user.associatedGroups) { AXLAPI11::UpdateUserReqUserGroup Xu = new AXLAPI11::UpdateUserReqUserGroup() { name = Ru.name, userRoles = Ru.userRoles }; XuArr[counter] = Xu; counter++; } updateUserReq11.associatedGroups = XuArr; updateUserReq11.associatedDevices = assUserArr; AXLAPI11::StandardResponse standardResponse = AXL11_5.updateUser(updateUserReq11);
10-30-2020 12:43 PM
This seems to be an issue previously identified in https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvu98594
The workaround is what you found below, i.e. either ommit the problematic xsi:nil tags, or provide them as empty.
10-30-2020 06:41 PM
You're right .. I was tired from a tough day of work... when i read your reply i suppose to have did something wrong... and yes! do you know what i did? I was looking for user change in the old CUCM... WTF... and the code below did his work..
Ps sorry for my english
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <updateUser xmlns="http://www.cisco.com/AXL/API/11.5"> <userid xmlns="">3130</userid> <userLocale xsi:nil="true" xmlns="" /> <associatedDevices xmlns=""> <device>SEP000000003130</device> </associatedDevices> <associatedGroups xmlns=""> <userGroup> <name>Standard CCM End Users</name> <userRoles> <userRole>Standard CCM End Users</userRole> <userRole>Standard CCMUSER Administration</userRole> </userRoles> </userGroup> </associatedGroups> <digestCredentials xmlns="" /> <subscribeCallingSearchSpaceName uuid="" xmlns="" /> <mlppPassword xmlns="" /> <serviceProfile uuid="" xmlns="" /> <directoryUri xmlns="" /> <selfService xmlns="" /> <userProfile uuid="" xmlns="" /> <ldapDirectoryName uuid="" xmlns="" /> <ipccExtension uuid="" xmlns="" /> <convertUserAccount uuid="" xmlns="" /> </updateUser> </soap:Body> </soap:Envelope>
10-30-2020 09:14 AM
UPDATE 1
If i set value to empty and not null as the xml below the soap request gone fine..BUT ! ...because there is always a BUT!
It didn't do anything... the device is not associated with the end user
REQUEST <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <updateUser xmlns="http://www.cisco.com/AXL/API/11.5"> <userid xmlns="">3130</userid> <userLocale xsi:nil="true" xmlns="" /> <associatedDevices xmlns=""> <device>SEP000000003130</device> </associatedDevices> <associatedGroups xmlns=""> <userGroup> <name>Standard CCM End Users</name> <userRoles> <userRole>Standard CCM End Users</userRole> <userRole>Standard CCMUSER Administration</userRole> </userRoles> </userGroup> </associatedGroups> <digestCredentials xmlns="" /> <subscribeCallingSearchSpaceName uuid="" xmlns="" /> <mlppPassword xmlns="" /> <serviceProfile uuid="" xmlns="" /> <directoryUri xmlns="" /> <selfService xmlns="" /> <userProfile uuid="" xmlns="" /> <ldapDirectoryName uuid="" xmlns="" /> <ipccExtension uuid="" xmlns="" /> <convertUserAccount uuid="" xmlns="" /> </updateUser> </soap:Body> </soap:Envelope>
REPLY <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:updateUserResponse xmlns:ns="http://www.cisco.com/AXL/API/11.5"> <return>{1C3434DA-548C-7D0E-55E3-7B41FE6A8C9D}</return> </ns:updateUserResponse> </soapenv:Body> </soapenv:Envelope>
And the AXL Log from CUCM
2020-10-30 17:13:07,531 INFO [http-bio-443-exec-13] filters.TimingFilter - Request 1603992155205 received from ******* at ip ******* was processed in 100ms
Stay Tuned
10-30-2020 01:02 PM
Hmm...in testing around with this, at first it seemed I was able to reproduce your issue here, but after awhile it seemed to start working...not sure if I was originally doing something unexpected/wrong, if something in AXL/CUCM unexpectedly changed, or..?
This is the request that is now working (<associatedDevices> was originally empty for this user):
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <updateUser xmlns="http://www.cisco.com/AXL/API/11.5"> <userid xmlns="">dstaudt2</userid> <userLocale xsi:nil="true" xmlns="" /> <associatedDevices xmlns=""> <device>BOTDSTAUDT2</device> <device>CTIPDSTAUDT</device> <device>CSFdstaudt2</device> </associatedDevices> <associatedGroups xmlns=""> <userGroup> <name>Standard CCM End Users</name> <userRoles> <userRole>Standard CCM End Users</userRole> <userRole>Standard CCMUSER Administration</userRole> </userRoles> </userGroup> </associatedGroups> <digestCredentials xmlns="" /> <subscribeCallingSearchSpaceName uuid="" xmlns="" /> <mlppPassword xmlns="" /> <serviceProfile uuid="" xmlns="" /> <directoryUri xmlns="" /> <selfService xmlns="" /> <userProfile uuid="" xmlns="" /> <ldapDirectoryName uuid="" xmlns="" /> <ipccExtension uuid="" xmlns="" /> <convertUserAccount uuid="" xmlns="" /> </updateUser> </soap:Body> </soap:Envelope>
If you are still having problems and haven't already, you might try increasing the AXL log level - might give a hint.
If weirdness is still happening, I would suggest opening a DevNet dev support ticket so we can dig into the details/logs: https://developer.cisco.com/site/support/
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide