加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

webservice6

发布时间:2020-12-16 23:03:03 所属栏目:安全 来源:网络整理
导读:如何 使用注解方式形成wsdl package cn.itcast.service; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.ws.Endpoint; @WebService(targetNamespace="http://www.itca

如何 使用注解方式形成wsdl


package cn.itcast.service; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.ws.Endpoint; @WebService(targetNamespace="http://www.itcast.cn",serviceName="MyService") public class HelloService { //不想让外界调用 @WebMethod(exclude=true) public String ?sayHello(String name){ System.out.print("say hello called......"); return "hello"+name; } ///为了更好说明参数信息 @WebMethod(operationName="hello") @WebResult(name="ret") public String ?sayHello(@WebParam(name="name")String name,@WebParam(name="age")int age){ System.out.print("say hello called.....int."); return "hello"+name+age; } public static void main(String[]args){ Endpoint.publish("http://localhost:5084/hello",new HelloService()); } }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读