【发布时间】:2017-03-28 00:31:06
【问题描述】:
我有一个简单的 wcf 肥皂服务。在visual studio中运行它并在localhost上运行
试图从提琴手访问 GetData 方法,但它给出了错误的请求 400。我做错了什么?
http://localhost:23150/Service1.svc/GetData?value=1
获取
服务:
[服务合同] 公共接口 IService1 {
[OperationContract]
string GetData(int value);
[OperationContract]
CompositeType GetDataUsingDataContract(CompositeType composite);
// TODO: Add your service operations here
}
public class Service1 : IService1
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
【问题讨论】:
-
您是否将 WCF 服务公开为 RESTful 服务?例如 - codeproject.com/Articles/590627/…
-
改用
SOAP UI。 -
我从来不知道我们可以使用 fiddler 调用 Web 服务:O.你在哪里实现了 GetData?贴出代码
-
还添加了GETData代码
-
当您的操作响应soap请求时,您应该使用SOAP UI。