C# wcf测试客户端不支持此操作,因为它使用system.io.stream类型
当我运行示例WCF应用程序时,在WCF测试客户端窗口中出现以下错误C# wcf测试客户端不支持此操作,因为它使用system.io.stream类型,c#,wcf,web-services,C#,Wcf,Web Services,当我运行示例WCF应用程序时,在WCF测试客户端窗口中出现以下错误 This operation is not supported in the wcf test client because it uses type system.io.stream 我有一个ping方法,它在我的服务实现中使用流 public string Ping(Stream input) { var streamReader = new StreamReader(input)
This operation is not supported in the wcf test client because it uses type system.io.stream
我有一个ping方法,它在我的服务实现中使用流
public string Ping(Stream input)
{
var streamReader = new StreamReader(input);
string streamString = streamReader.ReadToEnd();
streamReader.Close();
NameValueCollection nvc = HttpUtility.ParseQueryString(streamString);
return string.IsNullOrEmpty(nvc["message"])
? "The 'message' key value pair was not received."
: nvc["message"];
}
在我的web.config文件中,我添加了
<basicHttpBinding>
<binding name="HttpStreaming" maxReceivedMessageSize="67108864" transferMode="Streamed" > </binding>
</basicHttpBinding>
我使用的Curl命令
curl -x 127.0.0.1:8888 http://localhost:8000/Service1.svc/ping -d message=pong
注意-X127.0.0.1:8888是供fiddler捕捉流量的
这是fiddler的结果
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 415 HTTP localhost:8000 /Service1.svc/ping 0 private curl:7440
您是否尝试过使用生成的代理而不是WCF测试客户端?是否可以发布使用Fiddler捕获的原始请求。另外,请向我们展示您的界面声明WCF Test Client@AlbertoSpelta不支持的功能列表。我读到的大多数地方都支持流媒体。这里有一个例子@Rajesh,我用fiddler回复和合同更新了帖子。
# Result Protocol Host URL Body Caching Content-Type Process Comments Custom
1 415 HTTP localhost:8000 /Service1.svc/ping 0 private curl:7440