I am trying to combine a number of functions, which is becoming increasingly difficult due to the limitations of the .NET Compact Framework.
In particular, I have a WCF service, and I am writing a mobile device client for this. Trick? I want to use some kind of data compression (due to a very slow modem connected to the specified device) and HTTP DIGEST authentication (which is already present on the site hosting the WCF service).
I followed this blog post to get the compressed and generated code needed for the WCF service client.
I am, however, struggling with HTTP DIGEST. I do not know how to add this functionality.
I didnβt use compression before, so I connected to the WCF service using SOAP using a simple WebService link, and to add HTTP DIGEST I had to override the GetWebRequest method and manually add the necessary headers. This time around the generated classes, there seems to be very little freedom, and I can't override. In addition, all security or authentication settings appear to be for SSL, and not for such basic authentication schemes.
To summarize: how can I create a WCF client using compression authentication and HTTP DIGEST using the .NET Compact Framework?
EDIT: Here is the code I have received so far:
System.ServiceModel.Channels.CustomBinding customBinding = new System.ServiceModel.Channels.CustomBinding(); CompressionMessageEncodingBindingElement compressionBindingElement = new CompressionMessageEncodingBindingElement(); customBinding.Elements.Add(compressionBindingElement); HttpTransportBindingElement httpBindingElement = new HttpTransportBindingElement(); customBinding.Elements.Add(httpBindingElement); EndpointAddress endPoint = new EndpointAddress("http://localhost:5100/Service.svc"); ServiceClient client = new ServiceClient(customBinding, endPoint);
I suspect that I somehow need to add the HTTP DIGEST functionality to the CustomBinding class, but I don't know how to do this.
I suspect I should also note that although I am using the .NET Compact Framework 3.5, I am building a Windows CE application. Thus, I did not download the SDK for Windows Mobile 6. If these SDKs add more features that can be used in Window CE applications and are necessary for HTTP DIGEST to work, let me know.