我已经编写了 wcf 服务,当我使用 http 绑定在 IIS7 上部署它时一切正常。
我想使用 netcp 绑定在 Windows Process Activation Services (WAS) 上部署相同的内容。当我尝试使用 svcutil 为服务创建代理时,我收到以下错误消息:错误:无法从 net.tcp://localhost/myservice/service.svc 获取元数据如果这是 Windows (R) Communication Foundation 服务您有权访问 ss,请检查您是否已在指定地址启用元数据发布。有关启用元数据发布的帮助,请参阅位于http://go.microsoft.com/fwlink/?LinkId=65455的 MSDN 文档。
WS 元数据交换错误 URI:net.tcp://localhost/servicemodelsamples/service.svc 元数据包含无法解析的引用:“net.tcp://localhost/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>
谢谢,