【WebService学习过程记录(四)】xfire开发webservice客户端
- import testdemo.rwq.com.helloservice.HelloServiceClient;
- import testdemo.rwq.com.helloservice.HelloServicePortType;
- public class HelloTest {
- /**
- * 这个方法调用web服务并返回服务执行的结果
- * @param yourName
- * @return
- */
- public static String invokeServiceNow(String yourName)
- {
- HelloServiceClient service=new HelloServiceClient();
- HelloServicePortType port=service.getHelloServiceHttpPort();
- return port.sayHello(yourName);
- }
- public static void main(String[] args) {
- String MyName="zhangsan";
- System.out.println(HelloTest.invokeServiceNow(MyName));
- }
- }