title: Access to Local Azure WCF Service from Windows Phone 8 Emulator
body: <p>I have a big problem with the Windows Phone 8 Emulator.</p>
  
  <p>First I have an Azure project ,I have a WebRole this webrole expose some DomainServices (RIA Services) .</p>
  
  <p>I exposed this DomainServices like SOAP, with others Apps like Windows 8 metro style or WPF app clients this services work fine.</p>
  
  <p>But I trying to consume this services with Windows Phone 8 Emulator and I can't do that!.</p>
  
  <p>I followed this article: <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580%28v=vs.105%29.aspx" rel="nofollow noreferrer">How to connect to a local web service from the Windows Phone 8 emulator</a></p>
  
  <p>I need to be more specific:</p>
  
  <p>I have a website in a webRole of Windows Azure Project.</p>
  
  <p>This website has a DomainServices (RIA Services) because I have a Silverlight Application inside.
  I exposed this services with this.</p>
  
  <pre><code> &lt;domainServices&gt;
    &lt;endpoints&gt;
      &lt;add name="Soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory,
           Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, 
           Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
    &lt;/endpoints&gt;
  &lt;/domainServices&gt;
  </code></pre>
  
  <p>I can consume this services with other apps. Windows metro Style and WPF and this services work fine.</p>
  
  <p>Now, I want to develop a new application for Windows Phone 8 . But I need to consume this services.</p>
  
  <p>In my local machine , I trying to connect this services with the emulator so, I researching and I found the emulator is a Virtual Machine and I need to configure IIS Express. 
  I followed this article <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580%28v=vs.105%29.aspx" rel="nofollow noreferrer">How to connect to a local web service from the Windows Phone 8 emulator</a></p>
  
  <p>But I can't connect my Services hosted in the webRole with Windows Phone 8 Emulator.</p>
  
  <p>This is the structure of my Website Project:
  <img src="https://i.stack.imgur.com/rQKn0.jpg" alt="Project Structure"></p>
  
  <p>This the configuration of my WebRole Called LandingPage this web role has the services.
  <img src="https://i.stack.imgur.com/IoCCi.png" alt="enter image description here"></p>
  
  <p>This the configuration of IIS Express inside of Applicationhost.config.</p>
  
  <pre><code> &lt;site name="LandingPage" id="2"&gt;
              &lt;application path="/" applicationPool="Clr4IntegratedAppPool"&gt;
                  &lt;virtualDirectory path="/" physicalPath="E:\AnimesideFinal\AnimesideWebsite\LandingPage" /&gt;
              &lt;/application&gt;
              &lt;bindings&gt;
                  &lt;binding protocol="http" bindingInformation="*:24939:localhost" /&gt;
          &lt;binding protocol="http" bindingInformation="*:24939:192.168.2.114" /&gt;
              &lt;/bindings&gt;
          &lt;/site&gt;
  </code></pre>
  
  <p>This is the applications running in IIS Express is different of the Article.
  <img src="https://i.stack.imgur.com/7bXSh.jpg" alt="enter image description here"></p>
  
  <p>Finally this is the Config of the service in the Windows Phone 8 emulator.</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="BasicHttpBinding_AuthenticationServiceSoap" maxBufferSize="2147483647"
                  maxReceivedMessageSize="2147483647"&gt;
                  &lt;security mode="None" /&gt;
              &lt;/binding&gt;
          &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://192.168.2.114/Services/LandingPage-Services-AuthenticationService.svc/Soap"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_AuthenticationServiceSoap"
              contract="AuthService.AuthenticationServiceSoap" name="BasicHttpBinding_AuthenticationServiceSoap" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p></p>
  
  <p>I followed all Steps of the article without results . I think something is wrong because I need to run my project from the Azure proj and in the properties of that exist the option to use IIS express or IIS web server.
  <img src="https://i.stack.imgur.com/THwKj.png" alt="enter image description here"></p>
  
  <p>And this is the error of Windows Phone Emulator.</p>
  
  <p>{System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
     at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
     at System.Net.Browser.ClientHttpWebRequest.&lt;>c__DisplayClasse.b__d(Object sendState)
     at System.Net.Browser.AsyncHelper.&lt;>c__DisplayClass1.b__0(Object sendState)
     --- End of inner exception stack trace ---
     at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
     at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
     --- End of inner exception stack trace ---
     at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
     at System.ServiceModel.ClientBase<code>1.ChannelBase</code>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 result)
     at AnimesideWP7.AuthService.AuthenticationServiceSoapClient.OnEndLogin(IAsyncResult result)
     at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}</p>
  
  <p>Thank you for your help .</p>
  
  <p>Regards.</p>