Using the WCF service using Monotouch over SSL (https) + basicHttpBinding

I am currently writing an iphone application that will use WCF services over a secure connection (SSL / https). I managed to use this service, checking locally via http.

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

We use custom bindings in conjunction with the TransportWithMessageCredentials security mode, which requires a username / password in the ClientCredentials property.

Generated Proxy with SISvcUtil.exe

When I try to call this secure service from the iPhone, I get a pretty nice general error:

Exception in async operation: System.Net.WebException: There was an error on processing web request: Status code 500(internal server error) ( Here is the pastor for the complete exception ).

I tried to implicitly accept the certificate using: ServicePointManager.ServerCertificateValidationCallBack = (sender, cert, chain, ssl) => true; but it just returns the same 500 error.

The same code works fine on a Windows machine, but not on an iphone. Has anyone else encountered this problem and / or was aware of a solution to it?

+4
source share
3 answers

Thus, it would seem that at the time of writing, Monotouch does not support WCF very well (it currently has a barebone implementation).

In this regard, and the need to ensure decent security in our web service, we decided to take a different path; user confirmation via username + password through a secure, encrypted SSL connection each time the web service is called. We use Silverlight 3.0 SiSUtil.exe to create bindings for a web service, and not to include as a web link in a project.

+1
source

This may be a bug in monotouch, it may not have a full implementation of the generated proxy server using SISvcUtil.exe, have you tried to create a mac application and test it on a Mac?

Does monotouch have a documented example with WCF proxy support? If they don’t have, then perhaps this may not work, monotouch does not provide the .NET runtime, instead, it actually compiles everything into the native ios binary. Therefore, if the WCF proxy server is not correctly converted, it will not work.

+1
source

As a rule, when I received internal server errors, I found that the reason was the problem with sending HTTP headers in the request. I really don't use WCF in MonoTouch, so I'm not sure about the implementation.

0
source

All Articles