JAVA 调用别人的webservice出问题了!高手速度!!!!!!!!!!!!!!

2024-11-06 22:30:08
推荐回答(4个)
回答1:

你的代码我没看懂,好象是少了什么东西:

/**
* 调用省调的WebService解析E文件入库
*
* @param fileName
* 需解析的E文件,如:"日购网电量上报_西安局_2008-03-07.YB"
* @param type
* 需解析的E文件的报表类型,如:购网电量:"PGP", 负荷预测:"LOAD_FORECAST"
* ;实际负荷:"LOAD_FACT";
* @return
*/
webServicePoint = ude.getDicValue("webservicepoint");
webServiceName = ude.getDicValue("webservicename");
public boolean callWebService(String fileName, String type) {
Service service = null;
Call call;
String[] return_value=null;
try {
service = new Service();

call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(webServicePoint));

call.setOperationName(webServiceName);

call.addParameter("in0", XMLType.XSD_STRING, ParameterMode.IN);

call.addParameter("in1", XMLType.XSD_STRING, ParameterMode.IN);

call.setReturnType(XMLType.XSD_ANY);

String[] strs = new String[] { ftpPath+fileName, type };

return_value = (String[]) call.invoke(strs);

} catch (ServiceException se) {
se.printStackTrace();
} catch (MalformedURLException urle) {
urle.printStackTrace();
} catch (RemoteException re) {
re.printStackTrace();
}
if(return_value==null){
System.out.println("WebService返回NULL");
return false;
}else{
for(int i=0;i System.out.println("WebService返回"+return_value[i]);
}
return (return_value[0].equals("true"))?true:false;
}
}

回答2:

大哥 你啥异常啊 ~~~

回答3:

架子文件的代码和clent的调用代码呢?

回答4:

tomcat?