{"action":"created","issue":{"url":"https://api.github.com/repos/tomakehurst/wiremock/issues/227","labels_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/227/comments","events_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/227/events","html_url":"https://github.com/tomakehurst/wiremock/issues/227","id":54787230,"number":227,"title":"Using Regex For Soap Request After Record Mode","user":{"login":"hellishheat","id":5910672,"avatar_url":"https://avatars.githubusercontent.com/u/5910672?v=3","gravatar_id":"","url":"https://api.github.com/users/hellishheat","html_url":"https://github.com/hellishheat","followers_url":"https://api.github.com/users/hellishheat/followers","following_url":"https://api.github.com/users/hellishheat/following{/other_user}","gists_url":"https://api.github.com/users/hellishheat/gists{/gist_id}","starred_url":"https://api.github.com/users/hellishheat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellishheat/subscriptions","organizations_url":"https://api.github.com/users/hellishheat/orgs","repos_url":"https://api.github.com/users/hellishheat/repos","events_url":"https://api.github.com/users/hellishheat/events{/privacy}","received_events_url":"https://api.github.com/users/hellishheat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-19T16:54:34Z","updated_at":"2015-01-28T15:21:11Z","closed_at":null,"body":"Hi,\r\n\r\nI have just started using standalone Wiremock. It's great.\r\n\r\nWe use axis to make soap requests, the responses for which I want to use Wiremock. Wiremock records the mappings as follows (The '.....' is mine for abbrev.):\r\n```xml\r\n\"request\" : {\r\n    \"url\" : \"/axis/services/Document.PrintService\",\r\n    \"method\" : \"POST\",\r\n    \"bodyPatterns\" : [ {\r\n      \"equalToXml\" : \"<?xml version=\\\"1.0\\\" .....   <name xsi:type=\\\"xsd:string\\\">123456</name>\\n  </multiRef>\\n </soapenv:Body>\\n</soapenv:Envelope>\"\r\n    } \r\n```\r\n\r\nMy problem is that the request will not always have the exact same values, but I want the same response. In the example above (for example) the 123456 could be 654321.\r\n\r\nIn an attempt to solve this, using 'matches', I changed it to \r\n```xml\r\n\"request\" : {\r\n    \"url\" : \"/axis/services/Document.PrintService\",\r\n    \"method\" : \"POST\",\r\n    \"bodyPatterns\" : [ {\r\n      \"matches\" : \"<?xml version=\\\"1.0\\\" .....   <name xsi:type=\\\"xsd:string\\\">[0-9]{6}</name>\\n  </multiRef>\\n </soapenv:Body>\\n</soapenv:Envelope>\"\r\n    }\r\n```\r\n\r\nThis could in theory fix my problem but, instead I get this error:\r\n\r\n```\r\n{}string: return code:  500\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;/&gt;\r\n&lt;title&gt;Error 500 Illegal/unsupported escape sequence near index 6287\r\n```\r\n\r\nAm I using regex correctly here?\r\n\r\nThanks, Declan"},"comment":{"url":"https://api.github.com/repos/tomakehurst/wiremock/issues/comments/71851861","html_url":"https://github.com/tomakehurst/wiremock/issues/227#issuecomment-71851861","issue_url":"https://api.github.com/repos/tomakehurst/wiremock/issues/227","id":71851861,"user":{"login":"hellishheat","id":5910672,"avatar_url":"https://avatars.githubusercontent.com/u/5910672?v=3","gravatar_id":"","url":"https://api.github.com/users/hellishheat","html_url":"https://github.com/hellishheat","followers_url":"https://api.github.com/users/hellishheat/followers","following_url":"https://api.github.com/users/hellishheat/following{/other_user}","gists_url":"https://api.github.com/users/hellishheat/gists{/gist_id}","starred_url":"https://api.github.com/users/hellishheat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellishheat/subscriptions","organizations_url":"https://api.github.com/users/hellishheat/orgs","repos_url":"https://api.github.com/users/hellishheat/repos","events_url":"https://api.github.com/users/hellishheat/events{/privacy}","received_events_url":"https://api.github.com/users/hellishheat/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T15:21:11Z","updated_at":"2015-01-28T15:21:11Z","body":"Hi, this does work and, through a mixture of these patterns, I can achieve my goal.\r\n\r\ne.g..\r\n\r\n```json\r\n {\"matchesXPath\" : \"//*[local-name()='savePackage']\"},\r\n\t\t  {\"contains\" : \"123456789\"}\r\n```\r\nThanks for your help. I think I need a crash course in XPath, that will help to make wiremock a very powerful tool for my needs. Thanks."}}