首先访问服务端的wsdl文件,另存为wsdl文件,把它放到项目的根目录下面
然后右键,new->other->webservice client
一路next下去,得到以下文件
ok,然后编写调用代码
package epaylinks.huafei.chongzhi;
import java.rmi.RemoteException;
public class Test2 {
public static void main(String[] args) throws RemoteException {
String reqXml ="<DingdanRequest>"+
"<shanghuhao>PC711</shanghuhao>"+
"<zhongduanhao>43181349</zhongduanhao>"+
"<shoujihao>13710371021</shoujihao>"+
"<dingdanhao>1234567890</dingdanhao>"+
"<jine>30</jine>"+
"<shijian>20120605163415</shijian>"+
"<baoliu1></baoliu1>"+
"<baoliu2></baoliu2>"+
"<qianming>de7f300eab88ca2e89756041f3d317f1</qianming>"+
"</DingdanRequest>";
ChongzhiServiceWrapperProxy proxy = new ChongzhiServiceWrapperProxy();
String endPointAddr="http://14.23.90.100:8081/chongzhi/services/ChongzhiService";
proxy.setEndpoint(endPointAddr);
ChongzhiServiceWrapper wrapper = proxy.getChongzhiServiceWrapper();
String str = wrapper.dingdan(reqXml);
System.out.println("-------");
System.out.println(str);
}
}
大功告告成