cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3881
Views
5
Helpful
13
Replies

Updating line CSS using UpdateLine API

upchaurasia
Spotlight
Spotlight

We are using AXL API to update line CSS. We are updating based on DN. In CUCM we have created 2 CSS as CSS1 and CSS2. We want to change CSS from CSS2 to CSS1. Our code is as below -


UpdateLineReq objUpdateLineReq=new UpdateLineReq();


XFkType xfkCSS = new XFkType();
xfkCSS.setValue("CSS1");


JAXBElement<XFkType> jaxbCssLine = new JAXBElement(new QName(XFkType.class.getSimpleName()), XFkType.class, xfkCSS);

jaxbCssLine.setValue(xfkCSS);

objUpdateLineReq.setPattern("2004");
objUpdateLineReq.setShareLineAppearanceCssName(jaxbCssLine);
StandardResponse objStandardResponse= objAXLPort.updateLine(objUpdateLineReq);
System.out.println(objStandardResponse);

I don't get any exception but CSS on line doesn't change.

Can you please suggest what else we need to do?

Regards,

Umesh

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

Okay - here's the fix:

JAXBElement<XFkType> jaxbCssLine = new JAXBElement<XFkType>(new QName("shareLineAppearanceCssName"), XFkType.class, xfkCSS);

Your code was creating this...

<XFkType>CSS1</XFkType>

...when it should have been creating this...

<shareLineAppearanceCssName>CSS1</shareLineAppearanceCssName>

View solution in original post

13 Replies 13

upchaurasia
Spotlight
Spotlight

Any input will help me to move fast. It's urgent.

Regards,

Umesh

Are you wanting to update the Calling Search Space under "Directory Number Settings" on the Directory Number Configuration, or the CSS for some other feature? Can you point out the corresponding field in the CUCM Admin GUI?

I am able to update the Calling Search Space of the Line with this basic request:

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

         <pattern>4545</pattern>

         <shareLineAppearanceCssName>CSS_1</shareLineAppearanceCssName>

         </ns:updateLine>

   </soapenv:Body>

</soapenv:Envelope>

I can see that the Calling Search Space got updated in the CUCM Admin GUI (under Directory Number Settings). I used SoapUI to send this request. Are you able to update the CSS outside of your app; by using tools like SoapUI?

npetrele
Cisco Employee
Cisco Employee

Okay - here's the fix:

JAXBElement<XFkType> jaxbCssLine = new JAXBElement<XFkType>(new QName("shareLineAppearanceCssName"), XFkType.class, xfkCSS);

Your code was creating this...

<XFkType>CSS1</XFkType>

...when it should have been creating this...

<shareLineAppearanceCssName>CSS1</shareLineAppearanceCssName>

Thanks Nicholas. I will try with ur fix today.

Regards,

Umesh

My pleasure.  If you encounter any more problems, post them here!

Thanks Nicholas. Your fast response made our life easy

Most of the update request (e.g. updatePhone, updateLine) returns StandardResponse which is a alphanumeric string (like uuid).

Is there any way to check either my request executed successfully or failed?

Regards,

Umesh

Nicholas,

I would like to modify the "Line Text Label" in device line (DN).

I am able to get using RPhoneLine object but unable to update.

I tried using UpdatePhoneReq & UpdateLineReq but didn't find any method like setLabel.

Can u please let me know the class & methid name which needs to be used for this?

Regards,

Umesh

You set the label in the XPhoneLine object, which has a setLabel method. A List of XPhoneLine somehow maps to the UpdatePhone.Lines.  I haven't played around with this, so I can't give you a code example, but it looks like you manipulate it differently than most APIs, since UpdatePhoneReq SetLines takes UpdatePhoneReq's Lines as an argument like so:

public void setLines(UpdatePhoneReq.Lines value)

Is there any document where I can find the difference in XPhone & RPhone?

Also getPhoneResponse.getReturn().getPhone().getLines() retruns RPhone.Lines whereas UpdatePhoneReq.setLines takes parameter as XPhoneLine.

I tried to type cast from RPhoneLine to XPhoneLine but it's not allowing.

What I am trying after ur anser is -

RPhone objRPhone= getPhoneResponse.getReturn().getPhone();

RPhone.Lines objLines= objRPhone.getLines();

UpdatePhoneReq objUpdatePhoneReq1=new UpdatePhoneReq();

objUpdatePhoneReq1.setName("SEPD824BDBA0911");

objUpdatePhoneReq1.setLines(x1); //this line gives type error x1

Regards,

Umesh

I don't know of any documentation for the ws-import generated API for Java, which makes sense, since you can use Java in so many different ways in order to use AXL.  You could simply send and receive raw XML, for example. 

When I do a ws-import, I use the "keep" switch in order to keep all the Java source files.  That way I can look at the actual Java source for the APIs.  I find this helpful. 

I'm not sure from your post if you know this already, but Lines is not a single XPhoneLine.  It is a List of multiple lines. 

List<XPhoneLine>

No, there's no way to know if the CSS changed properly from the returned XML.  You can do a follow-up getLine like this, with only the one returnedTag to see if the CSS changed to what you expect:

<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:getLine sequence="1">

         <pattern>1000</pattern>

         <returnedTags>

          <shareLineAppearanceCssName />

         </returnedTags>

      </ns:getLine>

   </soapenv:Body>

</soapenv:Envelope>

It should be easy to do this with Java.