3

我尝试使用一个简单的 java 客户端来使用托管在 iis 上的 wcf 服务。

我的服务是一个基本的HttpService。

现在我的问题。我在 java 中需要什么来访问服务方法?

我建立了一个小例子:

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();
    }
}

login 方法只返回一个想要在我的 java 客户端中测试的简单字符串。我尝试了一些在互联网上找到的教程,但没有任何工作;)

多谢。

4

1 回答 1

1

我不认为您的问题是由于 Java 客户端造成的。

您正在使用 basicHttpBinding,同时您正在使用指向使用 REST 和 webhttpbinding 的 WebGet 属性。

首先尝试确保它可以从 Windows WCF 客户端运行。

于 2011-09-25T17:29:08.913 回答