用WSIF框架调用服务,出现了对象序列化的问题.该怎么解决?
解决方案 »
- 关于LINUX下限制连接的问题
- 急!commons-fileupload上传文件找不到DeferredFileOutputStream类问题!
- 请教高手那里有websphere现在
- mina接收数据失败
- Struts2 中想要 property 标签中嵌入property标签
- jsp页面传值对象为空,求解?
- Spring能否直接注入无接口具体类
- 200分,全部家产]用JSP如何控制扫描仪,而且把扫描仪扫描的图片传给jsp,jsp进行处理,最好给个例子,先谢了!急等
- JB7+WebLogic 8.1 在build时出现两个warning,请问该怎么解决?
- JDBC连接ACCESS数据查询问题。
- 咨询一种开发模式是否可行?
- jsp 如何在页面加载之后触发一个事件,类似filter在页面加载前触发doFilter方法
public static void main(String arg[]) {
try {
String url = "http://www.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl";
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
// AuthenticatingProxyWSDLLocatorImpl awsli=new
// AuthenticatingProxyWSDLLocatorImpl(url,"gaolong1","19831001");
WSIFService service = factory.getService(url,
"http://WebXml.com.cn/",
"DomesticAirline",
"http://WebXml.com.cn/", "DomesticAirlineSoap");
// 其参数分别代表:WSDL地址参数,Service命名空间参数,WSDL文档中Service名称参数,WSDL文档中的portType命名空间参数,WSDL文档中的portType名称参数
WSIFPort port = service.getPort();
WSIFOperation operation = port.createOperation("getDomesticAirlinesTime",
"getDomesticAirlinesTimeSoapIn", "getDomesticAirlinesTimeSoapOut");
// 根据给定的操作名称参数operationName,输入元素名称inputName,输出元素名称outputName.
WSIFMessage input = operation.createInputMessage();
// String startCity = "长沙";
// String lastCity = "上海";
// String date = "";
// String userId = "";
GetDomesticAirlinesTime inputParam = new GetDomesticAirlinesTime("长沙","上海","","");
input.setObjectPart("parameters", inputParam);
// input.setObjectPart("lastCity", lastCity);
// input.setObjectPart("theDate", date);
// input.setObjectPart("userID", userId);
// 设置soap消息中part的表现内容
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
operation.executeRequestResponseOperation(input, output, fault);
String Info = (String) output.getObjectPart("Return"); // 执行请求和接受响应消息的方法,第一个组作为输入的input消息被发送到服务器端,第二个代表输入响应的信息会在执行后包含着返回的消息,第三个消息用来封装错误和状态消息。
System.out.println(Info);// 获得这个soap消息的表现内容
} catch (WSIFException we) {
we.printStackTrace();
}
}
}
public static void main(String arg[]) {
try {
String url = "http://www.webxml.com.cn/webservices/DomesticAirline.asmx?wsdl";
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
// AuthenticatingProxyWSDLLocatorImpl awsli=new
// AuthenticatingProxyWSDLLocatorImpl(url,"gaolong1","19831001");
WSIFService service = factory.getService(url,
"http://WebXml.com.cn/",
"DomesticAirline",
"http://WebXml.com.cn/", "DomesticAirlineSoap");
// 其参数分别代表:WSDL地址参数,Service命名空间参数,WSDL文档中Service名称参数,WSDL文档中的portType命名空间参数,WSDL文档中的portType名称参数
WSIFPort port = service.getPort();
WSIFOperation operation = port.createOperation("getDomesticAirlinesTime",
"getDomesticAirlinesTimeSoapIn", "getDomesticAirlinesTimeSoapOut");
// 根据给定的操作名称参数operationName,输入元素名称inputName,输出元素名称outputName.
WSIFMessage input = operation.createInputMessage();
// String startCity = "长沙";
// String lastCity = "上海";
// String date = "";
// String userId = "";
GetDomesticAirlinesTime inputParam = new GetDomesticAirlinesTime("长沙","上海","","");
input.setObjectPart("parameters", inputParam);
// input.setObjectPart("lastCity", lastCity);
// input.setObjectPart("theDate", date);
// input.setObjectPart("userID", userId);
// 设置soap消息中part的表现内容
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
operation.executeRequestResponseOperation(input, output, fault);
String Info = (String) output.getObjectPart("Return"); // 执行请求和接受响应消息的方法,第一个组作为输入的input消息被发送到服务器端,第二个代表输入响应的信息会在执行后包含着返回的消息,第三个消息用来封装错误和状态消息。
System.out.println(Info);// 获得这个soap消息的表现内容
} catch (WSIFException we) {
we.printStackTrace();
}
}
}