title: mock-server simple mock not working with XML in the body
body: <p>I have a mock server using: <a href="http://www.mock-server.com" rel="nofollow">http://www.mock-server.com</a></p>
  
  <p>That server has two different rules for the POST that hits it. Here is the java code:</p>
  
  <pre><code>package mockserver.poc;
  
  import static java.util.concurrent.TimeUnit.SECONDS;
  import static org.mockserver.model.HttpRequest.request;
  import static org.mockserver.model.HttpResponse.response;
  import static org.mockserver.model.StringBody.regex;
  
  import org.mockserver.client.server.MockServerClient;
  import org.mockserver.mockserver.MockServer;
  import org.mockserver.model.Delay;
  
  public class MockServerPoc {
  
      public static void main(String[] args) {
          MockServer mockServer = new MockServer(8888);
          System.out.println("Running:" + mockServer.isRunning());
  
          MockServerClient mockServerClient = new MockServerClient("10.189.225.196", 8888);
  
          mockServerClient.when(
                  request()
                          .withMethod("POST")
                          .withPath("/something1")
                          .withBody(regex("SubscriberA"))
          )
          .respond(
                  response()
                          .withBody("&lt;xml&gt;\n something1 ok \n&lt;xml&gt;")
                          .withDelay(new Delay(SECONDS, 1))
          );
  
          mockServerClient.when(
                  request()
                          .withMethod("POST")
                          .withPath("/something1")
                          .withBody(regex("SubscriberB"))
          )
          .respond(
                  response()
                          .withBody("&lt;xml&gt;\n something2 ok \n&lt;xml&gt;")
                          .withDelay(new Delay(SECONDS, 1))
          );
      }
  }
  </code></pre>
  
  <p>The problem with that code is that, using SOAPUI, if I try to hit it with the following XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ns2:Envelope xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;ns2:Body&gt;
       &lt;objectclass&gt;SubscriberA&lt;/objectclass&gt;
     &lt;/ns2:Body&gt;
  &lt;/ns2:Envelope&gt;
  </code></pre>
  
  <p>I don't get the expected result </p>
  
  <pre><code>&lt;xml&gt;\n something1 ok \n&lt;xml&gt;
  </code></pre>
  
  <p>If the body is just <strong>SubscriberA</strong>, it works fine, but if it is the entire XML, it simple doesn't work.</p>
  
  <p>Am I doing wrong something wrong?</p>