title: Wildfly allow OPTIONS Methods but return 405 Method not allowed
body: <p>I'm trying to send xml with <code>POST</code> method in javascript using the <code>XmlHttpRequest</code> object. 
  On my server I've a web service which receives SOAP request.</p>
  
  <p>When I want to send xml, the browser previusly try to send a preflight <code>OPTIONS</code> request to the server, but it returns <code>OPTIONS 405 Method Not Allowed</code>.</p>
  
  <p>The problem is that I've in my response header the <code>Access-Control-Method-Allowed : POST,OPTIONS,GET,PUT</code> so I guess  my server accepts OPTIONS method, but my web service only understands <code>POST</code> request.</p>
  
  <p>Here's some code : </p>
  
  <pre><code> var xmlhttp = new XMLHttpRequest();
   xmlhttp.open('POST', url, false);
   var sr = mySoapRequest; //Here's my XML 
  
   xmlhttp.onreadystatechange =  () =&gt; {
       if (xmlhttp.readyState == 4) {
           if (xmlhttp.status == 200) {                           
               var xml = xmlhttp.responseXML;
               console.log(xml);
               this.showAlert(xml);
           }
       }
   }
   xmlhttp.setRequestHeader("content-type", "file/xml");
   xmlhttp.send(sr);
  </code></pre>
  
  <p>Here's my HTTP protocol request headers :</p>
  
  <pre><code>Accept:*/*
  Accept-Encoding:gzip, deflate, sdch
  Accept-Language:fr-FR,fr;q=0.8,en;q=0.6,en-US;q=0.4
  Access-Control-Request-Headers:content-type
  Access-Control-Request-Method:POST
  Connection:keep-alive
  DNT:1
  Host:192.168.149.127
  Origin:http://192.168.149.1:8100
  Referer:http://192.168.149.1:8100/?ionicplatform=android 
  </code></pre>
  
  <p>Here's my HTTP protocol response headers : </p>
  
  <pre><code>Access-Control-Allow-Credentials:true
  Access-Control-Allow-Headers:accept, authorization, content-type, x-requested-with
  Access-Control-Allow-Methods:GET, POST, OPTIONS, PUT
  Access-Control-Allow-Origin:*
  Access-Control-Max-Age:1
  Connection:keep-alive
  Content-Length:224
  Content-Type:text/xml;charset=UTF-8
  Date:Thu, 16 Feb 2017 10:25:33 GMT
  Server:WildFly/8
  X-Content-Type-Options:nosniff
  X-FRAME-OPTIONS:SAMEORIGIN
  X-Powered-By:Undertow/1
  X-XSS-Protection:1
  </code></pre>
  
  <p>Any suggestions ? </p>