我写了wcf服务 一切工作正常,当我用http绑定在IIS7上部署它。WCF与netTCPBinding
我想使用netcp绑定在Windows进程激活服务(WAS)上部署它们。 当我尝试创建代理服务使用svcutil 我得到以下错误消息: 错误:无法从net.tcp获取元数据:// localhost/myservice/servi ce.svc 如果这是一个Windows(R )您有支持的Communication Foundation服务 ss,请检查您是否在指定的addr 处启用了元数据发布。有关启用元数据发布的帮助,请参阅MSDN文档中的http://go.microsoft.com/fwlink/?LinkId=65455。
WS-元数据交换错误 URI:的net.tcp://localhost/servicemodelsamples/service.svc 元数据包含无法解析的引用:“的net.tcp://本地主机/ servicemodelsamples/service.svc ”。
这里是web.config中:
<system.serviceModel>
<services>
<service name="MyProj.Myservice"behaviorConfiguration="CalculatorServiceBehavior">
<!--This endpoint is exposed at the base address provided by host: net.tcp://localhost/servicemodelsamples/service.svc -->
<endpoint binding="netTcpBinding" bindingConfiguration="PortSharingBinding"contract="MyProj.ICalculator" />
<!--the mex endpoint is explosed at net.tcp://localhost/servicemodelsamples/service.svc/mex -->
<endpoint address="mex"binding="mexTcpBinding"contract="IMetadataExchange" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="PortSharingBinding" portSharingEnabled="true">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<!--For debugging purposes set the includeExceptionDetailInFaults attribute to true-->
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
感谢,
您似乎在使用'localhost'作为您绑定的服务地址 - 您是否可以尝试使用计算机名称或IP地址呢?这有什么区别吗? – 2011-03-26 22:11:51