0

I am trying to make a POST Action in Objective-C (for an iOS application) to a Biztalk server to send an XML file

I found the following tutorial and used it . the code compiles successfully and when I try to post I don t get any error message regarding the posting (through the didFailWithError Function). But when I check on Biztalk I noticed that the data didn't get transmitted ...

the link I am posting to is an https link ( and not http) can this be the problem ?

Am I missing something ?

Thanks!

EDIT : here are the functions that get called sequentially after making the SOAP Request:

-(void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
-(void)connection:(NSURLConnection *) connection didReceiveData:(NSData *)data
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
user1415780
  • 1,153
  • 5
  • 16
  • 33
  • Can you convert the response to a string and post it? It might contain a hint as to what is going on. – Robert Zahm Nov 30 '12 at 21:55
  • ok I found where is the problem (or at lease one of them ) . the link I call redirects several times and I need to use the cookies to create another request with the last redirection . I found this : http://stackoverflow.com/questions/3670892/nsmutableurlrequest-and-redirection that handles redirection but I need to know how to use the cookies in my second call , can you give me a hint on that ? – user1415780 Dec 07 '12 at 16:46
  • Something like this? http://stackoverflow.com/questions/3319866/iphone-nsurlconnection-read-cookies – Robert Zahm Dec 10 '12 at 21:09
  • ok I managed to make calls with cookies history . but now I get another issue , the `didFailWithError` gets called with the following error :`code=-1007 "too many HTTP redirects"` !!!! any clue how to handle this problem ? – user1415780 Dec 11 '12 at 21:01
  • The data you are sending the server is probably causing an infinite redirect loop – Robert Zahm Dec 12 '12 at 17:15

1 Answers1

1

you can use https://github.com/RestKit/RestKit

Is a nice framework to REST Actions

Kamber
  • 89
  • 3