同样,这里是使用Maven及Java8

同样Maven添加如下依赖:

        <dependency><groupId>wsdl4j</groupId><artifactId>wsdl4j</artifactId><version>1.6.1</version></dependency><dependency><groupId>org.springframework.ws</groupId><artifactId>spring-ws-core</artifactId><version>3.0.8.RELEASE</version></dependency>

添加plugin用于把wsdl生成为pojo类:

            <plugin><groupId>org.jvnet.jaxb2.maven2</groupId><artifactId>maven-jaxb2-plugin</artifactId><version>0.14.0</version><executions><execution><goals><goal>generate</goal></goals></execution></executions><configuration><schemaLanguage>WSDL</schemaLanguage><generatePackage>com.example.demo.wsdl</generatePackage><schemas><schema><url>http://127.0.0.1:8080/ws/countries.wsdl</url></schema></schemas></configuration></plugin>

这里的url指向wsdl的地址。

generatePackage为target生成的地方。

会进行自动生成:

下面说明下这个类!

CountryClient.java:创建Web Service服务端需要extend的WebServiceGateWaySupport。

CountryConfiguration.java:配置Country。

DemoApplication.java

@SpringBootApplication
public class DemoApplication {public static void main(String[] args) {SpringApplication.run(DemoApplication.class, args);}@BeanCommandLineRunner lookup(CountryClient quoteClient) {return args -> {String country = "Spain";if (args.length > 0) {country = args[0];}GetCountryResponse response = quoteClient.getCountry(country);System.err.println(response.getCountry().getCapital());};}}

程序运行截图如下:

源码打包下载地址:

https://github.com/fengfanchen/Java/tree/master/SOAPWebConsume

Spring Boot文档阅读笔记-构建SOAP的web Service Client相关推荐

  1. Spring Boot文档阅读笔记-构建SOAP的web Service服务

    这里使用的Maven,Java 8来操作的. Maven相关代码为: <dependencies><dependency><groupId>org.springfr ...

  2. Spring Boot文档阅读笔记-构建Restful风格的WebService客户端

    对应的maven如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns=" ...

  3. Spring Boot文档阅读笔记-构建Restful风格的WebService

    Maven代码如下: <?xml version="1.0" encoding="UTF-8"?> <project xmlns=" ...

  4. Spring Boot文档阅读笔记-对Securing a Web Application解析

    首先创建一个非安全的Web应用 这个应用包含两个页面,一个是home页面,一个是"Hello,World"页面.home页面使用Thymeleaf,相关代码如下: <!DOC ...

  5. Spring Boot文档阅读笔记-how-to-implement-2-way-ssl-using-spring-boot

    two-way-ssl需要12次握手(除去TCP的三次握手),如下图: 双向认证过程: 1.客户端发送ClientHello消息,告诉服务端要使用SSL. 2.客户端发送ServerHello的响应, ...

  6. Spring Boot文档阅读笔记-EhCache的使用

    这里要先注意2个概念: buffer和cache,很多人会讲这两个概念混用.但其实这是两个概念! buffer:一般是指存储临时数据的实体.只能读写一次,对于程序员来说buffer是可见的,比如TCB ...

  7. Spring Boot文档阅读笔记-Spring Boot @Bean解析

    利用SpringBoot的@Bean创建一个简单的Bean. Spring的@Bean注解是放在方法上的,带上这个注解的方法会被Spring容器管理.并且这个方法要返回一个值(对象),这个值和对象会被 ...

  8. Spring Boot文档阅读笔记-对Messaging with RabbitMQ解析

    此篇教程以Rabbitmq作为消息队列服务端,使用Spring Boot产生和发布消息. 使用Spring AMQP的RabbitTemplate发布消息,使用MessageListenerAdapt ...

  9. Spring Boot文档阅读笔记-@SpringBootApplication官方解析与实例(1.5.19)

    目录 官方解析 博主例子 官方解析 @SpringBootApplication有如下3个特点: 1. @EnableAutoConfiguration: 能够启动Spring Boot的自动配置机制 ...

最新文章

  1. include与jsp:include区别【转载】
  2. matlab 图论工具箱
  3. 解析网站发布系统利用ASP生成静态页面的方法
  4. sqlachemy入门基础手册
  5. app 侧边栏 html,响应式手机App样式隐藏侧边栏特效插件
  6. IHttphandler之“验证码”服务器控件
  7. 219.存在重复元素II
  8. 微星z370安装linux系统,微星z370主板装win7及BIOS设置详细教程
  9. 为什么说10月24日是程序员的节日?
  10. PNG图片怎么转成ICO?分享两种思路
  11. 从315晚会曝光网秦谈企业社会责任
  12. 关于“小于/等于/大于”的英文缩写
  13. Libev documentation
  14. 2021广东高考成绩位次排名查询,广东高考排名对应大学-广东高考位次查询(2021年文科参考)...
  15. 冰蝎的前世今生:3.0新版本下的一些防护思考
  16. 香蕉派,修改 uboot 和 kernel 串口波特率
  17. PTA判断题总结(1)
  18. 19 kafka消息队列
  19. 通俗易懂谈上拉电阻与下拉电阻
  20. Javaweb之JSTL

热门文章

  1. 配置spring事务管理的几种方式(声明式事务)
  2. ​win7下安装sourcetree
  3. 使用 Azure Site Recovery 灾难恢复至 Azure 的功能现已正式发布
  4. jQuery Unveil – 另一款非常轻量的延迟加载插件
  5. 编程行业高手级别必学C语言,要挣大钱必学C语言,要做黑客、红客必学C语言,要面试名企、外企、高薪职位必学C语言。
  6. 腾讯:中小企业数字化转型路径报告|附PDF下载
  7. 人工智能如何有效地运用于自然语言处理
  8. 苹果员工出逃现象严重:人才挽留成大难题
  9. 济南昊锐科技谈程序员与用户UI
  10. C++学习攻略,怎样学好C++语言?