webService java 求解,急
我在弄一个webservices客户端。通过wsdl生成JAVA文件,之后访问服务端,还需要传URL过去吗?
CSB_Through_Service_ServiceLocator css = new CSB_Through_Service_ServiceLocator();
URL u = new URL("http://10.7.69.202:80/CSB/Services/CSB_through_SMS_Service");
CSB_Through_ServiceBindingStub csportType =(CSB_Through_ServiceBindingStub) css.getCSB_Through_ServicePort();
//CSB_Through_ServiceBindingStub csportType =(CSB_Through_ServiceBindingStub) css.getCSB_Through_ServicePort(u);
CSBThroughCallRequest request = new CSBThroughCallRequest();
CSBThroughCallResponse csbResponse=csportType.CSBThroughCall(request);
CSBThroughCallData[] data=csbResponse.getData();
要传的参数我就没写了。
我传了url过去,用户调用非授权服务,
不穿的话,报错,java.net.ConnectException: Connection refused: connect
参数很多,我不知道是不是参数不合法,请高手指教,
csportType.setTimeout(10000);
超时也设置了
急,周末要出结果
[最优解释]
我不太清楚你webService用什么发布的 什么插件调用 ,因为我也不是特别熟悉,我自己做webService测试时候写的一个小例子MyEclipce xfire插件发布的一个webservice 客户端调用 如下
public static void main(String[] args) throws MalformedURLException,
Exception {
Client c=new Client(new URL(
"http://localhost:8080/WebServiceServerTest/services/WebServiceTest?wsdl"));
// getDate 为webservice的方法明 ,参数为 String类型
Object[] obj=c.invoke("getDate", new Object[]{"xingxing"});
}