繁体   English   中英

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

[英]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. 我被防火墙阻止了。
  2. 两个系统都在同一网络中。
  3. 也尝试使用系统名称而不是IP。

还有什么可能是问题? 我在这里找到了更多相关线程,但是它们都没有帮助我。

一些正在讨论的线程将安全性从无更改为传输。 我也尝试过。 没有用。

编辑1:

我很生气..使用WPF应用程序,我能够远程访问该服务。 为什么我无法使用Windows Store应用访问。
伙计们帮我快。 我在商店应用程序上打破了我的头:(

回答 :)

简单,检查位于package.appmanifest->功能中专用网络(客户端和服务器) :)

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

暂无
暂无

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

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