Consume a wcf Service with a Java Client

user963451 picture user963451 · Sep 25, 2011 · Viewed 11.7k times · Source

I try to consume a wcf service hosted on an iis with a simple java client.

my service is a basicHttpService.

now my Question. What do i need in java to access the service methods?

i build a little example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;


namespace android.Web
{
    [ServiceContract]
    public interface ITestService
    {
        [OperationContract]
        void DoWork();
        [WebGet(UriTemplate = "Login/")]
        String Login();
    }
}

the login Method only returns a simple string that want to test in my java client. I tried some tutorials found in the internet, but nothing wokrs ;)

thx alot.

Answer

Shiraz Bhaiji picture Shiraz Bhaiji · Sep 25, 2011

I do not think that your problem is due to a Java client.

You are using basicHttpBinding, at the same time you are using a WebGet attribute which points to using REST and webhttpbinding.

Try making sure that it works from a windows WCF client first.