请教各位,对方给了一个wsdl文件,但我这边是需要接收对方传来的数据包,想问一下,这样是不是我这边也要部署一个服务端来接收对方传来的数据包?这个webservice要怎么做?
解决方案 »
- 【java执行shell脚本问题,高分请教】
- Struts2+Spring2.5+Hibernate3
- myeclipse5.1+struts1.2+tomcat5.5+ie7,的jsp页面缓存问题!
- JAVA 怎么调用 Web Service 的呀?
- 用struts2+ajax表单提交时,有谁遇到过这个异常?异步提交不需要result
- 关于对象和对象变量的区别
- 有关jboss4.0与sqlserver2000连接池问题!
- 关于weblogic中web.xml的问题
- 运行Apache2,打开浏览器,在地址栏中输入:http://localhost 检验看不到Apache2的欢迎界面?帮忙呀(80分)!!!
- 一个关于EJB的问题(我是初学者)!
- Web Service炒菜级问题(HelloWord)Java语言:过路的奶牛进来啊!!
- 有关webservice地址有效性的验证
客户端类中有一个 以proxy结尾的java文件调用哪个文件中的方法,他们会以xml形式把数据包传给你,你所使用的工具会自己解析,
* 创建日期 2008-10-9
*
* 更改所生成文件模板为
* 窗口 > 首选项 > Java > 代码生成 > 代码和注释
*/
package com;import java.text.ParseException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;import javax.xml.stream.XMLStreamException;import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNode;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;import com.bean.LeavingItem;/**
* @author MARS
*
* 更改所生成类型注释的模板为
* 窗口 > 首选项 > Java > 代码生成 > 代码和注释
*/
public class ReceiveRwmService {
public void GetConnectDate(){
String url = "你们需要连接的地址";
ServiceClient sender;
EndpointReference targetEPR = new EndpointReference(url);
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
try {
sender = new ServiceClient();
sender.setOptions(options);
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement method = fac.createOMElement("调用的接口名", null);
{
OMElement value = fac.createOMElement("参数名", null);
value.addChild(fac.createOMText(value, "参数值"));
method.addChild(value);
}
OMElement result = sender.sendReceive(method);//调用接口返回结果对象
} public static void main(String args[]){
ReceiveRwmService rms = new ReceiveRwmService();
rms.GetConnectDate();
}
}
你是哪个公司的?