I recently ran into a problem with accessing a WCF web service over https. I used the WSDL Type Provider to generate the service client for me. I referenced
System.ServiceModel like a good boy, yet I couldn’t find any way to set the credentials for the service. I began by trying to use the generated client:
MyService.GetWSHttpBinding_IDataService. Unfortunately, that didn’t have a the
ClientCredentials property I expected. So I then tried creating a new client:
1 2 3 4 5
Unfortunately, the issue persisted. I then noticed a little message noting that I was missing an assembly reference. Turns out you must also open
System.IdentityModel. Problem solved.
NOTE: If anyone knows of an https hosted WCF service in the wild, I’d be happy to share the full code.