How to mock SOAP web service call with a SOAP message in MUnit 2.1.3?
Creating a test case with mocking of SOAP web service call using MUnit 2.1.3 in Mulesoft
Transform processor will not work if you are just providing the original response of SOAP service as mock response. So you need to you tweak little in order to make it work with Transform message processor.
Look at the following example. The is the complete SOAP message taken from the original response.
<?xml version='1.0' encoding='windows-1252'?>
<body>
<env:Header/>
<env:Body>
<m:SessionResponse>
<sec:SSOSessionID xmlns:sec="http://example.net/security/token">K7f0f0f3-b8f9-4eec-8d1c-b13cd0f3d00b</sec:SSOSessionID>
</m:SessionResponse>
</m:getTokenWSResponse>
</env:Body>
</env:Envelope>
</body>
This need to be changes as below in order to make the transform processor to work.
<?xml version='1.0' encoding='windows-1252'?>
<body>
<m:SessionResponse>
<sec:SSOSessionID xmlns:sec="http://example.net/security/token">K7f0f0f3-b8f9-4eec-8d1c-b13cd0f3d00b</sec:SSOSessionID>
</m:SessionResponse>
</m:getTokenWSResponse>
</body>
This above message should be your mock message. Soap envelope and headers need to be removed in order make transform task to work.
Thanks
Jayaraman Pancharathinam
28 Nov 2018
Jayaraman Pancharathinam
28 Nov 2018
Keywords: Mulesoft, Mule 4, MUnit 2.1.3, Anypoint Studio, Mocking, SOAP web service call, Transform processor
Thanks for sharing this information!!
ReplyDeleteBest Mulesoft Online Training
Best Mulesoft Training
Very useful information for communications. We can visit that acoustic movable partition gives the worthful information to you.
ReplyDeleteVery useful information for communications. We can visit that gives the worthful information to you.
ReplyDeletemovable partition