Search code examples
c#wcfuwpwindows-10-mobile

Consuming local WCF service on Windows 10 Mobile


I'm developing an app for Win10 Mobile (UWP platform). App has to connect to locally created WCF service. So I've created WCF service library from teamplate and changed methods so it looks like this:

[ServiceContract]
public interface IService1
{

    [OperationContract]
    void EchoPrimjer();
}

The Service1.cs implements interface public void EchoPrimjer() { //method }

Then I've added service reference to uwp project and added this code in uwp project:

        FiskalizacijaWCF.Service1Client client = new FiskalizacijaWCF.Service1Client();
        await client.OpenAsync();
        await client.EchoPrimjerAsync();

When I run the code the channel opens, but while calling method it throws exception: "An error occurred while sending the request". InnerText Source is "System.Net.Http". Source of exception is:"System.Private.ServiceModel".

I've checked appmanifest and the service starts normally.


Solution

  • Please check my reply in your another thread: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/2e09781c-e700-4863-af23-ed979ad1bd22/uwpwcfwin10mobile-consuming-local-wcf-service-on-windows-10-mobile?forum=wpdevelop

    Thanks.