Error : "No UPDATE Permission" - AXL API Service

Version 1
    This document was generated from CDN thread

    Created by: Abhishek Goud on 07-10-2009 09:23:43 AM
    I am trying to add another line to an existing phone, while the line configuration is successfully changing from 2L 4S (2 Lines 4 Speed Dials) to 3L 3S (3 Lines 3 Speed Dials), I am unable to add my new extension number to the THIRD LINE. It throws an Exception Error message : "No UPDATE Permission".
     
    This is my code for Updating the Phone : (After querying the existing lines of the phone)
     
    AXLAPIService oXL = new AXLAPIService(_host, _axlUsername, _axlPassword);<font size="2">
     
    </font>
     
    UpdatePhoneReq uPhone = new UpdatePhoneReq(); <font size="2">
     
    </font>
     
     
    UpdatePhoneReqLines _lines = new UpdatePhoneReqLines(); <font size="2">
    uPhone.ItemElementName =
    </font>
    ItemChoiceType28.name;
    uPhone.Item = maci.ToString();
    <font size="2">
    uPhone.Item8ElementName = I
    </font>

    tem8ChoiceType.phoneTemplateName;<font size="2">
    uPhone.Item8 =
    </font>
    "7960 3L 3S";<font size="2">
     
    </font>
     
     
    XLine Linedetails = new XLine();
    oXL.updatePhone(uPhone);
    <font size="2">
    Response.Write(
    </font>
    "The Phone has 3 lines NOW");<font size="2">
    Response.Write(
    </font>

    "<br />");
     
     
     
    try
     {<font size="2">
     
    </font>
     
     
     
    GetPhoneReq GphReq = new GetPhoneReq(); <font size="2">
     
    </font>
     
    GetPhoneRes GphRes = new GetPhoneRes();
     
    <font size="2">
    GphReq.ItemElementName =
    </font>
    ItemChoiceType29.phoneName;
    GphReq.Item = maci.ToString();
    <font size="2">
     
    </font>

     
     
     
     
     
     
     
     
     
     
    GetPhoneResReturn phnuser = oAXL.getPhone(GphReq).@return;
     
    <font size="2">
     
    </font>
     
    if (oAXL.getPhone(GphReq).@return.device.lines.Items != null)
    {
    <font size="2">
     
    </font>
     
    foreach (XLine line in oAXL.getPhone(GphReq).@return.device.lines.Items)
    {
    <font size="2">
     
    </font>
     
    DirectoryNum phdeviceItem = new DirectoryNum();
    phdeviceItem.PhoneName = maci.ToString();
    <font size="2">
     
    </font>
     
    GetLineReq getline = new GetLineReq();
    getline.uuid = line.Item.uuid;
    <font size="2">
     
    </font>
     
    GetLineResReturn phoneLine = oAXL.getLine(getline).@return; <font size="2">
    Response.Write(m +
    </font>
    ")");
    m++;
    Response.Write(phoneLine.directoryNumber.pattern);
    <font size="2">
    Response.Write(
    </font>
    "<br />");
    }
    }
    }
    <font size="2">
     
    </font>
     
    catch (Exception ex)
    {
    Response.Write(ex.Message);
    Response.Write(ex.InnerException);
    }
    <font size="2">
     
    </font>
     
    if (uPhone.Item8 == "7960 3L 3S")
    {
    <font size="2">
     
    </font>
     

     
     
     
    try
     
     {<font size="2">
     
    </font>
     
     
    XIPPhoneLines _lines1 = new XIPPhoneLines(); <font size="2">
     
    </font>
     
    XNPDirectoryNumber newnum = new XNPDirectoryNumber();
     
    <font size="2">
     
    </font>
     

     
    XLineCallInfoDisplay callinfor = new XLineCallInfoDisplay();<font size="2">
     
    </font>
     
    XLine _line = new XLine();<font size="2">
     
    </font>
     
    XPresenceGroup Xpres = new XPresenceGroup();<font size="2">
     
    </font>
     
    XNumplanIdentifier xplan = new XNumplanIdentifier();<font size="2">
     
    </font>
     
    XNumPlan xnp = new XNPDirectoryNumber();<font size="2">
     
    </font>
     
    UpdatePhoneReq upPhone = new UpdatePhoneReq();<font size="2">
    upPhone.ItemElementName = I
    </font>
    temChoiceType28.name;
    upPhone.Item = maci.ToString(); //THIS IS WHERE I ASSOCIATE THE MAC OF THE PHONE
    <font size="2">
     
    </font>
     <font size="2">
     
    </font>
    _line.index = "3";
    newnum.pattern = TextBox2.Text;
    <font size="2">
     
    </font>
    _line.Item = newnum;<font size="2">
     
    </font>
     

     

    itemsField1.SetValue(_line, i);
    _lines.Items = itemsField1;
    upPhone.lines = _lines;
    oXL.updatePhone(upPhone);

    Subject: RE: Error : "No UPDATE Permission" - AXL API Service
    Replied by: Stephan Steiner on 07-10-2009 01:16:39 PM
    with all the font tags it's pretty hard to read what you're doing.
     
    I'm wondering though.. are you changing the phone button template concurrently with adding the third line (that I presume you have already created)? I could imagine this not being supported since you cannot do it via ccmadmin either.
    Does it work when you first change the phone button template and add the line thereafter?
     
    Also, if you look at the axl logs from the CCM (set it to debug mode) what do you see? You should see a bunch of SQL statements followed by one or multiple exceptions before the error is being sent back to you.

    Subject: RE: Error : "No UPDATE Permission" - AXL API Service
    Replied by: Abhishek Goud on 14-10-2009 07:13:48 AM
    Hi Stephen ... sorry to have included all those tags ... I really didn't know how to get rid of them ... anyway, I am successful in adding a 3rd Line to the phone ... as in changing the configuration from "2L 4S" to "3L 3S" ( I do this first ... invoking a separate service ) ... but when I want to assign a directory number to the 3rd line (this is a later separate service request), I am getting the error exception message "No UPDATE Permission" ... now, I am assuming that apparently the service is still active and is still querying ("keep alive") so that is why, maybe (again this is an assumption), I haven't got the right to update the line details.
     
    I am using first the following code to change the phone button template:
     
    AXLAPIService oxl = new AXLAPIService(_host, _axlusername, _axlpassword);
    UpdatePhoneReq uPhone = new UpdatePhoneReq();
    UpdatePhoneReqLines _lines = new UpdatePhoneReqLines();
    uPhone.ItemElementName = ItemChoiceType28.name;
    uPhone.Item = mac.ToString(); //I pass the mac address of the phone that I want updated here
    uPhone.Item8ElementName = Item8ChoiceType.phoneTemplateName;
    uPhone.Item8 = "7960 3L 3S";
    oxl.updatePhone(uPhone);
     
    This happens successfully and the template is changed. Then, in the second loop, after this is completed, I try running the code for adding a directory number for third line. This is where the problem occurs:
    UpdatePhoneReq upPhone = new UpdatePhoneReq();
    UpdatePhoneReqLines _lines1 = new UpdatePhoneReqLines();
    XLine line = new XLine();
    XNPDirectoryNumber newnum = new XNPDirectoryNumber();
    upPhone.Item = mac.ToString();
    line.index = "3";
    newnum.pattern = TextBox2.Text;
    line.Item = newnum;
    object itemsfield1 = new object[4];
    itemsfield1.SetValue(line, 3);
    lines1.Items = itemsfield1;
    upPhone.lines = lines1;
    oxl.updatePhone(upPhone);