Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support XML attributes in SOAP request body XPath #555

Closed
driesva opened this issue Apr 17, 2024 · 0 comments · Fixed by #556
Closed

Support XML attributes in SOAP request body XPath #555

driesva opened this issue Apr 17, 2024 · 0 comments · Fixed by #556

Comments

@driesva
Copy link
Contributor

driesva commented Apr 17, 2024

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.

driesva added a commit to driesva/imposter that referenced this issue Apr 17, 2024
Function to extract XPath attribute values in addition to other content values (such as XML elements).

fixes outofcoffee#555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant