14
以下是我用我的测试应用程序的代码:WCF REST Webinvoke没有找到
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.IO;
namespace MyWCFServices
{
[ServiceContract]
interface IHelloWorldService
{
[OperationContract]
String GetMessage(String name);
//[OperationContract]
//[WebInvoke(Method = "PUT",UriTemplate = "File/{fileName}")]
//[WebContentType("application/octet-stream")]
// bool UploadFile(string fileName, Stream fileContents);
[OperationContract]
[WebInvoke(UriTemplate = "UploadFile/{fileName}")]
void UploadFile(string fileName, Stream fileContent);
}
}
它给错在编译的webinvoke。任何想法都一样?
WebContentType怎么样? – Ankit 2011-04-25 12:41:55
您使用的是什么版本的.NET/WCF? – 2011-04-25 12:42:57
我正在使用.NET 4.0(不是4.0客户端配置文件) – Ankit 2011-04-25 12:57:35