博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Transport level information does not match with SOAP Message namespace URI错误的理解
阅读量:6547 次
发布时间:2019-06-24

本文共 4450 字,大约阅读时间需要 14 分钟。

理论知识:

转自:http://wso2.com/library/articles/differentiating-between-soap-versions-looking-soap-message/

Using SOAP NamespaceEvery XML message contains namespaces to properly qualify the entities within it. In SOAP 1.1 and SOAP 1.2 specifications, each had defined its own unique namespaces to define the entities belonging to those specifications.SOAP 1.1 : http://schemas.xmlsoap.org/soap/envelope/SOAP 1.2 : http://www.w3.org/2003/05/soap-envelopeThis is the easiest and sometimes the only method some people use. You can look at the SOAP namespace of a SOAP message and easily determine its version. 
.........
....
SOAP 1.1 messageYou might argue that this is the only method you need to know to differentiate two different SOAP versions. This might not be the case all the time. For example, there can be a situation where you will need to know the SOAP version even before reading the SOAP message itself. Even though the previous statement seems unusual, this is how it is when we have two different object models or two different builders for the two SOAP versions. In such situations, as a developer, you cannot afford to touch the SOAP message to find out the version. Perhaps you can cheat by temporarily recording the first few events or entities, but that might not be the best solution.In the next section, we will use transport binding rules, if available, to differentiate between the two different versions.

 

转自:http://wso2.com/library/559/

A: When Apache Axis2/Java receives a SOAP message, Axis2 tries to determine the SOAP version this message adheres to. This is required for the validation purposes against the correct SOAP specification. Axis2 has two basic mechanisms to identify the SOAP version.1. Checking the namespace of the SOAP envelope. If the namespace is "http://schemas.xmlsoap.org/soap/envelope/", then it is a SOAP 1.1 message, and if the namespace is "http://www.w3.org/2003/05/soap-envelope", then it is a SOAP 1.2 message. 2.If the transport medium is HTTP, Then we check for the existance of SOAPAction HTTP Header. If the message is SOAP 1.1, then there must be a SOAPAction HTTP header. If it is a SOAP 1.2 message, then there may be a SOAPAction parameter inside the Content-type header (this parameter is not mandatory according to SOAP 1.2 specification HTTP binding) When both the above parameters are present, Axis2 compares the outputs from those evaluations. If they do not match, then Axis2 will throw an error saying "Transport level information does not match with SOAP Message namespace URI". So if you encounter this error, check your SOAP message and HTTP headers.Applies To:Apache Axis2/Java v1.0 and higher

 

进一步理论说明:

转自:http://www.herongyang.com/Web-Services/Perl-SOAP-1-2-Request-Differences-SOAP-1-1-and-1-2.html

This section describes differences between a SOAP 1.1 request and SOAP 1.2 request for GetSpeech Web service provided by xmlme.com. Remember that I goal is to use SOAP::Lite to send SOAP 1.2 request to the xmlme.com server.Before writing the client program, let's compare the SOAP 1.1 request with the SOAP 1.2 request provided at: http://www.xmlme.com/WSShakespeare.asmx?op=GetSpeech.SOAP 1.1 request: POST /WSShakespeare.asmx HTTP/1.1Host: www.xmlme.comContent-Type: text/xml; charset=utf-8Content-Length: lengthSOAPAction: "http://xmlme.com/WebServices/GetSpeech"
string
SOAP 1.2 request:POST /WSShakespeare.asmx HTTP/1.1Host: www.xmlme.comContent-Type: application/soap+xml; charset=utf-8Content-Length: length
string
I see 3 differences:SOAP 1.2 uses "application/soap+xml" as Content-Type and SOAP 1.1 uses "text/xml".SOAP 1.2 does not use SOAPAction header line.SOAP 1.2 uses "http://www.w3.org/2003/05/soap-envelope" as the envolope namespace and SOAP 1.1 uses "http://schemas.xmlsoap.org/soap/envelope/".Now I known where to pay attention to generate a correct SOAP 1.2 request.Last update: 2009.

 

关键点:HTTP头信息里的Content-Type一定要和soap信息中的版本标识一致。

3 differences:SOAP 1.2 uses "application/soap+xml" as Content-Type and SOAP 1.1 uses "text/xml".SOAP 1.2 does not use SOAPAction header line.SOAP 1.2 uses "http://www.w3.org/2003/05/soap-envelope" as the envolope namespace and SOAP 1.1 uses "http://schemas.xmlsoap.org/soap/envelope/".

 

转载地址:http://oeedo.baihongyu.com/

你可能感兴趣的文章
工作记录
查看>>
cucumber-api安装与试用
查看>>
计算硬件简史
查看>>
JS-两周内自动登录功能
查看>>
jQuery自适应倒计时插件
查看>>
转:JQuery.Ajax之错误调试帮助信息
查看>>
Android KeyCode列表
查看>>
网站爬取工具
查看>>
amazeui学习笔记--css(HTML元素5)--表格Table
查看>>
JavaScript&jQuery.强制类型转换
查看>>
Workgroup下开启Win7的Admin share
查看>>
搜索营销推广学习资料
查看>>
HDOJ 1698
查看>>
linux里安装redis以及redis的安全设置
查看>>
Mysql Procudure
查看>>
作业第六次
查看>>
构建之法 第一章 概论
查看>>
Hadoop编译安装
查看>>
汇编字符串拷贝
查看>>
Lambda的前世今生
查看>>