SOAP BOSS对接功能 wsdl 生成代码简单说明

本文详细解析了bossService的SOAP Web服务定义,包括请求和响应的数据结构、操作定义及绑定信息,展示了如何通过XML Schema定义复杂类型,适用于对SOAP Web服务进行深入理解的技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

完整代码:

https://gitee.com/yizhichao/boss

工具下载:

axis2

https://pan.baidu.com/s/1FlO5wYYTxkfVSI4fHM84rg

8aac30fa1f1dcd9f14a7e6e5a5b09f7d4f6.jpg

bossService.wsdl 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="bossService" targetNamespace="http://allcam.com/bpc/webservice/bossService/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://allcam.com/bpc/webservice/bossService/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <wsdl:types>
    <xsd:schema targetNamespace="http://allcam.com/bpc/webservice/bossService/">
      <xsd:element name="BossRequestDto">
	      <xsd:complexType>
	      	<xsd:sequence>
	      		<xsd:element maxOccurs="1" minOccurs="1" name="oprUserName" type="xsd:string"/>
	      		<xsd:element maxOccurs="1" minOccurs="1" name="oprUserPassword" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="1" name="oprCode" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="0" name="clientHomeCityNo" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="0" name="clientHomeCityName" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="0" name="clientHomeAreaNo" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="0" name="clientHomeAreaName" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="1" name="clientGrpID" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="1" name="clientSubID" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="0" name="clientName" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="1" name="oprEffTime" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="1" name="clientOprMobile" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="0" name="clientOprName" type="xsd:string"/>
				<xsd:element maxOccurs="1" minOccurs="0" name="basicBillSetID" type="xsd:string"/>
	      	</xsd:sequence>
	      </xsd:complexType>
      </xsd:element>
      
      <xsd:element name="BossResponseDto">
      	<xsd:complexType>
	      	<xsd:sequence>
		      	<xsd:element maxOccurs="1" minOccurs="1" name="responseCode" type="xsd:string"/>
		      	<xsd:element maxOccurs="1" minOccurs="1" name="responseDesc" type="xsd:string"/>
	      	</xsd:sequence>
	      </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="HZBServiceMgtAddReq">
    <wsdl:part name="parameters" element="tns:BossRequestDto">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="HZBServiceMgtAddRes">
    <wsdl:part name="parameters" element="tns:BossResponseDto">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="bossService">
    <wsdl:operation name="hzbServiceMgtAdd">
      <wsdl:input message="tns:HZBServiceMgtAddReq">
    </wsdl:input>
      <wsdl:output message="tns:HZBServiceMgtAddRes">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="bossServiceSOAP" type="tns:bossService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="hzbServiceMgtAdd">
      <soap:operation soapAction="http://allcam.com/bpc/webservice/bossService/hzbServiceMgtAdd"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="bossService">
    <wsdl:port name="bossServiceSOAP" binding="tns:bossServiceSOAP">
      <soap:address location="http://172.16.20.111:8080/HZBBOSSServer/services/bossService/"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 

配置环境变量:

fde058c1835e4fb086c15633bf064e146ac.jpg

 

生成服务端:

bff04cfb6dae72bdbb9a9e973807ec50da6.jpg

3efe472b54574031f8de8bd6fee6f32c8c0.jpg

6061f7fd86be84a355c9bd023654c935d76.jpg

b9a934cc7ecf10534ad01ac7ef506f5ac7d.jpg

http://172.16.20.111:8080/HZBBOSSServer/services/bossService?wsdl

85af648674cb45fc366bde808b54831a1ac.jpg

生成客户端

59289378de6378003f137ac5c07886b929a.jpg

97c0bf256849b4db8abffc440bfe0c3f284.jpg

357b2c6bc5830908742442970268a448c7c.jpg

简单实现服务端:

150abdab13516fd2a380157c51c9d41fe8a.jpg

简单实现客户端:

05164288ad52efdf18842edf7c7dfd05c24.jpg

运行客户端结果:

3e1744794a4d6f28a92b92d34a955aa56b9.jpg

 

通过soapUI测试结果截图:

8dbb78f3b38e7e875e072967aabec911651.jpg

转载于:https://my.oschina.net/yizhichao/blog/1920473

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值