WCF/WF - Consuming WebServices with HTTP BASIC Authentication

Asked By Eduardo on 25-May-10 07:24 AM
Hi everyone, 

I have some doubts regarding this article... 

 I assumed that only after overriding the default System.Net.ServicePointManager's CertificatePolicy with CheckValidationResult to true but it doesn't work. The WebServices always replies me with: 

System.InvalidOperationException : Client found response content type of '', but expected 'text/xml'. 
at System.Web at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke() at ... 

I have several configurations with and without SSL implemented and It works fine without SSL. 

Have I done something wrong ? Is it possible that accept all the certificates by default is not enough? 

Thanks in advance !! 

Eduardo Díaz
Anoop S replied to Eduardo on 25-May-10 07:50 AM
reason for the error is  you did not send an HTTP POST request with a SOAP envelope, you simply sent an HTTP GET request with no body, and your Web service appropriately assumed you were a browser and returned its normal HTML response.

read this one
Eduardo replied to Anoop S on 25-May-10 08:02 AM
Hi Anoob, 

thanks for the quick response, but I think that i have to explain the architecture more in depth. 

I'm consuming the WebServices published by a JBoss 4.2 server with Compact 2.0 based Mobile Application. 

I don't think I can use cookies but, is there any way to store session data in this scenario ?? Or do I have to approach the problem in a different way ?

Thanks again

Eduardo Díaz