I'm setting up a dummy PHP server with wiremock and want to match based upon one of the XML fields being passed. I basically will have multiple requests coming into this same url but the main difference between them will be the invoice number. My JSON for wiremock looks like this
{
"request": {
"method": "ANY",
"urlPattern": ".*/test.php",
"bodyPatterns" : [{
"equalToXml": "<InvoiceNumber>6</InvoiceNumber>"
}]
},
"response": {
"status": 200,
"bodyFileName": "sample.xml",
"headers": {
"Content-Type": "application/xml"
}
}
}
This works fine when I use Postman and only pass an XML with the <InvoiceNumber></InvoiceNumber>
field, but the moment I add a secondary field it fails.
I would like to be able to pass any Xml to wiremock and as long as it has the <InvoiceNumber></InvoiceNumber>
field it will read it.