soapconnectionfactory factory = soapconnectionfactory.newinstance(); soapconnection con = factory.createconnection(); soapmessage request = messagefactory.newinstance(soapconstants.soap_1_1_protocol).createmessage(); request.getsoapheader().detachnode(); soapbody body = request.getsoapbody(); soapelement getmessage = body.addchildelement("call", "ns1", asip_ns); getmessage.setencodingstyle(soapconstants.uri_ns_soap_encoding); // 第一个参数 soapelement in0 = getmessage.addchildelement("in0"); in0.addtextnode("predeal"); // 第二个参数 soapelement in1 = getmessage.addchildelement("in1"); in1.addtextnode(message.getbusinessserviceparam()); //第三个参数 soapelement in2 = getmessage.addchildelement("in2"); in2.addtextnode("predeal"); request.writeto(system.out); soapmessage response = con.call(request, "http://172.16.29.212:8000/asip/services/asipservice"); node callresponse = response.getsoapbody().getfirstchild(); node callreturn = callresponse.getfirstchild(); system.out.println("\n响应内容:"+callreturn.gettextcontent());
[] SOAPConnection调用WebService
最新推荐文章于 2022-01-04 15:16:11 发布