简体   繁体   English

我无法从远程计算机访问我的服务

[英]I Cannot Access My Service From Remote Computer

Please Guide Me to Resolve my problem. 请指导我解决问题。

First, Let me Explain My Program. 首先,让我解释一下我的程序。

I have Created a Service For Balance Check (ie) if You are give input as a Account number, the web service will return the Balance of the Account. 我已经创建了一个余额查询服务(即),如果您将输入作为帐号输入,则Web服务将返回该帐户的余额。

Note: My Client Application is developed in windows store App. 注意:我的客户端应用程序是在Windows应用商店中开发的。

My WebConfig File as Follows: 我的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>

I can access the service from Local Computer. 我可以从本地计算机访问该服务。 When I deployed it on another machine it is not working. 当我将其部署到另一台计算机上时,它无法正常工作。 shows an error: 显示错误:

There was no endpoint listening at http://:8081/AccountBalance.svc/AccountBalance that could accept the message. 在http://:8081 / AccountBalance.svc / AccountBalance上没有侦听终结点的端点可以接受该消息。 This is often caused by an incorrect.... 这通常是由于不正确造成的。

I don't Know Much about the Config. 我对配置了解不多。 If anything wrong Please Let me know. 如果有任何问题,请通知我。

I have Hosted my Service in IIS. 我已经在IIS中托管了我的服务。 does any configuration that i have to do in IIS ? 在IIS中必须做任何配置吗?

  1. I was blocked the Firewall. 我被防火墙阻止了。
  2. Both the Systems is in the Same Network. 两个系统都在同一网络中。
  3. Tried with the System Name too instead of IP. 也尝试使用系统名称而不是IP。

what else could be the problem? 还有什么可能是问题? I have found More Number of the Related threads Found here but none of them helped me. 我在这里找到了更多相关线程,但是它们都没有帮助我。

Some of the Threads talking about change the Security From None to Transport. 一些正在讨论的线程将安全性从无更改为传输。 I was tried that too. 我也尝试过。 not worked. 没有用。

EDIT 1: 编辑1:

I was pissed off .. using WPF application i am able to access the service remotely. 我很生气..使用WPF应用程序,我能够远程访问该服务。 why im not able to access using windows store app.? 为什么我无法使用Windows Store应用访问。
guys help me fast . 伙计们帮我快。 im breaking my head on the store app :( 我在商店应用程序上打破了我的头:(

Answer :) 回答 :)

Simple, check the Private Networks(Client & Server) it is located at package.appmanifest-> capabilities :) 简单,检查位于package.appmanifest->功能中专用网络(客户端和服务器) :)

确保您在应用清单中声明了Private Networks (Client and Server) capability

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM