The web service client application used in this task is a modified version of. Use this client to request and to insert authentication tokens in the SOAP request. The STS to the SOAP security header of web services request messages. O=IBM, ST=Kanagawa, C=JP', null); SecurityToken x509 = factory.
I'm having trouble successfully authenticating to a webservice when using a Service Reference with C#.The web service is a WSDL located hereĀ and it requires authentication. If I use smartbear's SOAPUI to test the WSDL I can successfully connect and authenticate by settingthe authentication to 'Basic' and selecting the option button 'Authenticate Pre-emptively'. Unfortunately I have no way of doing the equivalent in C#. Specifically I think I need to set something to force WCF to send the authentication with every request.Here is what my app.config looks like: And the code that calls one of the web service functions: CampaignRecord campaignRecords;mediahawkAPIPortTypeClient client = new mediahawkAPIPortTypeClient;client.ClientCredentials.UserName.UserName = 'username';client.ClientCredentials.UserName.Password = 'password';client.GetCampaignIds(out campaignRecords);Has anyone faced this problem and solved it?Thanks.