cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1397
Views
0
Helpful
6
Replies
Dan
Beginner
Beginner

How do I add an owner to an existing phone via AXL in CUCM 10.5.2?

I am using the AXL SOAP API to provision CSF devices for our Jabber users. We've just upgraded to CUCM 10.5.2 from 8.6.2, and i've decided it would be good practise to start setting the owner on the device.

If i'm provisioning a *new* device via addPhone, this works fine. I can send an add request to the server with the ownerUserName field in the XML set to have an attribute of uuid, set to the UUID of the user, and content of the user's userid.

I can then send an updatePhone request with the ownerUserName set to empty and with no uuid attribute, and the owner is unset.

If, however, I then try to re-add the user by sending an updatePhone with an ownerUserName set, I get the error "Error code -691 - 'Missing key in referenced table for referential constraint (informix.fk_device_fkenduser).'". This error occurs whether the device is one that was present on CUCM 8.6.2 and has been upgraded, or is a newly created device on 10.5.2. It does not matter if I try to set the owner to a different user than the one the device was created with, or the same user having previously unset the owner. I have tested this with non-CSF devices (6941 and 7962 physical handsets) as well, and the behaviour is consistent. In all cases I am able to set the relevant user via the CUCM web admin interface.

Is there something I am missing that needs to be set in addition to be able to set the owner of an existing device on 10.5.2? It's worth noting that I had a *different* set of existing devices which I was setting the owner on successfully in the above way under 8.6.2, but the AXL job to do that is also now failing under 10.5.2.

6 REPLIES 6
npetrele
Cisco Employee

Could you post a sample AXL updatePhone XML Soap request (sanitized, of course)?  

This was taken from SoapUI loaded with the 10.5 AXL WSDL downloaded from our test CUCM publisher, and directed at said publisher:

getPhone:

<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:getPhone>

         <name>CSFTEST</name>

         <returnedTags>

             <name/>

         </returnedTags>

      </ns:getPhone>

   </soapenv:Body>

</soapenv:Envelope>

getPhoneResponse (just to show that the UUID is correct for the device):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

      <ns:getPhoneResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5">

         <return>

            <phone ctiid="377" uuid="{33DEAECA-CB4C-A51F-3005-B7F981E06428}">

               <name>CSFTEST</name>

            </phone>

         </return>

      </ns:getPhoneResponse>

   </soapenv:Body>

</soapenv:Envelope>

getUser:

<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:getUser>

         <userid>testuser</userid>

         <returnedTags>

             <userid/>

         </returnedTags>

      </ns:getUser>

   </soapenv:Body>

</soapenv:Envelope>

getUserResponse:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

      <ns:getUserResponse xmlns:ns="http://www.cisco.com/AXL/API/10.5">

         <return>

            <user uuid="{053E9693-0BBB-473B-AAE6-B085BA0CB6E7}">

               <userid>testuser</userid>

            </user>

         </return>

      </ns:getUserResponse>

   </soapenv:Body>

</soapenv:Envelope>

updatePhone:

<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:updatePhone>

         <uuid>{33DEAECA-CB4C-A51F-3005-B7F981E06428}</uuid>

         <ownerUserName uuid="{053E9693-0BBB-473B-AAE6-B085BA0CB6E7}">testuser</ownerUserName>

      </ns:updatePhone>

   </soapenv:Body>

</soapenv:Envelope>

updatePhoneResponse:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Body>

      <soapenv:Fault>

         <faultcode>soapenv:Client</faultcode>

         <faultstring>Missing key in referenced table for referential constraint (informix.fk_device_fkenduser).</faultstring>

         <detail>

            <axlError>

               <axlcode>-691</axlcode>

               <axlmessage>Missing key in referenced table for referential constraint (informix.fk_device_fkenduser).</axlmessage>

               <request>updatePhone</request>

            </axlError>

         </detail>

      </soapenv:Fault>

   </soapenv:Body>

</soapenv:Envelope>

npetrele
Cisco Employee

Try dropping the user's uuid portion of the request so that it reads:


<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:updatePhone>

         <uuid>{33DEAECA-CB4C-A51F-3005-B7F981E06428}</uuid>

         <ownerUserName>testuser</ownerUserName>

      </ns:updatePhone>

   </soapenv:Body>

</soapenv:Envelope>

That does indeed work. The WSDL, however, does specify that it should be possible to reference with UUID. It works for addPhone, and when doing a getPhone the UUID is populated on the relevant element of the returned object.

I'll edit my library so that it doesn't insert the UUID for this particular node. Thank you.

Did you look at the error in the AXL log? You sometime see the SQL command it tries to run. I've just hit a very similar issue, bit in my case, the uuid returned by a get wasn't the proper uuid - your case is a bit different.

Guys! I just want to say thank you so much. I remove from the expression and it worked great.

 

The original expression looks: <ownerUserName uuid="?">?</ownerUserName> 

 

So, I remove the uuid as you stated and it worked.

 

Final expression: <ownerUserName>?</ownerUserName> 

Create
Recognize Your Peers
Content for Community-Ad