-2

Can anyone help me on how to call a C# WCF web service from Android Studio. My webservice is "http://192.168.1.100:93/MyService.svc?wsdl"

MyService.svc

namespace MyServiceApp
{
    public class MyService : IMyService
    {
       public string Hello(string strName)
        {
            string strResult="";
            strResult = "Hello " + strName;
            return strTest;
        }
    }
}

IMyService.cs

namespace MyServiceApp
{
    [ServiceContract]
    public interface IMyService
    {
        [OperationContract]
        string Hello(string strName);   
    }
}
Lupin
  • 1
  • 1

1 Answers1

0

There is no direct way to connect to WCF service from Android studio, but you can still consume it (WCF Service) as SOAP/POST.

To get you started - look at previous answer by Andy white - I'm using this approach as well and it is working quite well.

Note : You might want to inspect packets that service sends/gets via some tool like fiddler.

Alternatively for people that are using Xamarin (I know that it doesn't help in your situation, but it might be usefull for other people) - I would look at microsoft documentation (or SO if you like it more).

Vytautas Plečkaitis
  • 851
  • 1
  • 13
  • 19