0

我对 Windows Phone 8 模拟器有一个大问题。

首先我有一个 Azure 项目,我有一个 WebRole,这个 webrole 暴露了一些 DomainServices (RIA Services)。

我公开了这个 DomainServices 像 SOAP,以及其他应用程序,如 Windows 8 Metro 风格或 WPF 应用程序客户端,这些服务工作正常。

但是我尝试使用 Windows Phone 8 Emulator 使用此服务,但我做不到!

我关注了这篇文章:如何从 Windows Phone 8 模拟器连接到本地 Web 服务

我需要更具体:

我在 Windows Azure 项目的 webRole 中有一个网站。

这个网站有一个 DomainServices(RIA 服务),因为我里面有一个 Silverlight 应用程序。我用这个暴露了这个服务。

 <domainServices>
  <endpoints>
    <add name="Soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory,
         Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, 
         Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </endpoints>
</domainServices>

我可以将此服务与其他应用程序一起使用。Windows Metro Style 和 WPF 以及此服务工作正常。

现在,我想为 Windows Phone 8 开发一个新的应用程序。但我需要使用这些服务。

在我的本地机器中,我尝试将此服务与模拟器连接,因此,我研究并发现模拟器是虚拟机,我需要配置 IIS Express。我关注了这篇文章如何从 Windows Phone 8 模拟器连接到本地 Web 服务

但我无法将托管在 webRole 中的服务与 Windows Phone 8 Emulator 连接起来。

这是我的网站项目的结构: 项目结构

这是我的 WebRole 的配置,称为 LandingPage,此 Web 角色具有服务。 在此处输入图像描述

这是 Applicationhost.config 中 IIS Express 的配置。

 <site name="LandingPage" id="2">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="E:\AnimesideFinal\AnimesideWebsite\LandingPage" />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:24939:localhost" />
        <binding protocol="http" bindingInformation="*:24939:192.168.2.114" />
            </bindings>
        </site>

这是运行在 IIS Express 中的应用程序不同的文章。 在此处输入图像描述

最后这是 Windows Phone 8 模拟器中服务的配置。

<configuration>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_AuthenticationServiceSoap" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://192.168.2.114/Services/LandingPage-Services-AuthenticationService.svc/Soap"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_AuthenticationServiceSoap"
            contract="AuthService.AuthenticationServiceSoap" name="BasicHttpBinding_AuthenticationServiceSoap" />
    </client>
</system.serviceModel>

我按照文章的所有步骤都没有结果。我认为出了点问题,因为我需要从 Azure 项目运行我的项目,并且在该项目的属性中存在使用 IIS express 或 IIS Web 服务器的选项。 在此处输入图像描述

这是Windows Phone Emulator 的错误。

{System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound。---> System.Net.WebException:远程服务器返回错误:NotFound。---> System.Net.WebException:远程服务器返回错误:NotFound。在 System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 在 System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.b__d(Object sendState) 在 System.Net.Browser.AsyncHelper.<>c__DisplayClass1.b__0(Object sendState) --- 内部异常堆栈跟踪结束 --- System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) 在 System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 在 System.ServiceModel.Channels。 HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest。1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at AnimesideWP7.AuthService.AuthenticationServiceSoapClient.AuthenticationServiceSoapClientChannel.EndLogin(IAsyncResult result) at AnimesideWP7.AuthService.AuthenticationServiceSoapClient.AnimesideWP7.AuthService.AuthenticationServiceSoap.EndLogin(IAsyncResult result) at AnimesideWP7。 AuthService.AuthenticationServiceSoapClient.OnEndLogin(IAsyncResult 结果) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult 结果)}

谢谢您的帮助 。

问候。

4

1 回答 1

0

请参阅 iis express 解决方案部分

http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580(v=vs.105).aspx

于 2013-03-21T21:28:54.693 回答