Urgent : ASSOCIATE Profile to USER

Version 1
    This document was generated from CDN thread

    Created by: Abhishek Goud on 29-10-2009 08:58:49 AM
    Hi,
     
    I am desparately trying to associate a phone profile as a default profile for a user ... how to do it ? ... what's the c# code ?
     
    Thanks,
     
    Abhishek

    Subject: RE: Urgent : ASSOCIATE Profile to USER
    Replied by: Daniel Edwards on 29-10-2009 11:49:23 PM
    I would do this via the updateUser AXL request and use the "phoneProfiles" tag.  The request would look something like:
     
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <axl:UpdateUser  xmlns:axl="http://www.cisco.com/AXL/1.0" xsi:schemaLocation="http://www.cisco.com/AXL/1.0 http://ccmserver/schema/axlsoap.xsd" sequence="1234">
        <userId>###</userId>
        <phoneProfiles>
            <profileName>XXX</profileName>
        </phoneProfiles>
    </axl:UpdateUser>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
     
    Simply replace ### with the user-id of the user in question and XXX with the name of the profile you wish to associate the user with.  I haven't personally tried the query but it should work.

    Subject: RE: Urgent : ASSOCIATE Profile to USER
    Replied by: Abhishek Goud on 30-10-2009 04:35:34 AM
    Dear Daniel
     
    Hi, Thanks a lot for replying ... I am trying to implement the function in C# ASP.NET ... and I have used the following code to Update the User Profile ... it is AFTER my repeated unsuccessful attempts, that I am trying to look for other ways ... maybe you can correct my code ... I really need to get this done asap ... sorry and thanks !
     
    The Code :
     
            AXLAPIService oAXL = new AXLAPIService(_host, _axlUsername, _axlPassword);
            object[] profiles = new object[4];
            XPhoneProfile phnprof1 = new XPhoneProfile();
            AddDeviceProfileReq prof = new AddDeviceProfileReq();


    |//The entire code for the setting up of a new profile comes here
    |//This code for new device profile creation works just fine
    |
    |
            prof.newProfile = phnprof1;
            oAXL.addDeviceProfile(prof);
            profiles.SetValue(phnprof, 1);
            UpdateUserReqPhoneProfiles ss = new UpdateUserReqPhoneProfiles();
            ss.Items = profiles;
            UpdateUserReq UserupReq = new UpdateUserReq();
            UserupReq.userid = "summenon";
            UserupReq.phoneProfiles = ss;
            oAXL.updateUser(UserupReq);

    Subject: RE: Urgent : ASSOCIATE Profile to USER
    Replied by: Daniel Edwards on 30-10-2009 12:49:20 PM
    I would look at the request you are sending out and see if the class you are using is generating the request correctly.  It sounds like there might be an issue in how it generates the profile section of the request.

    Subject: RE: Urgent : ASSOCIATE Profile to USER
    Replied by: Sascha Monteiro on 01-11-2009 05:50:49 PM
    I had to do a DB update to set a profile as default;
    snippet from my code:
    xml += "<sql>update enduserdevicemap set defaultprofile = 't' where fkenduser in (select pkid from enduser where userid = '"+userID+"') and fkdevice in (select pkid from device where name = '"+defaultProfile+"')</sql>";

    Subject: RE: Urgent : ASSOCIATE Profile to USER
    Replied by: Abhishek Goud on 03-11-2009 05:32:34 AM
    Hi,
    Thanks a lot for replying ... I am able to set the default profile of the end user to the profile I need but in order to set it to the wanted profile, I need to first update the "Controlled Profiles" of the End User. How to do that ? ... I am stuck !
     
    Thanks in advance !
     
    Abhishek