I have a service SOAPdeveloped in DELPHIand published on IIS. When testing services, we found strange behavior, the structure of the response to the soap changes after the operation is called with the wrong parameter type.
The test case is simple, we call this simple operation:
Test1_1(i:Integer; var s:string);
Call 1 (right parameter type)
Inquiry:
<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>
Answer:
<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>
Call 2 (wrong parameter type)
Inquiry:
<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>
Answer:
<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>
Call 3 (the right type of parameter and change the answer here from the first call)
Inquiry:
<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>
Answer:
<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>
As you can see, the first call and the third match exactly, but the answer is different. As I said, it changes after invokation with the wrong parameter type. The service client does not recognize the response after changing it.
- ?
, .