webservice--常用注解


定义说明书的显示方法
1.@WebService(serviceName="PojoService", portName="PojoPort", name="PojoPortType", targetNamespace="http//:Pojo")
  serviceName 对应 <service name="PojoService">
  portName 对应 <service>下的 <port name="PojoPort">          
      name 对应 <portType name="PojoPortType">

     targetNamespace 对应 targetNamespace="http//:Pojo"

定义schemaLocation的显示
2.@WebMethod(operationName="queryPojo",exclude=true)
       operationName 接口的方法名
       exclude 用于阻止将某一继承方法公开为web服务,默认为false

3.@WebResult(name="returnWord") 接口的返回值

4.@WebParam(name="cityName")接口的参数

 

以下面代码为例

@WebService(serviceName="PojoService",
            portName="PojoPort",
            name="PojoPortType",
            targetNamespace="http//:Pojo"
        )

public class Impl implements WeatherInterface {

    @WebMethod(operationName="queryPojo",exclude=true)
    @Override
    public @WebResult(name="result")List<Pojo> queryWeather(@WebParam(name="cityName")String cityName) {
        

wsdl对应的显示如下:

输入下图地址:

对应的的显示如下:


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM