建立Java Project访问远程Web Service的步骤是什么啊 如何建立Java Project访问远程Web Service的哦?步骤是什么哦? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 谁能说说访问远程Web Service的步骤啊,或者是给个例子也行啊 谢谢咯 我是写WEB SERVICES的 JAVA访问WEB SERVICES这么写吧class TestWebService { static void test(String module,String content) { long s = System.currentTimeMillis(); try { String endpoint = "http://localhost:8080/XX/services/WebServicesCenter?wsdl"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(endpoint); QName qName = new QName("http://webservice.aa.xx.com", "callWebService"); call.setOperationName(qName); call.addParameter("module", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.addParameter("content", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING); call.setUseSOAPAction(true); call.setSOAPActionURI("http://localhost:8080/XX/callWebService"); String result = (String)call.invoke(new Object[]{module,content}); System.out.println(function + " result is "+result); System.out.println(System.currentTimeMillis()-s+"MS"); } catch (Exception e) { System.err.println(e.toString()); } }再一个方法调用这个类的这个方法就行了 你到goolge上搜一下,应该有很多呀。 MyEclipse提供的客户端不太好用哦 老是提示错误 (⊙o⊙) RMI???Remote Method Invocation远程对象方法调用?? 新手关于system.in的问题 如何用myeclips来画界面 tuxedo报错 哪位可以帮助解决下 谢谢 “找不到符号”? 小声的问个关于JAVA很弱的问题 jmf问题! 很初级的问题请各位牛刀小试,谢谢! java判断字符串 多达300本的经典书籍,都可以下(绝对经典) 请问:使用TYPE_SCROLL_SENSITIVE等游标的格式是怎样的?? 内部类好绕 逐渐怀疑自己的智商 控制台下输入无效啊
JAVA访问WEB SERVICES这么写吧
class TestWebService { static void test(String module,String content) {
long s = System.currentTimeMillis();
try {
String endpoint = "http://localhost:8080/XX/services/WebServicesCenter?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(endpoint);
QName qName = new QName("http://webservice.aa.xx.com",
"callWebService");
call.setOperationName(qName);
call.addParameter("module",
org.apache.axis.encoding.XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
call.addParameter("content",
org.apache.axis.encoding.XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://localhost:8080/XX/callWebService");
String result = (String)call.invoke(new Object[]{module,content});
System.out.println(function + " result is "+result);
System.out.println(System.currentTimeMillis()-s+"MS");
}
catch (Exception e) {
System.err.println(e.toString());
}
}
再一个方法调用这个类的这个方法就行了