xfire1.2X 配置使用SOAP1.2报文 客户端
package readyesb.client;
import java.net.MalformedURLException;
import javax.xml.namespace.QName;
import readyesb.xxxPWD;[来源www.iocblog.net]
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.Soap12Binding;
import org.codehaus.xfire.xmlbeans.XmlBeansServiceFactory;
public class ClientSampleNoWSS ...{
public static void main(String args[]) ...{
String nbr1 = "010";
String nbr2 = "8000";[来源www.iocblog.net]
String nbr3 = "6000";
String passWD = "123456";
String url = "http://localhost:7007/ReadyESB/xxxPWDService";
XmlBeansServiceFactory sf = new XmlBeansServiceFactory();
sf.setStyle("wrapped");
sf.setUse("literal");
Service srvcModel = sf.create(xxxPWD.class);
// srvcModel.setProperty(XmlBeansType.XMLBEANS_NAMESPACE_HACK, "true");
Soap12Binding soap12binding = sf.createSoap12Binding(srvcModel,
new QName("http://interfaces.service.web.readyesb"),
"http://www.w3.org/2003/05/soap/bindings/HTTP/");
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
.newInstance().getXFire());
try ...{
ServPWD srvc = (ServPWD) factory.create(soap12binding, url);
String re = srvc.CheckServPWD(nbr1, nbr2, nbr3, passWD);
System.out.print(re);
} catch (MalformedURLException e) ...{
e.printStackTrace();
}
}
}
文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。