【WebService学习过程记录(四)】xfire开发webservice客户端
来源:互联网 发布:网络主播涉黄视频 编辑:程序博客网 时间:2024/04/29 23:25
- import testdemo.rwq.com.helloservice.HelloServiceClient;
- import testdemo.rwq.com.helloservice.HelloServicePortType;
-
- public class HelloTest {
-
-
-
-
-
- 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));
- }
- }
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)); }}