How to fix MTOM/XOP issues in HPE LoadRunner?: Recently I was facing issues while scripting in HPE LoadRunner for the web services. My script threw “Response is not well-formed XML”. In last release, the script was working without any issues. But in this release, I was getting above error. I checked the detailed logs from HPE LoadRunner, but I couldn’t get any info.
Later I contacted the development team about this issue. They informed that they had implemented MTOM/XOP for sending Binary Data in this release. In this article, we will see how to fix MTOM/XOP issues in HPE LoadRunner?
What is MTOM/XOP?
MTOM/XOP stands for SOAP Message Transmission Optimization Mechanism/XML-binary Optimized Packaging. It defines the method which optimizes the transmission of XML data of type base64 and hexBinary in SOAP messages. If the transport protocol is HTTP, MIME attachments carry the data, concurrently it allows sender and receiver directly access the XML data.
It involves following process
- Encode the binary data
- Removed the binary data from SOAP envelope
- Compresses the binary data and attaches it to the MIME package
- Add references to the MIME package.
Response that we receive in HPE LoadRunner is MTOM format, not the SOAP format. But HPE LoadRunner is sending SOAP message and expecting SOAP format. But the server is sending back MTOM format. There is a conflict hence you will get above error.
How to fix MTOM/XOP issues in HPE LoadRunner?
To fix this, you need to add below custom handler to your web service call.
“UserHandlerName=LrWsAttachmentsHandler”, “UserHandlerArgs=ATTACHMENT_ADD; ATTACHMENTS_FORMAT_MIME; ContentType=text/plain; FileName=C:\\temp\\results.discomap”,
Above custom handler overrides the transport layer and receives MTOM message. If your services using MTOP/XOP, do not forget to add above custom handler.