【问题标题】:Windows Phone 7 Application Deployment issues in Device设备中的 Windows Phone 7 应用程序部署问题
【发布时间】:2012-07-18 09:54:11
【问题描述】:

您好,这是我第一次使用我的 WP7 设备和 WCF,

我正在使用 WCF 服务与集中式数据库进行通信,当我尝试在模拟器中运行应用程序时它工作得非常好,但是当我将它部署到设备时,我收到以下错误消息

  EndPointNotFoundException
  There was no endpoint listening at http://10.11.32.211:88/ABCService/Service.svc
  that could accept the message. This is often caused by an incorrect address or SOAP 
  action. See InnerException, if present, for more details.

我的 Web.config 文件

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <!-- <client>
      <endpoint address="http://10.11.32.211:88/ABCService/Service.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IABCService"
        contract="ABCServiceReference.IABCService" name="BasicHttpBinding_IABCService" />
    </client> -->
    <bindings>

      <basicHttpBinding>
    <binding name="basicHttpBinding_ABCService" sendTimeout="00:01:30" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Buffered">

      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxNameTableCharCount="16384" maxBytesPerRead="2147483647" />
    </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
    <behavior>

      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="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="true" />
    </behavior>

      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  </configuration>

应用程序配置文件

 <configuration>
 <system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IABCService" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://10.11.32.211:88/ABCService/Service.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IABCService"
            contract="ABCServiceReference.IABCService" name="BasicHttpBinding_IABCService" />
    </client>
 </system.serviceModel>
 </configuration>

内部异常

"The remote server returned an error: NotFound."

堆栈跟踪

at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadPool.WorkItem.doWork(Object o)
at System.Threading.Timer.ring()

我使用 WIFI 连接到 My Lan

【问题讨论】:

  • 有innerException吗?如果可以,您可以发布详细信息吗?
  • 提示找不到网络服务。当您在模拟器中运行时,VS 是否可能会自动启动您的服务的调试副本,而当您在真机上测试时,该服务的副本没有运行?
  • 是否可以删除调试副本?
  • 从其他计算机,甚至在 Windows Phone 浏览器中,我也可以连接服务
  • 您的应用程序是否宣传它需要网络访问权限?我不知道这是否会影响未发布的应用程序,或者这是否也会破坏模拟器,但 WP7 应用程序的清单通常需要表明应用程序将访问网络。

标签: c# .net wcf windows-phone-7 endpoint


【解决方案1】:

我觉得你的endpoint IP10.11.32.211:88不是公开的,用手机就可以访问了

【讨论】:

    【解决方案2】:

    本地 DNS/路由器的问题,通过更改路由器和 DNS 中的设置解决

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-18
      相关资源
      最近更新 更多