我正在运行由 Windows 窗体客户端使用的 WCF 服务。我在服务器上使用 Windows 身份验证,并且 WCF 服务工作正常。除一项功能外,服务中实现的所有功能在客户端应用程序上都可以正常工作。我检查了该功能的服务代码[DataContract]
, [OperationContract]
甚至使用 SvcLogViewer.exe 检查了 Svc 日志。但功能不断提高NullReferenceException
。我从 SvcLog 发现的异常是
The specified domain either does not exist or could not be contacted
此功能在本地服务器上运行良好,但在远程服务器上运行良好。我想知道这是发生此异常的原因,以下是我的 ServiceModel 代码:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="Wrabind" closeTimeout="00:05:00" openTimeout="00:05:00" sendTimeout="00:25:00">
<textMessageEncoding/>
<security authenticationMode="SecureConversation" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings maxClockSkew="00:30:00" />
<localServiceSettings maxClockSkew="00:30:00" />
<secureConversationBootstrap messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings maxClockSkew="00:30:00" />
<localServiceSettings maxClockSkew="00:30:00" />
</secureConversationBootstrap>
</security>
<httpTransport maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000" allowCookies="true" maxBufferSize="20000000" />
</binding>
</customBinding>
</bindings>
<services>
<service behaviorConfiguration="WCoreService.Service1Behavior" name="WCoreService.Service1">
<endpoint address="http://subdomain.domain.com/service1.svc" binding="customBinding" bindingConfiguration="Wrabind" contract="WCoreService.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCoreService.Service1Behavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://subdomain.domain.com/" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
</system.serviceModel>