XFire 使用Ant脚本生成客户端

参照 XFire开发指南.pdf 第10页中的ant脚本生成客户端

 

wsdl="Hello.wsdl" 编译时候出现异常

BUILD FAILED
D:\workspace\Soket\X2Client\build.xml:46: javax.wsdl.WSDLException: 
WSDLException: faultCode=PARSER_ERROR: 
Problem parsing 'file:/D:/workspace/Soket/X2Client/Hello.wsdl'.: 
org.xml.sax.SAXParseException: Content is not allowed in prolog.
 

换成  wsdl="http://127.0.0.1:8080/X/services/HelloService?wsdl"


生成客户端后调用代码

 

 

 

        HelloServiceClient client = new HelloServiceClient();
        HelloServicePortType service = client.getHelloServiceHttpPort();
        System.out.println(service.getHello());
 

你可能感兴趣的:(xml,ant,脚本)