zoukankan      html  css  js  c++  java
  • webService

    第一步:使用第三方调用WebService

    第二步:调用wsimport命令,导入webService

     

     

    将导入的文件复制到MyEcliprice项目文件中

    使用@WebService注解

    package Test;
    
    import javax.jws.WebService;
    import javax.xml.ws.Endpoint;
    //局域网任何人都可以访问access
    @WebService
    public class HelloService {
     public void say(String name){
         System.out.println("Hello"+name);
     }
    public static void main(String[] args) {
        Endpoint.publish("http://192.168.15.81:50000/hello", new HelloService());
        System.out.println("server is listening...");
    }
    }

     

    新建测试类

    package MyTest;
    
    import test.HelloService;
    import test.HelloServiceService;
    
    
    
    public class mytest {
        public static void main(String[] args) {
            HelloServiceService hs=new HelloServiceService();
            HelloService helloServicePort = hs.getHelloServicePort();
            helloServicePort.say("李泽阳");
        }
    }
  • 相关阅读:
    LA 3882
    Codeforces 161D
    spoj PARTIT
    uva 10496 Collecting Beepers
    uva 10130 SuperSale
    spoj 3885
    NWERC 2012 Problem I Idol
    NWERC 2012 Problem E Edge Case
    【USACO 1.3.2】修理牛棚
    【USACO 1.3.1】混合牛奶
  • 原文地址:https://www.cnblogs.com/lizeyang/p/6193114.html
Copyright © 2011-2022 走看看