现在,我有一个Java程序,我想用它来启动网真服务器。代码如下:
public static XmlRpcClient getMCUClient() throws MalformedURLException{
Lock lock = new ReentrantLock();
lock.lock();
try {
XmlRpcClient client = new XmlRpcClient("https://10.0.0.53/RPC2", true);
return client;
} finally {
lock.unlock();
}
}我使用以下代码来创建一个会议:
XmlRpcClient client = XMLClientFactory.getMCUClient();
List<Conference> list = new ArrayList<Conference>();
conference.setAuthenticationUser("admin");
conference.setAuthenticationPassword("password");
conference.setConferenceName("conference_eg");
list.add(conference);
client.invoke("conference.create", list);我想知道这是否正确,因为没有环境可供我测试。
发布于 2015-04-08 03:36:32
结合使用Spring和CXF。这很简单,而且很快:
SchedulingAPI13ServiceTest-context.xml:
<jaxws:client address="http://10.66.73.77:8080/ctxapi/api/v1_3/sched"
id="client"
xmlns:s="http://sched.api.ctc.txbu.cisco.com"
serviceName="s:SchedulingAPI_V1_3Service"
endpointName="s:SchedulingAPI_V1_3Port"
wsdlLocation="http://10.66.73.77:8080/ctxapi/api/v1_3/sched?wsdl"
serviceClass="com.cisco.txbu.ctc.api.sched.ISchedulingAPI"
username="foo"
password="bar" >
</jaxws:client>JUnit测试:
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class SchedulingAPI13ServiceTest {
@Autowired
ISchedulingAPI port;
@Test
public void requestResponseTest() throws Exception {
GetServiceProvidersResult serviceProviders = port.getServiceProviders("(name sw Enterprise)");
}https://stackoverflow.com/questions/27836151
复制相似问题