我一直在尋找解決方案來解決我的問題,嘗試了各種建議,但到目前爲止還沒有人爲我工作。從局域網中的另一臺計算機訪問我的WCF服務
我可以在本地完美地訪問WCF服務,但似乎無法從正常LAN網絡中的另一臺計算機訪問它。
注意:我不是WCF的專家,但在研究中做了我公平的分享。我嘗試了不同的綁定,netTcpBinding
不適用於我,因爲我得到了不支持的錯誤。
另外,我的防火牆已關閉,所以我很確定它不是防火牆問題,而我是Visual Studio的內置Web服務器,我不知道如何通過IIS託管它,或者在哪裏開始這樣做。
<system.serviceModel>
<services>
<service name="WCFService.TorrentService">
<endpoint contract="WCFService.ITorrentService"
address="TorrentService"
binding="basicHttpBinding">
</endpoint>
<endpoint address="TorrentService/MEX/"
binding="mexHttpBinding"
contract="IMetadataExchange">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://192.168.7.111:3697/TorrentService"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="http" port="3697" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
Im相當肯定有很多的東西那不是應該在那裏的配置文件,因爲我已經嘗試了很多不同的解決方案,但至今沒有一個爲我工作。
當我嘗試從另一臺計算機訪問該服務,通過執行以下操作
http://s8.postimg.org/yqps7k6f9/untitled.png
[本地網絡中的WCF服務]的可能的重複(http://stackoverflow.com/questions/15421518/wcf-service-in-local-network) –
你將有更好的運氣將您的錯誤粘貼爲文本而不是作爲圖像,但我會爲你修復你的圖像。 – gunr2171
您需要將您的服務發佈到IIS –