欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

SOAP1.1和SOAP1.2的区别

程序员文章站 2022-06-17 12:51:39
...

1,命名空间的不同: Soap1.1的命名空间: xmlns:soap=“http://schemas.xmlsoap.org/soap/envelope/ “ Soap1.2 命名空间: xmlns:soap=http://www.w3.org/2003/05/soap-envelope“ 2,SOAP1.1版本与SOAP1.2版本在头信息上存在差异。(红色字体部分表示不同

1,命名空间的不同:

Soap1.1的命名空间:
xmlns:soap=“http://schemas.xmlsoap.org/soap/envelope/ “

Soap1.2 命名空间:
xmlns:soap="http://www.w3.org/2003/05/soap-envelope“

2,SOAP1.1版本与SOAP1.2版本在头信息上存在差异。(红色字体部分表示不同之处)

SOAP1.1的HTTP请求头:

POST /xe_cxf2.4_soap12_spring_web/ws/helloworldsoap12?wsdl HTTP/1.1

Content-Type: text/xml; charset=UTF-8

Accept: */*

SOAPAction: ""

User-Agent: Apache CXF 2.4.0

Cache-Control: no-cache

Pragma: no-cache

Host: localhost:6767

Connection: keep-alive

Content-Length: 216

SOAP1.2的HTTP请求头:

POST /xe_cxf2.4_soap12_spring_web/ws/helloworldsoap12?wsdl HTTP/1.1

Content-Type: application/soap+xml; charset=UTF-8

Accept: */*

User-Agent: Apache CXF 2.4.0

Cache-Control: no-cache

Pragma: no-cache

Host: localhost:6767

Connection: keep-alive

Content-Length: 214

3,基于SOAP1.1生成的WSDL和基于SOAP1.2生成的WSDL也不一样:

在定义Service部分差别如下:
Soap1.1是以:soap:address定义。
Soap1.2是以: soap12:address定义。-jdk1.6不支持12形式的访问。

4,在CXF中两种协议请求的方式也不一样:

4.1为content-Type:text/xm;charset=UTF-8
4.2为content-Type:application/soap+xml;charset=UTF-8