【WebService学习过程记录(四)】xfire开发webservice客户端

来源:互联网 发布:网络主播涉黄视频 编辑:程序博客网 时间:2024/04/29 23:25
  1. import testdemo.rwq.com.helloservice.HelloServiceClient;   
  2. import testdemo.rwq.com.helloservice.HelloServicePortType;   
  3.   
  4. public class HelloTest {   
  5.        /**   
  6.          * 这个方法调用web服务并返回服务执行的结果  
  7.          * @param yourName  
  8.          * @return  
  9.          */  
  10.         public static String invokeServiceNow(String yourName)   
  11.         {   
  12.             HelloServiceClient service=new HelloServiceClient();   
  13.             HelloServicePortType port=service.getHelloServiceHttpPort();   
  14.             return port.sayHello(yourName);   
  15.         }   
  16.         
  17.         public static void main(String[] args) {   
  18.             String MyName="zhangsan";   
  19.             System.out.println(HelloTest.invokeServiceNow(MyName));               
  20.         }   
  21. }  


原创粉丝点击