1

如果我在引用 Web 服务之后查看 app.config 的输出,使用可视化 2010 服务引用向导,这就是我在basicHttpBindingapp.config 节点中得到的结果:

        <basicHttpBinding>
            <binding name="FirmNameServiceSOAPServiceSoapBinding" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01: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="Transport">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
            <binding name="FirmNameServiceSOAPServiceSoapBinding1" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01: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>

节点binding name="FirmNameServiceSOAPServiceSoapBinding"binding name="FirmNameServiceSOAPServiceSoapBinding1"完全重复。

你知道原因吗?它对某事有帮助吗?

4

2 回答 2

0

我的预感是你的服务暴露了多个BasicHttpBindings. 我会检查你的服务配置。

您可以通过在类似路径中找到的 WcfTestClient 看到她发生了什么:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WcfTestClient.exe
于 2013-03-05T14:44:23.290 回答
0

我只是评论了第二个<Binding>节点。然后,它仍然可以正确构建和执行。

我确实认为这是一个 MS Visual 2010 错误,它正在污染应用程序配置文件。当试图了解发生了什么时,这无济于事。

于 2013-03-05T14:33:09.333 回答