Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an old .net Framework assembly project that uses a SOAP Web Reference. These references were created via right clicking on references - Add Service Reference - Advanced - Add Web Reference.

The SOAP Web Service is now requiring oAuth authentication. I'm able to retrieve the Bearer Token but I don't know how to add it to a Header via a Web Reference.

If I wasn't going through the Web Reference I would do it like this:

var http = new System.Net.Http.HttpClient();
http.DefaultRequestHeaders.Add("Authorization", "Bearer " + Globals.BearerToken);

Does anyone know how I would do the equivalent through the Web Reference.

I appreciate the help.

What I have tried:

Couldn't find anything online that addressed this specifically.
Posted
Updated 7-Jun-22 6:23am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900