我使用 WCF REST Service Template 40(CS)创建了一个 Web 服务。当我尝试使用它来消耗它时
var request = WebRequest.Create(string.Concat(serviceUrl, resourceUrl)) as HttpWebRequest;
if (method == "POST" && requestBody != null)
{
byte[] requestBodyBytes = ToByteArrayUsingJsonContractSer(requestBody);
request.ContentLength = requestBodyBytes.Length;
using (Stream postStream = request.GetRequestStream())
postStream.Write(requestBodyBytes, 0, requestBodyBytes.Length);
}
var response = request.GetResponse() as HttpWebResponse;
我不断得到:
操作已超时
如何增加超时?我是否需要在服务或使用此服务的客户端中增加它的 url:
http://myservice.com/RecordingCompleted/
请建议