Contributions
Testing with an XML attachment or data in a soap request with a mock service
How would I test sending XML data in a SOAP request using a mock service. I have tested by adding an attachment but I do not see anything indicating it was ever sent in the response. My base request looks like this: <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:soapActIntf-ISoapAct" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soapenv:Header/> <soapenv:Body> <urn:SubmitJob soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ii_File xsi:type="xsd:base64Binary">cid:429545744033</ii_File> <ir_SubmitJobInfStruc xsi:type="urn:TSubmitJobInfStruc" xmlns:urn="urn:RemoteTypeCls"> <SubmitSOAPActionName xsi:type="xsd:string">?</SubmitSOAPActionName> <SubmitOriginalFileName xsi:type="xsd:string">?</SubmitOriginalFileName> <SubmitVariableList xsi:type="urn:TVariableUnitArray" soapenc:arrayType="urn:TVariableUnit[]"/> </ir_SubmitJobInfStruc> <ib_ReturnJobFile xsi:type="xsd:boolean">?</ib_ReturnJobFile> <is_Username xsi:type="xsd:string">?</is_Username> <is_Password xsi:type="xsd:string">?</is_Password> </urn:SubmitJob> </soapenv:Body> </soapenv:Envelope> My request with the attachment: <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:soapActIntf-ISoapAct" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soapenv:Header/> <soapenv:Body> <urn:SubmitJob soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ii_File xsi:type="xsd:base64Binary">cid:429545744033</ii_File> <ir_SubmitJobInfStruc xsi:type="urn:TSubmitJobInfStruc" xmlns:urn="urn:RemoteTypeCls"> <SubmitSOAPActionName xsi:type="xsd:string">DECards</SubmitSOAPActionName> <SubmitOriginalFileName xsi:type="xsd:string">SampleData.xml</SubmitOriginalFileName> <SubmitVariableList xsi:type="urn:TVariableUnitArray" soapenc:arrayType="urn:TVariableUnit[]"/> </ir_SubmitJobInfStruc> <ib_ReturnJobFile xsi:type="xsd:boolean">TRUE</ib_ReturnJobFile> <is_Username xsi:type="xsd:string">#####</is_Username> <is_Password xsi:type="xsd:string">#####</is_Password> </urn:SubmitJob> </soapenv:Body> </soapenv:Envelope>1.1KViews0likes1Comment