[英]I Cannot Access My Service From Remote Computer
請指導我解決問題。
首先,讓我解釋一下我的程序。
我已經創建了一個余額查詢服務(即),如果您將輸入作為帳號輸入,則Web服務將返回該帳戶的余額。
注意:我的客戶端應用程序是在Windows應用商店中開發的。
我的WebConfig文件如下:
<system.serviceModel>
<services>
<service name="AccountBalance">
<endpoint contract="IAccountBalance"
address="AccountBalance"
binding="basicHttpBinding">
</endpoint>
<endpoint address="AccountBalance/MEX/"
binding="mexHttpBinding"
contract="IMetadataExchange">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://192.168.1.8:8081/AccountBalance.svc"/>
</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="8081" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我可以從本地計算機訪問該服務。 當我將其部署到另一台計算機上時,它無法正常工作。 顯示錯誤:
在http://:8081 / AccountBalance.svc / AccountBalance上沒有偵聽終結點的端點可以接受該消息。 這通常是由於不正確造成的。
我對配置了解不多。 如果有任何問題,請通知我。
我已經在IIS中托管了我的服務。 在IIS中必須做任何配置嗎?
還有什么可能是問題? 我在這里找到了更多相關線程,但是它們都沒有幫助我。
一些正在討論的線程將安全性從無更改為傳輸。 我也嘗試過。 沒有用。
編輯1:
我很生氣..使用WPF應用程序,我能夠遠程訪問該服務。 為什么我無法使用Windows Store應用訪問。 –
伙計們幫我快。 我在商店應用程序上打破了我的頭:(
回答 :)
簡單,檢查位於package.appmanifest->功能中的專用網絡(客戶端和服務器) :)
確保您在應用清單中聲明了Private Networks (Client and Server) capability
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.