【WSDL】03 使用注解自定义服务信息
对原来的自定义WebService设置注解:
package cn.cloud9.jax_ws.server.intf;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.soap.SOAPBinding; /**
* @author OnCloud9
* @description
* @project WebService
* @date 2022年04月23日 11:10
*
* 标注此接口是Web服务接口
*/
@WebService(
targetNamespace = "http://service.cn.cloud9",
name = "WeatherWS-Soap",
portName = "WeatherWS-Soap-Port",
serviceName = "WeatherWS"
)
@BindingType(SOAPBinding.SOAP12HTTP_BINDING) // 发布 SOAP1。2接口
public class WeatherInterfaceImpl implements WeatherInterface{ @WebMethod(
operationName = "getWeather",
exclude = false
)
@Override
public @WebResult(name = "result") String queryWeather(@WebParam(name = "cityName") String cityName) {
System.out.println("打印城市名称:" + cityName);
return cityName + " 天气:晴朗";
}
}
WSDL信息:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. -->
<!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. -->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://service.cn.cloud9" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.cn.cloud9" name="WeatherWS">
<types>
<xsd:schema>
<xsd:import namespace="http://service.cn.cloud9" schemaLocation="http://127.0.0.1:9090/weather?xsd=1"/>
</xsd:schema>
</types>
<message name="getWeather">
<part name="parameters" element="tns:getWeather"/>
</message>
<message name="getWeatherResponse">
<part name="parameters" element="tns:getWeatherResponse"/>
</message>
<portType name="WeatherWS-Soap">
<operation name="getWeather">
<input wsam:Action="http://service.cn.cloud9/WeatherWS-Soap/getWeatherRequest" message="tns:getWeather"/>
<output wsam:Action="http://service.cn.cloud9/WeatherWS-Soap/getWeatherResponse" message="tns:getWeatherResponse"/>
</operation>
</portType>
<binding name="WeatherWS-Soap-PortBinding" type="tns:WeatherWS-Soap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="getWeather">
<soap12:operation soapAction=""/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
</binding>
<service name="WeatherWS">
<port name="WeatherWS-Soap-Port" binding="tns:WeatherWS-Soap-PortBinding">
<soap12:address location="http://127.0.0.1:9090/weather"/>
</port>
</service>
</definitions>
【WSDL】03 使用注解自定义服务信息的更多相关文章
- SpringCloud系列四:Eureka 服务发现框架(定义 Eureka 服务端、Eureka 服务信息、Eureka 发现管理、Eureka 安全配置、Eureka-HA(高可用) 机制、Eureka 服务打包部署)
1.概念:Eureka 服务发现框架 2.具体内容 对于服务发现框架可以简单的理解为服务的注册以及使用操作步骤,例如:在 ZooKeeper 组件,这个组件里面已经明确的描述了一个服务的注册以及发现操 ...
- PIE SDK加载自定义服务数据
1.功能简介 自定义服务数据,将符合要求的矢量数据和栅格数据集等数据以服务的方式发布,将数据存储在某服务器中,在有网络的情况下可以根据URL就可以访问,比较常见的服务数据类型的有ArcGIS Serv ...
- Java Scala获取所有注解的类信息
要想获取使用指定注解的类信息,可借助工具: org.reflections.Reflections 此工具将Java反射进行了高级封装,Reflections 通过扫描 classpath,索引元数据 ...
- angularJs自定义服务(实现签名和加密)
写在前面: angularJS是google公司主推的js开发优秀框架... 页面展示: 在应用中进行加密是普遍存在的,个人建议在前端实现加密签名(前端加密是否必要来自知乎:http://www.zh ...
- Android系统在新进程中启动自定义服务过程(startService)的原理分析
在编写Android应用程序时,我们一般将一些计算型的逻辑放在一个独立的进程来处理,这样主进程仍然可以流畅地响应界面事件,提高用户体验.Android系统为我们提供了一个Service类,我们可以实现 ...
- SpringBoot自定义错误信息,SpringBoot适配Ajax请求
SpringBoot自定义错误信息,SpringBoot自定义异常处理类, SpringBoot异常结果处理适配页面及Ajax请求, SpringBoot适配Ajax请求 ============== ...
- Android Service总结03 之被启动的服务 -- Started Service
Android Service总结03 之被启动的服务 -- Started Service 版本 版本说明 发布时间 发布人 V1.0 添加了Service的介绍和示例 2013-03-17 Sky ...
- java注解自定义使用
Java提供了4种注解,专门负责新注解的创建: @Target: 表示该注解可以用于什么地方,可能的ElementType参数有:CONSTRUCTOR:构造器的声明FIELD:域声明(包括enum实 ...
- AngularJS内建服务以及自定义服务的用法
在AngularJS中, 服务是一个比较重要的部分,它是一个对象或者是函数,可以在你的AngularJS的应用中使用.接下来介绍几种比较常用的内建服务以及自定义服务的方法. [内建服务] (1)loc ...
- ASP.NET MVC 学习笔记-7.自定义配置信息 ASP.NET MVC 学习笔记-6.异步控制器 ASP.NET MVC 学习笔记-5.Controller与View的数据传递 ASP.NET MVC 学习笔记-4.ASP.NET MVC中Ajax的应用 ASP.NET MVC 学习笔记-3.面向对象设计原则
ASP.NET MVC 学习笔记-7.自定义配置信息 ASP.NET程序中的web.config文件中,在appSettings这个配置节中能够保存一些配置,比如, 1 <appSettin ...
随机推荐
- vue侦听器 - watch
使用watch来侦听data中数据的变化,watch中的属性一定是data 中已经存在的数据. 当需要监听一个对象的改变时,普通的watch方法无法监听到对象内部属性的改变,只有data中的数据才能够 ...
- 像 Google SRE 一样 OnCall
在 Google SRE 的著作<Google运维解密>(原作名:Site Reliability Engineering: How Google Runs Production Syst ...
- 判断是否有数据的sql优化
根据某一条件从数据库表中查询 『有』与『没有』,只有两种状态,那为什么在写SQL的时候,还要SELECT count(*)呢? 多次REVIEW代码时,发现如现现象: 业务代码中,需要根据一个或多个条 ...
- mysql时间字段新增和修改默认时间,删除字段
mysql时间字段新增和修改默认时间,删除字段##新增字段ALTER TABLE tbl_test ADD COLUMN `create_time` DATETIME NULL DEFAULT CUR ...
- Java api zookeeper
package com.redis.demo.zookeeper; import java.io.Serializable; public class User implements Serializ ...
- 原始指针 [raw pointers]
指针是一个变量,用于存储对象的内存地址. 指针广泛应用于 C 和 C++: 在堆上分配新对象 通过参数将某些函数传递给其他函数 迭代/遍历数组或其他数据结构的元素 int* p = nullptr; ...
- windows 安装mysql 非常之详细
安装 1.下载安装包 2.解压包 3.文件夹内创建my.ini配置文件,并添加内容 # For advice on how to change settings please see # http: ...
- TGI 基准测试
本文主要探讨 TGI 的小兄弟 - TGI 基准测试工具.它能帮助我们超越简单的吞吐量指标,对 TGI 进行更全面的性能剖析,以更好地了解如何根据实际需求对服务进行调优并按需作出最佳的权衡及决策.如果 ...
- 实验12.dhcp服务器实验
实验12.dhcp服务器实验 测试DHCP服务的可用性 实验组 交换机配置 R1 interface GigabitEthernet0/0/0 ip address 192.168.1.1 255.2 ...
- 第三方App与Termux命令建立IO通道
目录 前言 一.Android 进程间通信(IPC) 二.Netcat 网络瑞士军刀 三.第三方 App 与 Termux 建立 TCP/Socket 通信 四.应用:调用 LSP 语言服务器 参见 ...