[英]Consume a wcf Service with a Java Client
我嘗試使用簡單的Java客戶端使用iis上托管的wcf服務。
我的服務是一個basicHttpService。
現在我的問題。 我在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客戶端中測試的簡單字符串。 我嘗試了在互聯網上找到的一些教程,但沒有什么比較好的;)
多謝。
我不認為您的問題是由Java客戶端引起的。
您正在使用basicHttpBinding,同時您正在使用指向使用REST和webhttpbinding的WebGet屬性。
嘗試確保它首先從Windows WCF客戶端工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.