我要做的是在另一台服务器上设置对服务的调用。到目前为止..我已经创建了代理并获得了配置信息。
我找不到的是如何设置安全性。他们正在使用消息安全和客户端证书。
这是我的 app.config 文件..我到目前为止。有关设置安全性的任何信息都会有所帮助。我遇到的大多数示例都与设置服务和在托管端保护它有关。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="CCaRWebServiceSoap11Binding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="01:00:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="CCaRWebServiceSoap12Binding">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="serviceEndpoint1address/"
binding="basicHttpBinding" bindingConfiguration="CCaRWebServiceSoap11Binding"
contract="CCaRWebServicePortType" name="CCaRWebServiceHttpSoap11Endpoint" />
<endpoint address="serviceEndpoint2address/"
binding="customBinding" bindingConfiguration="CCaRWebServiceSoap12Binding"
contract="CCaRWebServicePortType" name="CCaRWebServiceHttpSoap12Endpoint" />
</client>
</system.serviceModel>
我有点被投入到这个项目中,所以 WCF 对我来说有点陌生。