我在配置WCF服务时遇到了一些困难。我的要求是它公开了一个basicHttpBinding端点以及一个netTcpBinding端点。我的一些客户端是.NET 2.0,需要能够通过WSDL.exe生成代理。WCF基本的HTTP和NetTCP绑定,通过Mex暴露
它似乎工作的大部分 - 但是当我试图获得WSDL,它不合作。在浏览器中,它给了我一些SOAP XML标签,但绝对不是完整的WSDL。 WSDL.exe给了我一系列的错误:
错误:处理'http://1.2.3.4:9877/MyService/basicHttp?wsdl'时出错。
- 该文件被理解,但它无法处理。
- WSDL文档包含无法解析的链接。
- 下载'http:// localhost:9877/MyService/basicHttp?wsdl = wsdl0'时出错。
- 底层连接已关闭:无法连接到远程服务器。
这是我的主机配置。这里有什么东西会跳出来吗?
<system.serviceModel>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyRunner">
<endpoint address="netTcp" binding="netTcpBinding" bindingConfiguration="" contract="IMyRunner">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="basicHttp" binding="basicHttpBinding" bindingConfiguration="" contract="IMyRunner">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9876/MyService/netTcp" />
<add baseAddress="http://localhost:9877/MyService/basicHttp" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
请问您的请求是否需要.svc,例如'http://1.2.3.4:9876/MyService/basicHttp.svc?wsdl' – 2011-01-25 02:06:15
@Chris O:我不这么认为 - 服务本身工作正常罚款没有。如果这有所作为,我将托管在Windows服务中,而不是IIS。 – 2011-01-25 03:11:19