AXL 6.01 - No Groups are assigned

Version 1
    This document was generated from CDN thread

    Created by: zellophan (simulated) on 17-03-2009 03:42:57 PM
    I'am actually developing an SOAP based solution, to add/delete/modify
    Users in the CCM via the AXL api. 6.01

    Creating, Modifing and Deleting works fine. But when I'm trying to set a
    default group at the creation or modification process, nothing happens.

    In the response there is the uuid of the user, but no error code or message.
    Also funny is, if I write to directly to a group and set the user as member it works. But this replaces all other members.

    Here some examples:

    <soapenv:Envelope
    xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns=3D"http://www.cisco.com/AXL/API/6.1">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:updateUser sequence=3D"24364">
             <userid>a1a1</userid>
             <associatedGroups>
                    <userGroup uuid=3D"{F17F95A6-C185-41A8-872E-70BFAC7E634D}">
                            <name>Standard CCM End Users</name>
                            <userRoles>
                                    <userRole uuid=3D"{CA97DD09-5DC4-4DB3-9893-2F5D35764BAD}">Standard CCM End Users</userRole>
                                    <userRole uuid=3D"{9CA7294A-9559-4BA2-A7CC-212B7C605625}">Standard CCMUSER Administration</userRole>
                            </userRoles>
                    </userGroup>
            </associatedGroups>
          </ns:updateUser>
       </soapenv:Body>
    </soapenv:Envelope>

    OR

    <soapenv:Envelope
    xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns=3D"http://www.cisco.com/AXL/API/6.1">
       <soapenv:Header/>
    <soapenv:Body>
    <ns:addUser sequence=3D"2">
    <newUser>
    <firstname>11</firstname>
    <lastname>a1a1121</lastname>
    <userid>a1a1</userid>
    <department>DE-US-FF-IM-SYS</department>
    54321
    111
    <associatedPC/>
    <associatedGroups>
    <userGroup uuid=3D"{F17F95A6-C185-41A8-872E-70BFAC7E634D}">
    <name>Standard CCM End Users</name>
    <userRoles>
    <userRole uuid=3D"{CA97DD09-5DC4-4DB3-9893-2F5D35764BAD}">Standard CCM End Users</userRole>
    <userRole uuid=3D"{9CA7294A-9559-4BA2-A7CC-212B7C605625}">Standard CCMUSER Administration</userRole>
    </userRoles>
    </userGroup>
    <userGroup uuid=3D"{64A8AF58-7A0D-4A06-A7E9-D8E033510CEA}">
    <name>Standard CTI Enabled</name>
    <userRoles>
    <userRole uuid=3D"{FD32A61F-6F83-4504-AFC8-1CDB89C6396E}">Standard CTI Enabled</userRole>
    </userRoles>
    </userGroup>
    </associatedGroups>
    </newUser>
    </ns:addUser>
    </soapenv:Body>
    </soapenv:Envelope>


    The user is always created, but no groups are assigned.

    Can you help?

    Thanks and regards
    -----

    Patrick Oberlechner

    Senior Consultant
    Secure Identity Management, Linux
    and Software Development

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: David Staudt on 17-03-2009 07:55:37 PM
    The XUser XML sub object is used by a number of different AXL requests, but is marked 'read-only.'  When used in the addUser and similar requests, it is basically it is ignored.  With something like getUser, the values would be present, but of course read-only.
     
    For modifying the association of users to user groups, use the updateUserGroup request.  You can either specify the entire inclusive list of users with members, or add or remove specific users with addMembers or removeMembers.
     

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Simon Rood on 24-03-2009 03:09:44 PM
    Hello David
     
    We face exactly the same issue as the original requester. We are using CUCM 6.1.1.2000-3.
    We have followed your suggestion to use updateUserGroup with addMembers.
    The request is processed without any error responses, but the user in the addMembers is the ONLY user which becomes member of the specified UserGroup; existing users are removed from the UserGroup.
     
    The workaround would be to specify each time we add a single end user, the invoke an updateUserGroup containing a list of all 20'000 user UUIDs.
     
    Is the observed behaviour a bug in CUCM 6.1.1.2000-3?
    Is there a patch or other alternative available?
     
     
     
     

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Stephan Steiner on 25-03-2009 10:46:51 AM
    How about making the user a member using sql commands? I haven't checked the DB schema yet, but I'm using db inserts to assing phones to app users and that works quite well. You can run sql queries from the ccm cli so once you've figured out the proper tables with the help of the DB schema (which you can download from this site), run a few queries to see how an association looks, then insert one on your own.

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: David Staudt on 25-03-2009 03:12:46 PM
    Looking more closely at the CM6 vs CM7 schemas, it looks like updateUserGroup/addMembers is present only in CM7.  So, for CM6 you would need to retrieve the current list of members (via getUserGroup), update the list and resubmit via updateUserGroup.  Clearly unwieldy for large groups...as Stephen suggest you may be able to work around this by using executeSQLUpdate to do the change via SQL. 
     
    Not sure why a request with an addMembers element would even succeed against CM6..?  I tested this quickly and my CM6 seemed to ignore the addMembers element - not even adding the member listed.
     
    CM7 offers the addMembers/removeMembers elements which should make the issue moot going forward.

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Stephan Steiner on 30-03-2009 04:06:41 PM
    David: the reason why you can often send commands with unrelated tags and they still work is because AXL is no real webservice.
     
    The CCM doesn't do what a regular webservice server end does.. deserialize the stream into an object based on the wsdl - instead, they parse out the xml elements they're looking for and that's that. In fact, you can even send invalid XML and it is still accepted (I managed to send a combination between phone and line in an update statement and it worked out just fine - until we ran into a problem I started debugging and noted that what I'm sending makes no sense.. I figured if the ccm accepts my commands what I'm sending is correct but you cannot rely on that).
     
    That also explains why if you generate code from the wsdl, it doesn't always work out either.. the CCM can search for a different string than is in the schema. Due to all the bug reports by developers that has gotten better over the years but initially there were quite a few notational differences.. e.g. the schema said searchName but the ccm would expect searchname.
     
    So, if you send tags that are not valid against a certain version but the rest of the command is proper and matches your ccm version, it will still be accepted. With the version numbering, I figure you can even force that.. e.g. you can send 7.0 syntax but if you send no version or version 6.0, the ccm will default to the lower version syntax and not complain if you missed some element that is mandatory in 7.0 but doesn't exist in 6.0 - the way I understand it, if you specify a version, it extracts just the fields for that version and ignores the rest. This has a few advantages if you write your own code.. on the xml writing end you don't have to worry if a parameter applies to a given version.. if it doesn't, it will just be ignored.

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: David Staudt on 30-03-2009 07:44:28 PM
    Yeah, my 'Not sure...' statement was more or less rhetorical  Yours is as good a summarization of the way AXL parses the XML as any I've seen, thanks.
     
    My understanding is that in upcoming versions, the server side AXL code will start to completely use Axis-generated stubbing, which should eliminate all these types of issues.  

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Stephan Steiner on 31-03-2009 06:44:01 AM
    Seeing is believing though - people have complained about the manually created schema since the dark ages. The move to another platform (Linux) imho would've been the perfect place to change the architecture but it didn't happen.

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Frederick Nielsen on 14-10-2009 08:21:22 PM
    Has anyone been able to get addMembers to work in CM7?  I can't seem to work out the proper syntax.

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: nadzfn indzasdn on 16-10-2009 12:41:12 PM
    I figured it out in 7.1:
     
     
                    <axl:updateUserGroup>
                        <name>
                            MyGroup
                        </name>
                        <addMembers>
                            <member>
                                <userId>
                                    Testuser
                                </userId>
                            </member>
                        </addMembers>
                    </axl:updateUserGroup>
     
     
    AND very important and this was the resolution:
    you have to set the soap-action in the header:
    CUCMB ver=7.1 updateUserGroup

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Sascha Monteiro on 17-10-2009 06:31:34 PM
    Hi,
     
    I always add the user roles via sql (I found the updateUserRole way too tricky, especially if  there are parrallel updates)
     
    <sql>insert into enduserdirgroupmap (fkenduser,fkdirgroup) values((select pkid from enduser where userid='"+userID+"'),(select pkid from dirgroup where name = '"+userGroup+"'))</sql>

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Frederick Nielsen on 10-11-2009 08:27:52 AM
    Your post gave me the clue I needed here.  Since the incremental addMembers function was introduced in 7.0 and systems are now defaulting to the oldest supported schema version (for example, a CUCM 7.1 system defaults to the 6.1 schema) it is necessary to specify the newer schema version in the SOAPaction header if you need to leverage something new.
     
    For me, dropping the following into my HTTP header allowed this function to work as expected:
    SOAPAction: "CUCM:\DB  ver=7.0"
     
    More about this here: http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/devguide/7_1_2/axl.html#wp1054628


     

    Subject: RE: AXL 6.01 - No Groups are assigned
    Replied by: Alejandra Moreno on 23-03-2010 02:07:28 PM
    Hi,
     
    With CCM 7.1 is it right that it's not possible to use updateUserGroup to add a application user as member? Is there any method (apart from using direct SQL) to add applications users to groups?
     
    If I use addAppUser and try to add 3 associated groups I get an error:
    <faultstring>Could not insert new row - duplicate value in a UNIQUE INDEX column.</faultstring>

     
    If I use updaAppUser and try to add more than 2 associated groups only the first two get added.
     
    Thanks!
     
    cheers,
    alej