title: Expected status code in (200-299), got 500
body: <p>I'm fetching data from server. Server side is maintaining from client. I'm just parsing the data and get using AFNetworking. But may be some SOAPACtion having error.Server did not recognize the value of HTTP Header SOAPAction: <a href="http://test.server.com/Role" rel="nofollow">http://test.server.com/Role</a></p>
  
  <p>HTTP POST:</p>
  
  <pre><code>POST /service/services.asmx/Role HTTP/1.1
  Host: server.com
  Content-Type: application/x-www-form-urlencoded
  Content-Length: length
  
  SyncResetData=string
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>NSString *soapMessage = [NSString stringWithFormat:@"&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n"
                               "&lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;\n"
                               "&lt;soap:Body&gt;\n"
                               "&lt;Sync_Reset_Role xmlns=\"http://test.server.com/\"&gt;\n"
                               "&lt;SyncResetData&gt;&lt;![CDATA[%@]]&gt;&lt;/SyncResetData&gt;\n"
                               "&lt;/Sync_Reset_Role&gt;\n"
                               "&lt;/soap:Body&gt;\n"
                               "&lt;/soap:Envelope&gt;\n",string];
  
  
      NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/services.asmx?wsdl/Role",SERVICE_ENDPOINT]];
  
  
       NSLog(@"url is getResetRoleContentLength %@",url);
  
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
      NSString *strLength = [NSString stringWithFormat:@"%d",[soapMessage length]];
  
      [request addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
      [request addValue: [NSString stringWithFormat:@"http://test.server.com/Role"] forHTTPHeaderField:@"SOAPAction"];
      [request addValue: strLength forHTTPHeaderField:@"Content-Length"];
      [request setHTTPMethod:@"POST"];
      [request setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
  
  
           AFHTTPRequestOperation *operation2 = [[AFHTTPRequestOperation alloc] initWithRequest:request];
  
      [operation2 setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation2, id responseObject2) {
  
  
      } failure:^(AFHTTPRequestOperation *operation2, NSError *error) {
  
          NSLog(@"Error: %@", error);
  
  
          if([delegate respondsToSelector:@selector(requestFailed)]){
              [delegate performSelector:@selector(requestFailed)];
          }
  
  
      }];
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code> Error: Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 500" UserInfo=0x6995430 {NSLocalizedRecoverySuggestion=&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Body&gt;&lt;soap:Fault&gt;&lt;faultcode&gt;soap:Client&lt;/faultcode&gt;&lt;faultstring&gt;Server did not recognize the value of HTTP Header SOAPAction: http://test.server.com/Role.&lt;/faultstring&gt;&lt;detail /&gt;&lt;/soap:Fault&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;, AFNetworkingOperationFailingURLResponseErrorKey=&lt;NSHTTPURLResponse: 0x693c870&gt;, NSErrorFailingURLKey=http://test.server.com/test/services.asmx?wsdl/Role, NSLocalizedDescription=Expected status code in (200-299), got 500, AFNetworkingOperationFailingURLRequestErrorKey=&lt;NSMutableURLRequest http://test.server.com/test/services.asmx?wsdl/Role&gt;}
  </code></pre>