繁体   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