10-26-2015 03:09 AM
Hi all,
I get the following error when trying to Device to appuser associateddevice.
The following error is:
<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>Element or attribute do not match QName production: QName::=(NCName':')?NCName. </faultstring>
<detail>
<axl:Error xmlns:axl="http://www.cisco.com/AXL/API/7.1">
<axl:code>5001</axl:code>
<axl:message>Element or attribute do not match QName production: QName::=(NCName':')?NCName. </axl:message>
<request>updateAppUser</request>
</axl:Error>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
My snip of my code is:
string version = "7.1"; | |
string soap = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://www.cisco.com/AXL/API/'"+ version +"' \">\n"; | |
soap += "<soapenv:Header/>\n"; | |
soap += "<soapenv:Body>\n"; | |
soap += "<ns:updateAppUser sequence=\"?\">\n"; | |
soap += "<userid>abxyz/userid>\n"; | |
soap += "<associatedDevices> \n"; | |
soap += "<device>SEP8C705A057CB9</device>\n"; | |
soap += "</associatedDevices>\n"; | |
soap += "<ns:/updateAppUserResponse>\n"; | |
soap += "</soapenv:Body>\n"; | |
soap += "</soapenv:Envelope>\n"; |
can some one help me.
Thanks
Jan Meeling
10-26-2015 08:38 AM
You're missing a < here:
<userid>abxyz/userid>
Should be...
<userid>abxyz</userid>
10-26-2015 11:32 PM
Hi Nicholas,
Thanks for your quick response.
I saw it even with the < I get the same error.
Regards
Jan
10-27-2015 06:52 AM
Yes, I also noticed you have a mismatched tag. This:
<ns:/updateAppUserResponse>
..should be..
<ns:/updateAppUser>
Here's a working example of the XML request. I strongly recommend testing out your requests with the free utility SoapUI. You can find and fix problems with your XML that way, and then turn it into code later.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/10.5">
<soapenv:Header/>
<soapenv:Body>
<ns:updateAppUser sequence="?">
<userid>daggett</userid>
<associatedDevices>
<device>SEP54EE7510D1D0</device>
</associatedDevices>
</ns:updateAppUser>
</soapenv:Body>
</soapenv:Envelope>
10-28-2015 12:46 AM
Hi Nicholas,
Thanks it works fine now, I had made type mismatches.
I have a question.
When the is a device already associated to the Application user and want to add one more how can you do it?
If I do it now it removed the device that already there.
Regards,
Jan Meeling
10-28-2015 08:11 AM
In the case of associated devices, you would need to perform a <getUser> request first to retrieve the current list of associated devices, make you modifications and then use <updateUser> to submit the replacement list.
Note, it is also possibly to do this more a bit more efficiently (though with other caveats like backward compatibility and complexity) by using direct SQL commands via <executeSqlQuery>/<executeSqlUpdate> - see the Data Dictionary for CUCM table/field details. You would mainly be interested in the 'enduser', 'device' and 'enduserdevicemap' tables.
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: