我寫了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