web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

How to pass Azure bearer Token in Soap Webservice

(0) ShareShare
ReportReport
Posted on by 30

Hi,

In my old webservice (Dynamics AX20112), I usually pass the credentials as follow.
MyService.ClientCredentials.UserName.UserName = U;
MyService.ClientCredentials.UserName.Password = P;

Now our service is on Dynamics 365 (Azure), we need to pass the bearer token to this soap webservice? How can that be done or is there anything similar to the above?

Thanks in advance.

I have the same question (0)
  • wandal Profile Picture
    30 on at

    I am able to get the it working. Here is how I add the "Authorization" header':

    sc = myService.Client...

                using (new OperationContextScope(sc.InnerChannel))

                {

                    // Add a HTTP Header to an outgoing request

                    string auth = "Bearer " + authToken;

                    HttpRequestMessageProperty requestMessage = new HttpRequestMessageProperty();

                    requestMessage.Headers["Authorization"] = auth;

                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessage;

                    sc.GetServiceInfo(c, out ret);               

                }        

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 38 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans