views:

87

answers:

3

I'm currently writing a iphone app which will consume WCF services over a secure connection (SSL/https). I have managed to consume this service while testing locally via http.

Now we want to make sure the service is secure, so we've set up a UAT server with a properly signed certificate to run our tests.

We are using a custom binding, coupled with security mode TransportWithMessageCredentials which requires a username/password in the ClientCredentials property.

Generated the proxy using SISvcUtil.exe

When I try to call this secure service from the iPhone, I get a rather lovely generic error of:

Exception in async operation: System.Net.WebException: There was an error on processing web request: Status code 500(internal server error) (Here is a pastebin of full exception ).

I've tried implicitly accepting the certificate using: ServicePointManager.ServerCertificateValidationCallBack = (sender, cert, chain, ssl) => true; but this just returns the same 500 error.

The same code works great on a windows machine but not on the iphone. Has anyone else come across this problem and/or know of a solution to it?

A: 

This could be a bug in monotouch, it may not have full implementation of generated proxy using SISvcUtil.exe, did you try generating a mac app and test it on mac?

Does monotouch have any documented example with support on WCF proxy? If they dont have then probably it may not work, monotouch does not provide a .NET runtime, instead it actually compiles everything to native ios binary. So if WCF proxy is not correctly transformed, it will not work.

Akash Kava
http://wiki.monotouch.net/HowTo/WebServices/Using_WCF here is a wiki entry with regards to generating proxy's to use within Monotouch - and I've also had this proxy working for http; so I'm inclined to say that this isn't the problem.
Luke
A: 

Generally when getting Internal Server errors I've found the cause to be a problem with the HTTP headers being sent in the request. I don't really use WCF on MonoTouch so I'm not sure about the implementation.

ifwdev
A: 

So it would seem that at the time of writing, Monotouch doesn't support WCF very well (it currently has a barebones implementation).

Due to this, and the need for decent security around our webservice, we've decided to go down a different route; validating the user via username+password over a secure, encrypted SSL connection everytime the web service is called. We use Silverlight 3.0 SiSUtil.exe to generate the bindings for the webservice rather than include it as a web reference in the project.

Luke