executeSQLUpdate

Version 1
    This document was generated from CDN thread

    Created by: Rocco Prielipp on 18-07-2011 08:10:58 AM
    hello,
     
    after i got some very good answers here, i have a new question.
     
    I read, that i have to enable a user (Enable CUP (Cisco Unified Presence)Enable CUPC (Cisco Unified Personal Communicator)) with the executeSQLUpdate command.
     
    does anyone know which table and which column i have to change? And how?
     
    The same problem i have with the subscribe CSS. Ich read in this forum, that i have to set this attribute also with sqlupdate. It was posted that the table is unduser and the column is fkcallingsearchspace_Restrict.
     
    But i am unable to set the a subscribe CSS.
     
    Can anyone post a little example? or better a document or something like that where i find this infomation?
     
    Thx
     
    Rocco Prielipp

    Subject: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 18-07-2011 04:26:49 PM
    Hi,

    This does the trick;

    <sql>insert into enduserlicense (fkenduser,enablecups,enablecupc) values((select pkid from enduser where userid='myuserid'),'t','t')</sql>

    <sql>update enduser set fkcallingsearchspace_restrict = (select pkid from callingsearchspace where name = 'TheSubscribeCSS') where userid = 'myuserid'</sql>

    Subject: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 19-07-2011 02:55:49 AM
    well, it looks like your sql query does not match what I posted, you need to have the nested select query as you need the pkid of the user, not the userid in the table..

    Subject: RE: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Admin
    Replied by: Rocco Prielipp on 19-07-2011 02:51:11 AM
    hi thanks for it but i tried it out

    and  for this request:

    <sql>insert into enduserlicense (fkenduser,enablecups,enablecupc) values ('prielipp','t','t')<sql>

    i got the following error

    <axl:message>Missing key in referenced table for referential constraint (informix.fk_enduserlicense_fkenduser).</axl:message>

    and the subscribeCSS request got nearly the same error

    Missing key in referenced table for referential constraint (informix.fk_enduser_fkcallingsearchspace_restrict)

    I dont know what this error means Do you habe any idea?

    Subject: RE: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Admin
    Replied by: Rocco Prielipp on 19-07-2011 03:06:03 AM
    oh sorry i thought it is the same. Do you know where to get the pkid of the user?

    greetings

    Subject: RE: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Admin
    Replied by: Rocco Prielipp on 19-07-2011 04:12:01 AM
    ok i was t o fast i "found" it out by myself and it works

    but is there an other possibility to get the pkid of the user than getting it direct from the database?

    Subject: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 19-07-2011 04:26:49 AM
    the AXL getUser response will have the uuid (the enduser.pkid)

    Subject: RE: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Admin
    Replied by: Rocco Prielipp on 19-07-2011 05:31:25 AM
    you are totally right,

    thank you for your help and your first hint is of cause easier and represents the better solution for me

    thank you a lot

    Subject: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Administr
    Replied by: Sascha Monteiro on 19-07-2011 04:21:49 AM
    well, the query I posted takes care of that, you just have to put in the userid;

    <sql>insert into enduserlicense (fkenduser,enablecups,enablecupc) values((select pkid from enduser where userid='prielipp'),'t','t')</sql>

    Subject: RE: Re: New Message from Rocco Prielipp in Administration XML (AXL) - Admin
    Replied by: Doug Kartio on 20-07-2011 03:41:04 PM
    If you are using Java/Soap, you can also set those variables with the following:

     1
     2    public SOAPMessage createSoapMessage(String cmdName) throws Exception {
     3        // Add a soap body element to the soap body
     4        MessageFactory mf = MessageFactory.newInstance();
     5        SOAPMessage soapMessage = mf.createMessage();
     6
     7        // Setting SOAPAction header line
     8        MimeHeaders headers = soapMessage.getMimeHeaders();
     9        headers.addHeader("SOAPAction", "CUCM:DB ver=7.1 updateUser" );
    10
    11        SOAPEnvelope envelope = soapMessage.getSOAPPart().getEnvelope();
    12        envelope.addAttribute(envelope.createName("xmlns:xsd"), "http://www.w3.org/2001/XMLSchema");
    13        envelope.addAttribute(envelope.createName("xmlns:xsi"), "http://www.w3.org/2001/XMLSchema-instance");
    14       
    15        SOAPBody bdy = envelope.getBody();
    16        [b]SOAPBodyElement bodyElement = bdy.addBodyElement(envelope.createName("axl:updateLicenseCapabilities"));[/b]
    17        bodyElement.addAttribute(envelope.createName("xmlns:axl"), "http://www.cisco.com/AXL/API/7.1");
    18        bodyElement.addAttribute(envelope.createName("xsi:schemaLocation"), "http://www.cisco.com/AXL/API/7.1 http://ccmserver/schema/axlsoap.xsd");
    19        bodyElement.addAttribute(envelope.createName("sequence"), "1");
    20
    21[b]       
    22//    <userid>user Id</userid>
    23        SOAPElement userid = bodyElement.addChildElement("userid");
    24        userid.addTextNode("dkartio");       
    25        bodyElement.appendChild(userid);
    26       
    27//    <enableUPS>True</enableUPS>
    28        SOAPElement enableUPS = bodyElement.addChildElement("enableUPS");
    29        enableUPS.addTextNode("true");       
    30        bodyElement.appendChild(enableUPS);
    31       
    32//    <enableUPC>True</enableUPC>   
    33        SOAPElement enableUPC = bodyElement.addChildElement("enableUPC");
    34        enableUPC.addTextNode("false");       
    35        bodyElement.appendChild(enableUPC);
    36[/b]
    37        return soapMessage;
    38    }