Question

I'm trying to access some web services in an iPhone application.

If I GET to the .asmx page, I authenticate and get the WSDL as expected.

However, if I POST to the .asmx page, setting the SOAPAction, Content-Type, Content-Length, and HTTPBody, I just keep getting didReceiveAuthenticationChallenge messages.

Additionally, I'm trying to POST to IIS using Integrated Windows Authentication (IWA), which means I'm trying to negotiate an NTLM challenge.

Was it helpful?

Solution

I unfortunately found my answer. NSURLConnection cannot do NTLM authentication. Here's a post about how to do NTLM authentication using the CFNetwork stack.

HTTP Post via the CFNetwork stack

Found something even better than doing all of that tediousness: Someone who has already done it!
ASIHTTPRequest

Update: There is a workaround for iOS 4 that allows for NTLM authentication again

OTHER TIPS

Sounds to me like your web-service has different read (get) and write (post) permissions. I dont think this is an issue with the iPhone or NSURLConnection at all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top