【发布时间】:2014-08-19 04:08:43
【问题描述】:
我有一个 WCF 服务,如果我创建代理的项目(通过添加服务引用)与 WCF 服务在相同解决方案中,我可以为其创建代理.
但是,如果我尝试在与 WCF 服务(我确实在运行)不同的解决方案中的项目中添加服务引用,则无法找到端点。
这些消息谈论元数据,但我添加了以下暴露元数据的行为
<serviceMetadata httpGetEnabled="true" />
错误信息的详细信息是:
There was an error downloading 'http://localhost:8112/LTA/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 405: Method Not Allowed.
Metadata contains a reference that cannot be resolved: 'http://localhost:8112/LTA'.
There was no endpoint listening at http://localhost:8112/LTA that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.
有人知道问题出在哪里吗?整个 ServiceModel 元素是:
<system.serviceModel>
<services>
<service name="WCFLicenceService.LicenceTrackerService">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8112" />
</baseAddresses>
</host>
<endpoint address="LTS" binding="basicHttpBinding" contract="WCFLicenceService.ILicenceTrackerService" />
<endpoint
address="net.tcp://localhost:8113/LTS"
binding ="netTcpBinding"
contract="WCFLicenceService.ILicenceTrackerService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" />
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647"/>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
【问题讨论】:
标签: wcf