Tom*_*son 9 .net wcf app-config
在app.config中为简化的WCF配置需要做的最小客户端设置是什么?
默认的是:
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
我可以排除什么,以及我需要多少?
编辑:我应该开始扯掉零件直到它破裂吗?我希望找到一些优秀的wsHttpBindings,让人们好运.
Jerograv是对的,因为这些都是默认值,你可以省略所有这些.为了测试这个,我创建了一个简单的服务并创建了所需的最小配置,这几乎就是地址,绑定和合同 -
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="http://sabra2/TestService/Service1.svc" binding="wsHttpBinding"
contract="IService1"/>
</client>
</system.serviceModel>
</configuration>
Run Code Online (Sandbox Code Playgroud)
只记得WCF的ABC.地址,装订,合同.这就是你所需要的!
您的客户端只需要有一个端点与WCF服务通信.每个端点只需要描述每个ABC,你就完成了.其他的东西可以在以后加以解决.
这就是我不喜欢在Visual Studio中添加服务引用的原因之一.