测试用例很简单,我们称之为简单 *** 作:
Test1_1(i:Integer; var s:string);
调用1(右参数类型)
请求:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WS_MCH_PrivadosIntf-IWS_MCH_Privados"> <soapenv:header/> <soapenv:Body> <urn:Test1_1 soapenv:enCodingStyle="http://schemas.xmlsoap.org/soap/enCoding/"> <numero xsi:type="xsd:int">1</numero> </urn:Test1_1> </soapenv:Body></soapenv:Envelope>
响应:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/enCoding/"> <SOAP-ENV:Body> <Test1_1Response xmlns="urn:WS_MCH_PrivadosIntf-IWS_MCH_Privados"> <res xmlns="http://www.w3.org/2001/XMLSchema">TEST1_1 OK</res> </Test1_1Response> </SOAP-ENV:Body></SOAP-ENV:Envelope>
调用2(参数类型错误)
请求:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WS_MCH_PrivadosIntf-IWS_MCH_Privados"> <soapenv:header/> <soapenv:Body> <urn:Test1_1 soapenv:enCodingStyle="http://schemas.xmlsoap.org/soap/enCoding/"> <numero xsi:type="xsd:int">a</numero> </urn:Test1_1> </soapenv:Body></soapenv:Envelope>
响应:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/enCoding/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>'a' is not a valID integer value</faultstring> <faultactor/> </SOAP-ENV:Fault> </SOAP-ENV:Body></SOAP-ENV:Envelope>
调用3(正确的参数类型,以及第一次调用时的响应更改)
请求:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WS_MCH_PrivadosIntf-IWS_MCH_Privados"> <soapenv:header/> <soapenv:Body> <urn:Test1_1 soapenv:enCodingStyle="http://schemas.xmlsoap.org/soap/enCoding/"> <numero xsi:type="xsd:int">1</numero> </urn:Test1_1> </soapenv:Body></soapenv:Envelope>
响应:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/enCoding/"> <SOAP-ENV:Body SOAP-ENV:enCodingStyle="http://schemas.xmlsoap.org/soap/enCoding/" xmlns:NS1="urn:WS_MCH_PrivadosIntf-IWS_MCH_Privados"> <NS1:Test1_1Response> <res xsi:type="xsd:string">TEST1_1 OK</res> </NS1:Test1_1Response> </SOAP-ENV:Body></SOAP-ENV:Envelope>
如您所见,第一个呼叫和第三个呼叫完全相同,但响应不同.就像我之前说过的那样,它在使用错误的参数类型调用后会发生变化.
服务的客户端在更改后无法识别响应.
关于这种行为的任何线索?
我需要服务器始终以相同的方式回答.
几个月前我遇到了类似的问题,就像你描述的那样,我无法解决这个错误.我联系了IDera(Delphi的所有者),并将此报告为VCL错误.
我确实收到了回复并修复了,但我无法与您分享热门修复程序.
(请不要联系我…)
这是Delphi Seattle的热门修复或Delphi Berlin的Update 1修复.
总结以上是内存溢出为你收集整理的web-services – Soap webservice从同一个调用返回不同的响应全部内容,希望文章能够帮你解决web-services – Soap webservice从同一个调用返回不同的响应所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)