outofcoffee / imposter

Scriptable, multipurpose mock server. Run standalone mock servers, or embed mocks within your tests.

Home Page:https://imposter.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support XML attributes in SOAP request body XPath

driesva opened this issue · comments

The SOAP services we want to mock are using XML attributes. Based on an attribute, we would like to return a different response.

Imagine this part of the request:

    <pets:getPetByIdRequest xmlns:pets="urn:com:example:petstore" id="10" />

The XPath for matching would be:

//pets:getPetByIdRequest/@id

We found out that only XML elements are supported in the XPath expression.

I'll provide a PR with XPath attribute expression support.