站点工具


服务器技术:java:spring_boot整合spring-ws调用web_service服务

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
服务器技术:java:spring_boot整合spring-ws调用web_service服务 [2018/06/22 15:42]
admin 创建
服务器技术:java:spring_boot整合spring-ws调用web_service服务 [2018/09/10 18:02] (当前版本)
行 1: 行 1:
 <h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​前言https://​blog.csdn.net/​dbeautifulLife/​article/​details/​78326662</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​前面我们已经整合<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​spring-ws</​code>​实现了web service的服务端:<​a href="​http://​www.dexcoder.com/​selfly/​article/​4594"​ style="​background-color:​transparent;​color:​rgb(51,​122,​183);​text-decoration:​none;"​ target="​_blank">​Spring <h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​前言https://​blog.csdn.net/​dbeautifulLife/​article/​details/​78326662</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​前面我们已经整合<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​spring-ws</​code>​实现了web service的服务端:<​a href="​http://​www.dexcoder.com/​selfly/​article/​4594"​ style="​background-color:​transparent;​color:​rgb(51,​122,​183);​text-decoration:​none;"​ target="​_blank">​Spring
- ​Boot整合spring-ws开发web service</​a></​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​接下来就是实现客户端进行调用了。</​p><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​添加依赖</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​客户端,同样的需要先添加依赖:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​org.springframework.boot</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​spring-boot-starter-ws</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​wsdl4j</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​wsdl4j</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​dependency&​gt;</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​获取wsdl文件</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​服务端由一个xsd文件开始,客户端则是由一个wsdl文件开始。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​获取wsdl文件也十分简单,用浏览器访问web service地址,然后另存为即可。当然也可以直接用url地址来生成代码,只不过我习惯本地另存为后再生成。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​完整的wsdl文件内容如下:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​definitions</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​wsdl</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​wsdl/&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​sch</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​soap</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​wsdl/​soap/&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​tns</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​targetNamespace</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​types&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​schema</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​xs</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.w3.org/​2001/​XMLSchema&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​elementFormDefault</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​qualified&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​targetNamespace</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​name&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​element&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​country&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​country&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​element&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​country&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​name&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​population&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​int&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​capital&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​currency&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​currency&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​simpleType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​currency&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​restriction</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​base</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​GBP&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​EUR&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​PLN&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​restriction&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​simpleType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​types&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​message</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​part</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​element</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryResponse&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​part&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​message&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​message</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​part</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​element</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryRequest&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​part&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​message&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​portType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPort&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountry&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​input</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​message</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryRequest&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​input&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​output</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​message</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryResponse&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​output&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​operation&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​portType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​binding</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortSoap11&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​CountriesPort&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​binding</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​style</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​document</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​transport</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​soap/​http&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountry&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​soapAction</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​input</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​body</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​use</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​literal&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​input&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​output</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​body</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​use</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​literal&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​output&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​operation&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​binding&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​service</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortService&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​port</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​binding</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​CountriesPortSoap11&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortSoap11&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​address/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​port&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​service&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​definitions&​gt;</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​添加maven的jaxb2插件生成代码</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​跟服务端根据xsd来生成代码类似,客户端同样可以根据wsdl来生成代码。maven插件依赖:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​plugin&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​org.jvnet.jaxb2.maven2</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​maven-jaxb2-plugin</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​version&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​0.12.3</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​version&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​executions&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​execution&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​goals&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​goal&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​generate</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​goal&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​goals&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​execution&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​executions&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​configuration&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schemaLanguage&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​WSDL</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schemaLanguage&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​generatePackage&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​com.dexcoder.ws</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​generatePackage&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​generateDirectory&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​${basedir}/​src/​main/​java</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​generateDirectory&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schemas&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​fileset&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaDirectory. --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​directory&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​${basedir}/​src/​main/​resources/​schemas</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​directory&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaIncludes. --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​includes&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​include&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​*.wsdl</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​include&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​includes&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaIncludes --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​excludes&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​exclude&​gt;​*.xs&​lt;/​exclude&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;/​excludes&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​fileset&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​url&​gt;​http://​localhost:​8080/​ws/​countries.wsdl&​lt;/​url&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schemas&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​configuration&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​plugin&​gt;</​span></​code></​p></​li></​ol><​p style="​margin-top:​0px;​margin-bottom:​10px;">​同样mvn install之后将生成客户端代码。这里生成的代码跟我们前面发布的服务端代码应该是一样的,当然包名可能不同这个由你指定。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​在生成代码的同时会生成<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​META-INF</​code>​文件夹,这个可以移到resources目录下或者直接删除都没有关系。生成后的项目结构图:</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;"><​img src="​http://​static.dexcoder.com/​images/​201621/​1jC3cCdJOvGLwbGd.png"​ alt="​项目结构"​ title="​项目结构图"/></​p><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​编写ws客户端</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​生成了代码之后,编写客户端变的很容易,具体代码如下:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​extends</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WebServiceGatewaySupport</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​String</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryRequest</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ request </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryRequest</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​request</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setName</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ getWebServiceTemplate</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​().</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshalSendAndReceive</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​localhost:​8080/​ws/​countries.wsdl&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">,</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ request</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​配置ws客户端</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​编写完一切代码之后,同样需要配置到spring boot才行,<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​ContextPath</​code>​指定刚才生成代码所在的包名,它会到该包下去寻找相应的类自动进行数据转换:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Configuration</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WSConfig</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Bean</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​()</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setContextPath</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​com.dexcoder.ws&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Bean</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ client </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setDefaultUri</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​localhost:​8080/​ws/​countries.wsdl&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setMarshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setUnmarshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;"​><​a></​a>​运行</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​到这里所有的调用代码都已经完成了,剩下的就是运行来检测是否调用成功。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​这里我们来编写一个<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​Controller</​code>​来简单测试一下。</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@RestController</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​IndexController</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Autowired</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​private</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@RequestMapping</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​callws&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Object</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ callWs</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​()</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​hello&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​p style="​margin-top:​0px;​margin-bottom:​10px;">​使用了<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​RestController</​code>​,直接将调用ws返回的数据用json格式输出到页面。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​启动spring boot,访问http://​localhost:​8081/​callws 这里把端口换成了8081,因为默认的8080已经被前面的服务端占用了。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​可以看到成功调用了ws的服务端并返回了数据,hello部分为我们发送过去的参数:</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;"><​img src="​http://​static.dexcoder.com/​images/​201621/​R6QRSKr2JKe0XFWX.png"​ alt="​ws客户端返回数据"​ title="​ws客户端返回数据"/></​p><​p><​br/></​p>​+ ​Boot整合spring-ws开发web service</​a></​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​接下来就是实现客户端进行调用了。</​p><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​添加依赖</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​客户端,同样的需要先添加依赖:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​org.springframework.boot</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​spring-boot-starter-ws</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​dependency&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​wsdl4j</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​wsdl4j</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​dependency&​gt;</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​获取wsdl文件</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​服务端由一个xsd文件开始,客户端则是由一个wsdl文件开始。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​获取wsdl文件也十分简单,用浏览器访问web service地址,然后另存为即可。当然也可以直接用url地址来生成代码,只不过我习惯本地另存为后再生成。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​完整的wsdl文件内容如下:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​definitions</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​wsdl</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​wsdl/&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​sch</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​soap</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​wsdl/​soap/&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​tns</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​targetNamespace</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​types&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​schema</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​atn"​ style="​color:#​008080;">​xmlns:​xs</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.w3.org/​2001/​XMLSchema&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​elementFormDefault</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​qualified&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​targetNamespace</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​www.dexcoder.com/​ws&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​name&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​element&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​country&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​country&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​element&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​complexType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​country&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​name&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​population&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​int&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​capital&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​element</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​currency&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​currency&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​sequence&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​complexType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​simpleType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​currency&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​restriction</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​base</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​xs:​string&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​GBP&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​EUR&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​xs:​enumeration</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​value</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​PLN&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​restriction&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​simpleType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​xs:​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​types&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​message</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​part</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​element</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryResponse&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​part&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​message&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​message</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​part</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​element</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryRequest&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​part&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​message&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​portType</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPort&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountry&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​input</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​message</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryRequest&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​input&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​output</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​message</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​getCountryResponse&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;&​lt;/​wsdl:​output&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​operation&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​portType&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​binding</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortSoap11&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​type</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​CountriesPort&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​binding</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​style</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​document</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​transport</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​schemas.xmlsoap.org/​soap/​http&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountry&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​operation</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​soapAction</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​input</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryRequest&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​body</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​use</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​literal&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​input&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​output</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​getCountryResponse&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​body</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​use</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​literal&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​output&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​operation&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​binding&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​service</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortService&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​wsdl:​port</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​binding</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​tns:​CountriesPortSoap11&​quot;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​atn"​ style="​color:#​008080;">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​atv"​ style="​color:​rgb(221,​17,​68);">&​quot;​CountriesPortSoap11&​quot;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​soap:​address/&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​port&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​service&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​wsdl:​definitions&​gt;</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​添加maven的jaxb2插件生成代码</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​跟服务端根据xsd来生成代码类似,客户端同样可以根据wsdl来生成代码。maven插件依赖:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​plugin&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​groupId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​org.jvnet.jaxb2.maven2</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​groupId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​artifactId&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​maven-jaxb2-plugin</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​artifactId&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​version&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​0.12.3</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​version&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​executions&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​execution&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​goals&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​goal&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​generate</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​goal&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​goals&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​execution&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​executions&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​configuration&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schemaLanguage&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​WSDL</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schemaLanguage&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​generatePackage&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​com.dexcoder.ws</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​generatePackage&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​generateDirectory&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​${basedir}/​src/​main/​java</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​generateDirectory&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schemas&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​fileset&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaDirectory. --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​directory&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​${basedir}/​src/​main/​resources/​schemas</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​directory&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaIncludes. --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​includes&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;​include&​gt;</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​*.wsdl</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​include&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​includes&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!-- Defaults to schemaIncludes --&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​excludes&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​exclude&​gt;​*.xs&​lt;/​exclude&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;/​excludes&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​fileset&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​com"​ style="​color:​rgb(147,​161,​161);">&​lt;​!--&​lt;​url&​gt;​http://​localhost:​8080/​ws/​countries.wsdl&​lt;/​url&​gt;​--&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schema&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​schemas&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​configuration&​gt;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​tag"​ style="​color:​rgb(0,​0,​136);">&​lt;/​plugin&​gt;</​span></​code></​p></​li></​ol><​p style="​margin-top:​0px;​margin-bottom:​10px;">​同样mvn install之后将生成客户端代码。这里生成的代码跟我们前面发布的服务端代码应该是一样的,当然包名可能不同这个由你指定。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​在生成代码的同时会生成<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​META-INF</​code>​文件夹,这个可以移到resources目录下或者直接删除都没有关系。生成后的项目结构图:</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;"><​img src="​http://​static.dexcoder.com/​images/​201621/​1jC3cCdJOvGLwbGd.png"​ alt="​项目结构"​ title="​项目结构图"/></​p><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​编写ws客户端</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​生成了代码之后,编写客户端变的很容易,具体代码如下:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​extends</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WebServiceGatewaySupport</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​String</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryRequest</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ request </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryRequest</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​request</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setName</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​name</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ getWebServiceTemplate</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​().</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshalSendAndReceive</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​localhost:​8080/​ws/​countries.wsdl&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">,</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ request</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​配置ws客户端</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​编写完一切代码之后,同样需要配置到spring boot才行,<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​ContextPath</​code>​指定刚才生成代码所在的包名,它会到该包下去寻找相应的类自动进行数据转换:</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Configuration</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WSConfig</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Bean</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​()</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setContextPath</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​com.dexcoder.ws&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Bean</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​typ"​ style="​color:#​008080;">​Jaxb2Marshaller</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ client </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​new</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setDefaultUri</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​http://​localhost:​8080/​ws/​countries.wsdl&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setMarshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;​client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​setUnmarshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​marshaller</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ client</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​h2 style="​font-family:​inherit;​font-weight:​500;​line-height:​1.2;​color:​rgb(0,​0,​0);​margin-top:​20px;​margin-bottom:​15px;​font-size:​20px;">​运行</​h2><​p style="​margin-top:​0px;​margin-bottom:​10px;">​到这里所有的调用代码都已经完成了,剩下的就是运行来检测是否调用成功。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​这里我们来编写一个<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​Controller</​code>​来简单测试一下。</​p><​ol class="​linenums list-paddingleft-2"​ style="​margin:​0px;​color:​rgb(30,​52,​123);"><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@RestController</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​class</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​IndexController</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@Autowired</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​private</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​WsClient</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">;</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"></​code><​br/></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​lit"​ style="​color:​rgb(25,​95,​145);">​@RequestMapping</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​callws&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​)</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​public</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​typ"​ style="​color:#​008080;">​Object</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ callWs</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​()</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​{</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​typ"​ style="​color:#​008080;">​GetCountryResponse</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response </​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​=</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ wsClient</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​(</​span><​span class="​str"​ style="​color:​rgb(221,​17,​68);">&​quot;​hello&​quot;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​);</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &nbsp; &nbsp; &​nbsp;</​span><​span class="​kwd"​ style="​color:​rgb(30,​52,​123);">​return</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ response</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​.</​span><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​getCountry</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​();</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pln"​ style="​color:​rgb(72,​72,​76);">​ &nbsp; &​nbsp;</​span><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li><​li><​p><​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​padding:​0px;​color:​inherit;​background-color:​transparent;​white-space:​pre-wrap;"><​span class="​pun"​ style="​color:​rgb(147,​161,​161);">​}</​span></​code></​p></​li></​ol><​p style="​margin-top:​0px;​margin-bottom:​10px;">​使用了<​code style="​font-family:​Menlo,​ Monaco, Consolas, &#​39;​Courier New&#​39;,​ monospace;​font-size:​12.6px;​padding:​2px 4px;​color:​rgb(199,​37,​78);​background-color:​rgb(249,​242,​244);">​RestController</​code>​,直接将调用ws返回的数据用json格式输出到页面。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​启动spring boot,访问http://​localhost:​8081/​callws 这里把端口换成了8081,因为默认的8080已经被前面的服务端占用了。</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;">​可以看到成功调用了ws的服务端并返回了数据,hello部分为我们发送过去的参数:</​p><​p style="​margin-top:​0px;​margin-bottom:​10px;"><​img src="​http://​static.dexcoder.com/​images/​201621/​R6QRSKr2JKe0XFWX.png"​ alt="​ws客户端返回数据"​ title="​ws客户端返回数据"/></​p><​p><​br/></​p>​
服务器技术/java/spring_boot整合spring-ws调用web_service服务.1529653328.txt.gz · 最后更改: 2018/09/10 18:01 (外部编辑)