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;
/**
* 将 Java 类标记为实现 Web Service,或者将 Java 接口标记为定义 Web Service 接口
* @author
*
*/
//修改目标空间 ,修改服务名 在wsdl那里的xml文件显示对应的修改信息
@WebService(targetNamespace="http://www.itcast.cn",serviceName="MyService")
public class HelloService {
//修改方法名 返回值的名字
@WebMethod(operationName="hello")
@WebResult(name="ret")
public String sayHello(
//修改参数名字
@WebParam(name="name")
String name,
@WebParam(name="age")
int age){
System.out.println("sayHello called...");
return "hello " + name;
}
//此方法 本系统测试 不对外发布
@WebMethod(exclude=true)
public String sayHello2(String name){
System.out.println("sayHello called...");
return "hello " + name;
} public static void main(String[] args) {
//参数1:绑定服务的地址 参数2:提供服务的实例
Endpoint.publish("http://192.168.1.101:5678/hello", new HelloService());
System.out.println("server ready...");
}
}

WebService注解的更多相关文章

  1. Web Service进阶(四)WebService注解

    @WebService 1.serviceName: 对外发布的服务名,指定 Web Service 的服务名称:wsdl:service.缺省值为 Java 类的简单名称 + Service.(字符 ...

  2. WebService注解总结

    @WebService 1.serviceName: 对外发布的服务名,指定 Web Service 的服务名称:wsdl:service.缺省值为 Java 类的简单名称 + Service.(字符 ...

  3. WebService注解汇总

    Web Service 元数据注释(JSR 181) @WebService 1.serviceName: 对外发布的服务名,指定 Web Service 的服务名称:wsdl:service.缺省值 ...

  4. webservice 注解介绍

    JAX-WS 注释 “基于 XML 的 Web Service 的 Java API”(JAX-WS)通过使用注释来指定与 Web Service 实现相关联的元数据以及简化 Web Service ...

  5. 【转】@javax.ws.rs Webservice注解

    用于webservice. 1.路径 @javax.ws.rs.Path 标识要请求的资源类或资源方法的uri路径. 例,@Path("animal"),表示下一层路径是anima ...

  6. WebService:WebService+Springboot常用注解

    首先推荐webservice文章不错的博主:https://www.iteye.com/blog/yufenfei-1685249 这位博主主要讲了WebService的CXF的jar包运用,很实用 ...

  7. webService

    什么是webService WebService,顾名思义就是基于Web的服务.它使用Web(HTTP)方式,接收和响应外部系统的某种请求.从而实现远程调用.  1:从WebService的工作模式上 ...

  8. Spring WebService入门

    Web service是一个平台独立的,低耦合的,自包含的.基于可编程的web的应用程序,可使用开放的XML(标准通用标记语言下的一个子集)标准来描述.发布.发现.协调和配置这些应用程序,用于开发分布 ...

  9. webService学习之路(二):springMVC集成CXF快速发布webService

    继上一篇webService入门之后,http://www.cnblogs.com/xiaochangwei/p/4969448.html ,现在我将我周六在家研究的结果公布出来 本次集成是基于之前已 ...

随机推荐

  1. Educational Codeforces Round 11 C. Hard Process 二分

    C. Hard Process 题目连接: http://www.codeforces.com/contest/660/problem/C Description You are given an a ...

  2. HDU 5652 India and China Origins 二分+并查集

    India and China Origins 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5652 Description A long time ...

  3. Linux技术进阶示意图

  4. 在iOS 7中使用storyboard(part 1)

    原文:Storyboards Tutorial in iOS 7: Part 1        感谢翻译小组成员heartasice热心翻译.如果您有不错的原创或译文,欢迎提交给我们,更欢迎其他朋友加 ...

  5. External components provide true shutdown for boost converter

    The step-up switching-converter circuit in Figure 1 presents a familiar problem: If you shut down bo ...

  6. Activex 数字签名

    本次使用makecert的命令如下: makecert -sv online.pvk -n "CN=中国在线" -ss My -r -b 01/01/1900 -e 01/01/9 ...

  7. minor gc和full gc

    Minor GC ,Full GC 触发条件 Minor GC触发条件:当Eden区满时,触发Minor GC. Full GC触发条件: (1)调用System.gc时,系统建议执行Full GC, ...

  8. UIButton 设置圆角 边框颜色 点击回调方法

    UIButton *signBtn = [UIButton buttonWithType:UIButtonTypeCustom]; signBtn.frame = CGRectMake(, , , ) ...

  9. Andorid之Annotation框架初使用(五)

    注入res文件夹的资源: @StringRes @EActivity public class MyActivity extends Activity { @StringRes(R.string.he ...

  10. Linux进程间通信:管道,信号量,消息队列,信号,共享内存,套接字

    Linux下的进程通信手段基本上是从UNIX平台上的进程通信手段继承而来的.而对UNIX发展做出重大贡献的两大主力AT&T的贝尔实验室及BSD(加州大学伯克利分校的伯克利软件发布中心)在进程间 ...