I'm using WireMock to mock a SOAP service.
It works great, but one of the services contains an attachment. Is there any way to mock it with WireMock?
Thanks
I'm using WireMock to mock a SOAP service.
It works great, but one of the services contains an attachment. Is there any way to mock it with WireMock?
Thanks
Yes it's possible. First, you can use SOAP ui to mock the response you are expecting with the attachment. [On the soap resource, right click: generate SOAP mock service] On the mock created, in the response you should see a dummy body corresponding to the wsld. There you can click on attachment and add a file: You run this mock and try to hit it manually with a soap request that should then appear on the request part.
It will produce for you the response with the attachment. You can see the raw part looking like this:
Now, you can set up wiremock with something like this:
Pay attention the headers content-type should be the same as on the raw parts you got from soap ui.
the responseTest.raw looks something like this:
And voila!