定義說明書的顯示方法
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對應的顯示如下:
輸入下圖地址:
對應的的顯示如下: