簡體   English   中英

沒有端點在移動設備上偵聽,但在控制台應用程序上工作正常

[英]There was no endpoint listening on mobile device but on console app works fine

我的計算機(而不是IIS)上托管了WCF服務。 當我從VS 2010調用函數時,此服務運行良好。但是,如果我想從Windows Mobile設備中調用某些方法,則會收到以下錯誤:沒有端點在監聽。...我的服務配置是:

    <?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="DataSource" value="CMP\DATABASE" />
    <add key="DataName" value="DAT" />
  </appSettings>
  <system.web>
    <compilation debug="true"/>
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <bindings>
      <mexHttpBinding>
        <binding name="MexBinding"/>
      </mexHttpBinding>
      <basicHttpBinding>
        <binding name="Binding" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
          <!-- UsernameToken over Transport Security -->
          <!--<security mode="Transport">
            <message clientCredentialType="Certificate" />
          </security>-->
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="Test.Service" behaviorConfiguration="Test.ServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://10.0.0.2:1918/Myservice/Service/"/>
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- Unless fully qualified, address is relative to base address supplied above -->
        <!--<endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary.IService">
          -->
        <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
        <!--
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>-->
        <!-- Metadata Endpoints -->
        <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
        <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

        <endpoint address="ServiceA" binding="basicHttpBinding" bindingConfiguration="Binding" name="Service" bindingName="Binding" contract="Test.IService"/>
      </service>
    </services>
    <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>-->
    <behaviors>
      <serviceBehaviors>
        <behavior name="Test.ServiceBehavior">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <!--<serviceAuthorization principalPermissionMode="None" />-->
          <!-- 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" />-->
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

我沒有在移動設備上設置代理。

您正在使用HttpBinding,因此某種類型的Web服務器正在您的機器上運行,從而允許WCF托管在本地工作。 這就是Cassini或IIS Express。 兩者都無需進行任何微調就不允許進行遠程連接。 以下是有關如何針對IIS Express進行操作的鏈接http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-comp電腦,但這可能有些乏味。 我不知道是否可以讓卡西尼號進行遠程連接。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM