我得到了#34;访问被拒绝"访问第三方服务时出现例外情况。
以下是我正在使用的绑定(已将某些名称更改为XXXX,YYYY和OOOO,因为我不想显示它们)
<system.serviceModel>
<bindings>
<customBinding>
<binding name="XXXXSyncBinding">
<security defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport"
requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="false">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://OOOO--tls.YYYY.com/cgi-bin/OOOO.cfg/services/soap"
binding="customBinding" bindingConfiguration="XXXXSyncBinding"
contract="XXXXService.XXXXSyncPort" name="XXXXSyncPort" />
</client>
该服务使用TLS 1.2并且正在将标题传递到标题中,如下所示
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
_client.ClientCredentials.UserName.UserName =&#34; XYXYXXYXY&#34 ;; _client.ClientCredentials.UserName.Password =&#34; XYXYXXYXY&amp; 123&#34;;
但是服务总是抛出异常
类型&#39; System.ServiceModel.Security.SecurityAccessDeniedException&#39;的例外情况发生在mscorlib.dll但未在用户代码中处理附加信息:拒绝访问
堆栈跟踪信息
服务器堆栈跟踪:
服务器堆栈跟踪: 在System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息回复,MessageFault错误,字符串操作,MessageVersion版本,FaultConverter faultConverter) 在System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime操作,ProxyRpc&amp; rpc) 在System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,Object [] outs,TimeSpan timeout) 在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作) 在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
在[0]处重新抛出异常: 在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData,Int32 type) at WhiteNowWI.WhiteNowService.WhiteNowSyncPort.RunAnalyticsReport(RunAnalyticsReportRequest request) 在C:\ RahulRathoreWork \ PMGWorkSpace \ GIT \ WhiteNow \ Service References \ WhiteNowService \ Reference.cs中的WhiteNowWI.WhiteNowService.WhiteNowSyncPortClient.WhiteNowWI.WhiteNowService.WhiteNowSyncPort.RunAnalyticsReport(RunAnalyticsReportRequest请求):第24711行 在C:\ XXXX \ XXX \ GIT \ XXX \ Service中的WhiteNowWI.WhiteNowService.WhiteNowSyncPortClient.RunAnalyticsReport(ClientInfoHeader ClientInfoHeader,AnalyticsReport AnalyticsReport,Int32 Limit,Int32 Start,String Delimiter,Boolean ReturnRawResult,Boolean DisableMTOM,Byte []&amp; FileData)参考文献\ X \ Reference.cs:第24723行 at WhiteNowWI.QueryReport.getData(String username,String password,Int32 report_ID,String delimiter)
有人可以帮助我。这将是一个很大的帮助。 谢谢!
答案 0 :(得分:0)
它已经解决。第三方服务的密码已经过期,我在向第三方服务提出支持请求后才知道这一点。