怎么用wsdl file解析webservice接口
展开全部
1.用接口工具去测试并传参调用;
2.写应用接口,代码如下:
public static void main(String[] args) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
String wsUrl = "http://zong.bjchyedu.cn/ids/services/account?wsdl"; //wsdl地址
String method = "webservice_method";//webservice的方法名
Client client = dcf.createClient(wsUrl);
Object[] res = null;
try {
res = client.invoke(method);//调用webservice
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("res:"+res[0]);
System.exit(0);
}
2.写应用接口,代码如下:
public static void main(String[] args) {
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
String wsUrl = "http://zong.bjchyedu.cn/ids/services/account?wsdl"; //wsdl地址
String method = "webservice_method";//webservice的方法名
Client client = dcf.createClient(wsUrl);
Object[] res = null;
try {
res = client.invoke(method);//调用webservice
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("res:"+res[0]);
System.exit(0);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询