title: Calling ServiceStack Service Cross-Domain with Cors Issue
body: <p>I am in the process of testing some web services on my local machine.  Because the test page sits on the root at port 80, and the web-services on different ports, I get the following error from Chrome's diagnostic tool:</p>
  
  <pre><code>XMLHttpRequest cannot load http://PCNAME:8083/PackageSearch. Origin http://PCNAME is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>After doing some searching, I came across the CORS Features of ServiceStack, and put the following attribute on my Web Service:</p>
  
  <pre><code>[EnableCors(allowedMethods: "GET, POST")]
  </code></pre>
  
  <p>However, the error still persists.  This is the ajax call:</p>
  
  <pre><code>function packageSearch(tourCode) {
              var searchUrl = url + 'PackageSearch';
              var searchData = {
                  TourCode: tourCode,
              };
              $.ajax(searchUrl,{
                      data : JSON.stringify(searchData),
                      type: 'POST',
                      contentType: 'application/json, charset=utf-8',
                      dataType: 'json',
                      success: function (result) {
                         oTable.fnClearTable();
                     }});
          };
  </code></pre>
  
  <p>Where <code>url</code> is <code>http://PCNAME/</code>.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have even set up the following during the Configuration stage:</p>
  
  <pre><code>    public override void Configure(Funq.Container container)
      {
          Plugins.Add(new CorsFeature());
  
          RequestFilters.Add((httpReq, httpRes, requestDto) =&gt;
              {
                  if (httpReq.HttpMethod == "OPTIONS")
                      httpRes.End();
              });
          base.SetConfig(new EndpointHostConfig
          {
              DefaultContentType = "application/json",
              GlobalResponseHeaders = {
              { "Access-Control-Allow-Origin", "*" },
              { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" },
              { "Access-Control-Allow-Headers", "Content-Type, origin, accept" },
          }
          });
          });
      }   // Configure
  </code></pre>