我正在将我的WSE3服务迁移到WCF平台。客户将成为传统的WSE3客户端。
为了达到某些要求,我创建了自定义服务行为。服务行为的配置(在web.config
中)包含serviceCertificate
元素。
此行为适用于使用behaviorConfiguration
设置的服务。现在我想从同一IIS 7.5中托管的另一个WCF服务调用一个WCF服务。所以我添加了netTcpBinding
(以及netNamedPipeBinding)。当我从任何WCF服务调用另一个服务的OperationContract时,它曾经给我Access is denied.
错误。我删除了该服务的behaviorConfiguration
设置,然后netTcpBinding
(和netNamedPipeBinding)工作。
配置如下:
<services>
<service name="Services.AuthorizationService" behaviorConfiguration="LegacyBehavior">
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" >
<endpoint
name="AuthorizationService"
address=""
binding="wsHttpBinding" contract="ServiceContracts.IAuthorizationService" />
<endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
binding="netNamedPipeBinding" contract="ServiceContracts.IAuthorizationService"
name="AuthorizationNamedPipeEndpoint"/>
web.config中的服务行为配置为:
<behavior name="LegacyBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<serviceAuthorization
principalPermissionMode="Custom"
serviceAuthorizationManagerType="Legacy.AuthorizationManager,Legacy.Services" >
<serviceDebug
httpHelpPageEnabled="true"
includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
<serviceCredentials>
<serviceCertificate
findValue="CN=WSE2QuickStartServer"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectDistinguishedName" />
<issuedTokenAuthentication
audienceUriMode="Always"
certificateValidationMode="PeerOrChainTrust"
revocationMode="NoCheck"
trustedStoreLocation="LocalMachine"
samlSerializerType="Legacy.TokenSerializer, Legacy.Services"
allowUntrustedRsaIssuers="false">
<allowedAudienceUris>
<add allowedAudienceUri="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue/SAML" />
</allowedAudienceUris>
</issuedTokenAuthentication>
</serviceCredentials>
</behavior>
netTcpBinding
的绑定配置如下:
我想知道,
Access is denied
错误?
没有内在的例外;刚刚被Accedd拒绝了消息!