我想要做的是使用Cisco的AXL API从CUCM获得一个目录号。以下是相关守则:
private void getNumber(){
AXLAPIService axlService = new AXLAPIService();
AXLPort axlPort = axlService.getAXLPort();
String validatorUrl = "https://mycucm:8443/axl/";
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, validatorUrl);
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, Demo.ucAdmin);
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, Demo.ucPswd);
GetLineReq axlParams = new GetLineReq();
axlParams.setPattern("7491817");
axlParams.setUuid("{48a6ff28-cea7-fc3e-3d82-8cc245ed4ea3}");
GetLineRes getLineResponse = axlPort.getLine(axlParams);
Demo.informUser("Line Information: \n"
+ "Alerting Name: " + getLineResponse.getReturn().getLine().getAlertingName() + "\n"
+ "Dial Number: " + getLineResponse.getReturn().getLine().getPattern() + "\n"
+ "Description: " + getLineResponse.getReturn().getLine().getDescription() + "\n"
+ " " + getLineResponse.getReturn().getLine().getShareLineAppearanceCssName());
}
从这个图表中可以看出,只需要指定数字的uuid或模式:
但是,只有当我指定uuid (这不是我想要实现的)时,代码才能工作。我给出的唯一东西是模式,我想使用它来获取所有其他信息。我已经从思科:如何..。使用JAX-WS创建AXL Java客户端上看过这个网站了
当我省略uuid时,会得到以下错误:
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Item not valid: The specified Line was not found
我还检查了如何使用AXLSqlToolkit将目录号存储在CUCM数据库中:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><SOAP-ENV:Body><axl:executeSQLQueryResponse xmlns:axl="http://www.cisco.com/AXL/API/7.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sequence="1405672933992"><return><row><dnorpattern>7491817</dnorpattern><pkid>48a6ff28-cea7-fc3e-3d82-8cc245ed4ea3</pkid></row></return></axl:executeSQLQueryResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
有谁知道,只有使用pattern-value?才能获得目录号?
发布于 2014-07-25 00:06:24
我自己想出来的。routePartitionName也是一个必须指定的强制参数。下面是我的方法的工作代码:
private void getNumber(){
AXLAPIService axlService = new AXLAPIService();
AXLPort axlPort = axlService.getAXLPort();
String validatorUrl = "https://mycucm:8443/axl/";
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, validatorUrl);
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, Demo.ucAdmin);
((BindingProvider) axlPort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, Demo.ucPswd);
GetLineReq axlParams = new GetLineReq();
ObjectFactory objectFactory = new ObjectFactory(); //This is new
XFkType routePartition = new XFkType();
routePartition.setValue("PHONES"); // This is where you specify your route partition name
axlParams.setPattern("7491817");
axlParams.setRoutePartitionName(objectFactory.createGetLineReqRoutePartitionName(routePartition));
GetLineRes getLineResponse = axlPort.getLine(axlParams);
Demo.informUser("Line Information: \n"
+ "Alerting Name: " + getLineResponse.getReturn().getLine().getAlertingName() + "\n"
+ "Dial Number: " + getLineResponse.getReturn().getLine().getPattern() + "\n"
+ "Description: " + getLineResponse.getReturn().getLine().getDescription() + "\n"
+ " " + getLineResponse.getReturn().getLine().getShareLineAppearanceCssName());
}
https://stackoverflow.com/questions/24825964
复制