Reputation: 11
I've tried to write a .net client that call java web service with http basic authentication. The service consumes files. So I'd like to persuade the .net web service client framework to send Authorization header at first time.
In previous versions of .net there was a property PreAuthenticate. How could I apply this on WCF web service client?
In my hands I have only instance of testOperationsPortTypeClient that is descendant of System.ServiceModel.ClientBase<.>
. No such property or callback is present for it.
Upvotes: 1
Views: 2665
Reputation: 89
One option is to remove the current Service Reference you have and then do the following:
This will take you to the old Add a Web Service reference screen from .Net 2.0. Adding the reference to the web service using this will create the wrappers inheriting from SoapHttpClientProtocol which includes PreAuthenticate, etc
Upvotes: 1