locked
Windows APP failed to access WCF Services

    Question

  • Hello,

    I have created a windows store app which accesses wcf services. It worked on my development computer.

    I have published the wcf service and installed it on another computer (Computer A).  Then I have created an appx package of the windows app, by using Store->Create App Packages command from visual studio. I have also installed the app on the same computer, using powershell.

    I have started the wcf service and the windows app. But the windows app can not access the wcf web service. The error message is:"There is no endpoint listening on http://localhost:8080/dataservice".

    Then I have used remote debugger of visual studio 2013 to deploy the app from my development computer to the remote computer(Computer A). At this time, the app can access the wcf service.

    I have used two different methods to install the windows app on the remote computer (Computer A). With the deployment of the remote debugger, the app can access the wcf web service. But with powershell, it can not.

    I would like to figure out, why the app failed to access the wcf, when I installed it by using powershell? I appreciate your answers. Thanks very much.

    Colin

    Monday, October 27, 2014 5:26 PM

Answers

  • Colin,

    If your intended usage for your Windows Store app is for Enterprise side-loaded scenarios, then loopback communication is supported by adjusting the firewall policy. See the "Configuring the firewall" or CheckNetIsolation documentation here if you want to deploy your app outside of Visual Studio for side-loaded scenarios: http://msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx

    If you intend to publish your app to the Store, then loopback communication is not supported.

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by Colin218 Tuesday, October 28, 2014 8:40 AM
    Monday, October 27, 2014 10:59 PM
    Moderator

All replies

  • Colin - the address for your webservice is http://localhost, which always refers to the local machine. Windows Store apps which are in development and are being debugged may refer to locally-hosted services.  However, non-development apps (such as those deployed using powershell) may not refer to locally-hosted services.  This is a well-known, by-design limitation of Windows Store apps.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, October 27, 2014 7:28 PM
    Moderator
  • Hello Matt,

    thank you very much for your quick reply. I didn't know, that this is a limitation of windows store app.

    I have tried to host the wcf service on another computer. Now the windows app is able to access the wcf services, which are located on another computer. Non development app can not recognize localhost, local ip address.

    Is it the only solution to install the wcf service and the windows app on different computers?

    Thanks in advance.

    Monday, October 27, 2014 9:24 PM
  • Colin,

    If your intended usage for your Windows Store app is for Enterprise side-loaded scenarios, then loopback communication is supported by adjusting the firewall policy. See the "Configuring the firewall" or CheckNetIsolation documentation here if you want to deploy your app outside of Visual Studio for side-loaded scenarios: http://msdn.microsoft.com/en-us/library/windows/apps/dn640582.aspx

    If you intend to publish your app to the Store, then loopback communication is not supported.

    Thanks,

    Prashant


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    • Marked as answer by Colin218 Tuesday, October 28, 2014 8:40 AM
    Monday, October 27, 2014 10:59 PM
    Moderator
  • Thank you Prashant. Your answer is exactly what I need.
    Tuesday, October 28, 2014 8:41 AM