webService
xfire客户端调用写法:
Client client = new Client(new URL("http://192.168.0.x:xxxx/cemabenteng/Services/ProBaseDataTransmit?wsdl"));
Object[] results = client.invoke("dataTransmit", new Object[]{ "123" });
cxf客户端调用写法:
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("http://192.168.0.x:xxxx/cemabenteng/Services/ProBaseDataTransmit?wsdl");
Object[] res = client.invoke("dataTransmit", "0");
xfire客户端调用cxf服务端时如果遇到无法传递参数时,需在cxf端得接口加上注解:
void dataTransmit(@WebParam(name="sbdProData",targetNamespace="http://www.cemabenteng.webapp.webservice/" ) String sbdProData);
2016-9-19
两端包名不一致时,需要加上命名空间的配置:
@WebService(targetNamespace = "http://webservice.webapp.cemabenteng.www/")
后续再补充。