cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
929
Views
1
Helpful
4
Replies

Upgrade phone load name and apply config via Java client for AXL

jialinli
Level 1
Level 1

Hi, all

I want to upgrade phone load name and apply config via Java client for AXL on CUCM11.5. As a new beginner, I ran the Demo script at https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp first and I could get Product Name and Phone load info successfully. Then I looked through the java package under "com.cisco.axl.api._11", and I found method "setLoadInformation(JAXBElement<XLoadInformation> value)" in "UpdatePhoneReq.java", but I don't know how to use this method correctly... Looking forward to your help... Thanks!

Regards,

Jialing

1 Accepted Solution

Accepted Solutions

After much trial-and-error and research I got the following to work against CUCM 11.0:

UpdatePhoneReq updatePhoneParams = new UpdatePhoneReq();

updatePhoneParams.setName(phoneName);

ObjectFactory factory = new ObjectFactory();

XLoadInformation loadInformationParam = factory.createXLoadInformation();

loadInformationParam.setValue("test-load-1");

JAXBElement<XLoadInformation> getPhoneLoadInformationParam = factory.createUpdatePhoneReqLoadInformation(loadInformationParam);

updatePhoneParams.setLoadInformation(getPhoneLoadInformationParam);

try {

  StandardResponse updatePhoneResponse = axlPort.updatePhone(updatePhoneParams);

  Demo.informUser("Load update succeeded" + "%n");

} catch ( Exception e) {

  System.out.println("Error: " + e.getMessage() );

}

View solution in original post

4 Replies 4

dstaudt
Cisco Employee
Cisco Employee

As this is more of a question about how to use JAX-WS generated classes (vs. a question about the AXL SOAP API itself), it may be helpful to look around for some JAX-WS tutorials or samples code on the web.

Hi, David

Do you have more specific materials of JAX-WS for CUCM to recommend? The JAX-WS tutorials on web are too general, and I just want to use the classes generated in this axl-demo https://developer.cisco.com/site/axl/learn/how-to/axl-java-sample-application.gsp. I'm studying the guides found on web but it's very time consuming, so I still hope someone could offer detailed methods to upgrade phones... Do you have any other suggestions? Thanks very much~

Best wishes.

Thanks,

Jialing

After much trial-and-error and research I got the following to work against CUCM 11.0:

UpdatePhoneReq updatePhoneParams = new UpdatePhoneReq();

updatePhoneParams.setName(phoneName);

ObjectFactory factory = new ObjectFactory();

XLoadInformation loadInformationParam = factory.createXLoadInformation();

loadInformationParam.setValue("test-load-1");

JAXBElement<XLoadInformation> getPhoneLoadInformationParam = factory.createUpdatePhoneReqLoadInformation(loadInformationParam);

updatePhoneParams.setLoadInformation(getPhoneLoadInformationParam);

try {

  StandardResponse updatePhoneResponse = axlPort.updatePhone(updatePhoneParams);

  Demo.informUser("Load update succeeded" + "%n");

} catch ( Exception e) {

  System.out.println("Error: " + e.getMessage() );

}

You are so awesome, David~     I can update the phone load name with your code now.

After studying your code, I found that calling a function is much more complex than I expected, I think I should spend more time studying java since there are still a lot of difficult challenges lie ahead... Thank you so much for taking time to solve this problem~ Now I need to solve problems independently~ Any suggestions are welcomed. Wish me good luck.

Thanks,

Jialing