WindowsPhone8エミュレーターに大きな問題があります。
最初にAzureプロジェクトがあり、このWebロールがいくつかのDomainServices(RIAサービス)を公開するWebRoleを持っています。
このDomainServicesをSOAPのように公開しましたが、Windows 8メトロスタイルやWPFアプリクライアントのような他のアプリでは、このサービスは正常に機能します。
しかし、私はこのサービスをWindows Phone 8エミュレーターで利用しようとしていますが、それはできません。
私はこの記事に従いました:WindowsPhone8エミュレーターからローカルWebサービスに接続する方法
もっと具体的にする必要があります:
WindowsAzureプロジェクトのwebRoleにWebサイトがあります。
このWebサイトには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メトロスタイルとWPFおよびこのサービスは正常に機能します。
次に、WindowsPhone8用の新しいアプリケーションを開発したいと思います。しかし、私はこのサービスを利用する必要があります。
ローカルマシンで、このサービスをエミュレーターに接続しようとしているので、調査したところ、エミュレーターが仮想マシンであり、IISExpressを構成する必要があることがわかりました。この記事に従いましたWindowsPhone8エミュレーターからローカルWebサービスに接続する方法
しかし、webRoleでホストされているサービスをWindowsPhone8エミュレーターに接続できません。
これが私のウェブサイトプロジェクトの構造です。
これは、LandingPageと呼ばれる私のWebRoleの構成であり、このWebロールにはサービスがあります。
これは、Applicationhost.config内のIISExpressの構成です。
<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>
これは、IISExpressで実行されているアプリケーションが記事とは異なるものです。
最後に、これはWindowsPhone8エミュレーターのサービスの構成です。
<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プロジェクトからプロジェクトを実行する必要があり、そのプロパティにIISExpressまたはIISWebサーバーを使用するオプションが存在するため、何かがおかしいと思います。
そして、これはWindowsPhoneEmulatorのエラーです。
{System.ServiceModel.CommunicationException:リモートサーバーがエラーを返しました:NotFound。---> System.Net.WebException:リモートサーバーがエラーを返しました:NotFound。---> System.Net.WebException:リモートサーバーがエラーを返しました:NotFound。System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)atSystem.Net.Browser.ClientHttpWebRequest。<>c__DisplayClasse.b__d(Object sendState)atSystem.Net.Browser.AsyncHelper。<>c__DisplayClass1.b__0(Object sendState) ---内部例外スタックトレースの終了---System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod、Object state)at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)atSystem.ServiceModel.Channels。 HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest。1.ChannelBase
1.EndInvoke(String methodName、Object [] args、IAsyncResult result)at AnimesideWP7.AuthService.AuthenticationServiceSoapClient.AuthenticationServiceSoapClientChannel.EndLogin(IAsyncResult result)at AnimesideWP7.AuthService.AuthenticationServiceSoapClient.AnimesideWP7.AuthService.AuthenticationServiceSoap.EndLogin(IAsyncResult AuthService.AuthenticationServiceSoapClient.OnEndLogin(IAsyncResult result)at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}
ご協力ありがとうございました 。
よろしく。