By Sreejith

2014-05-21 08:28:06 8 Comments

How to call a WCF wsHttpBinding reliable-session enabled web service from iOS objective-C code.. I Wrote a general code for accessing the service, but I am getting this error "The action is not supported by this endpoint. Only WS-ReliableMessaging February 2005 messages are processed by this endpoint".

Here my code

<NSString *[email protected]"<s:Envelope xmlns:a=\"\" xmlns:s=\"\">
   <a:Action s:mustUnderstand=\"1\">
       </… xmlns:h=\"\">1</h:ApplicationID>
         <h:DeviceID xmlns:h=\"\">1</h:DeviceID>
         <h:Password xmlns:h=\"\">Password1</h:Password>
      </… s:mustUnderstand=\"1\">MySvcUrl
  <s:Body />

NSURL *url = [NSURL URLWithString: MySvcUrl];

NSMutableURLRequest *theRequest = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:0];
[theRequest setCachePolicy:NSURLCacheStorageNotAllowed];
NSString *msgLength = [NSString stringWithFormat:@"%lu", (unsigned long)[stringAuthenticateUsr length]];
[theRequest addValue: @"application/soap+xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"" forHTTPHeaderField:@"Soapaction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPShouldHandleCookies:YES];
[theRequest setHTTPBody: [stringAuthenticateUsr dataUsingEncoding:NSUTF8StringEncoding]];

NSHTTPURLResponse* response; NSError* error = nil; NSData* resultData = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; NSString *result = [[NSString alloc]initWithData:resultData encoding:NSUTF8StringEncoding]; NSLog(@"result--%@",result);


Related Questions

Sponsored Content

43 Answered Questions

[SOLVED] Passing Data between View Controllers

26 Answered Questions

[SOLVED] What's the difference between the atomic and nonatomic attributes?

13 Answered Questions

[SOLVED] WCF - How to Increase Message Size Quota

6 Answered Questions

[SOLVED] REST / SOAP endpoints for a WCF service

  • 2008-10-09 10:11:30
  • Wessam Zeidan
  • 259342 View
  • 421 Score
  • 6 Answer
  • Tags:   wcf rest soap

5 Answered Questions

[SOLVED] What are the differences between WCF and ASMX web services?

2 Answered Questions

[SOLVED] How to create a WCF Message object from SOAP response XML

  • 2013-06-05 21:03:10
  • Doug Seelinger
  • 5619 View
  • 3 Score
  • 2 Answer
  • Tags:   c# .net wcf soap

2 Answered Questions

[SOLVED] WCF (Silverlight) Duplex - Not hitting server

Sponsored Content