admin管理员组文章数量:1291007
I'm trying to authenticate against the Marketing Cloud SOAP API and am having a nightmare trying to pass the Oauth token in. Code is below. Does anyone have some working code to compare to, I can't see what the problem is here?
public SoapClient CreateSoapClient()
{
var binding = new BasicHttpBinding
{
Security = new BasicHttpSecurity
{
Mode = BasicHttpSecurityMode.Transport,
Transport = new HttpTransportSecurity
{
ClientCredentialType = HttpClientCredentialType.None
}
},
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue
};
var endpoint = new EndpointAddress(_soapEndpoint);
var client = new SoapClient(binding, endpoint);
AttachWSecurityHeader(client);
return client;
}
private void AttachWSecurityHeader(SoapClient client)
{
var token = GetAccessToken();
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
var securityHeader = MessageHeader.CreateHeader("fueloauth", ";, token);
OperationContext.Current.OutgoingMessageHeaders.Add(securityHeader);
}
}
本文标签: salesforce marketing cloudCorrect key for REST API endpointStack Overflow
版权声明:本文标题:salesforce marketing cloud - Correct key for REST API endpoint - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741504838a2382259.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论