Azure WCF(Rest)服务抛出“客户端身份验证方案禁止了HTTP请求...".与另一个跨域WCF服务进行通信时 [英] Azure WCF (Rest) service throws "The HTTP request was forbidden with client authentication scheme..." when communication with another cross domain WCF service

查看:92
本文介绍了Azure WCF(Rest)服务抛出“客户端身份验证方案禁止了HTTP请求...".与另一个跨域WCF服务进行通信时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经制作了WCF(REST)服务,并将其发布到Azure.在此服务中(作为客户端),我使用WCF调用asmx SOAP服务. (ChannelFactory等)

I 've made a WCF (REST) service which I published to Azure. Inside this sercvice (as a client) I call an asmx SOAP service using WCF. (ChannelFactory .etc. )

当我在azure上发布此服务时(显然具有与asmx SOAP服务不同的域),在执行对asmx SOAP服务的调用时会遇到上述错误. (具有NTLM身份验证)当我在本地运行服务时 Windows服务运行正常.

When I publish this service on azure (with obviously has another domain than the asmx SOAP service) I get errors like the one above when excute the call to the asmx SOAP service. (Which has NTLM authentication) When I run the service locally as local windows service it runs fine.

如何(不对asmx SOAP服务进行任何更改)如何从此Azure服务调用它.我可以使用其他框架轻松完成相同的操作,但不能使用Windows/wcf/azure

How can I (WITHOUT making any changes to the asmx SOAP service) call it from this Azure service. I can do the same thing easily with another framework but not with windows/wcf/azure

调用asmx服务的代码:

My code to call the asmx service :

var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);   

var channelFactory =新ChannelFactory< T>(binding,remoteAddress);

var channelFactory = new ChannelFactory<T>(binding, remoteAddress);

binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;

binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;

channelFactory .Credentials.Windows.ClientCredential.UserName = NTLMUser;

channelFactory.Credentials.Windows.ClientCredential.UserName = NTLMUser;

channelFactory.Credentials.Windows.ClientCredential.Password = NTLMPassword;

channelFactory.Credentials.Windows.ClientCredential.Password = NTLMPassword;

先谢谢了.

推荐答案

WCF服务?

WCF Service?


这篇关于Azure WCF(Rest)服务抛出“客户端身份验证方案禁止了HTTP请求...".与另一个跨域WCF服务进行通信时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆