【发布时间】:2012-03-11 07:56:20
【问题描述】:
[OperationContract]
[WebInvoke(UriTemplate = "createinvoice", Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
public Invoice CreateInvoice(string instance)
{
// TODO: Add the new instance of SampleItem to the collection
try
{
string icode = instance;
//decimal paid = instance.AmountPaid;
return new Invoice() {InvoiceCode = icode };
}
catch( Exception )
{
throw new NotImplementedException();
}
}
每次我在浏览器上运行它都会显示:
Method not allowed. Please see the service help page for constructing valid requests to the service.
有什么想法吗?此外,当我去浏览器上执行此操作时。它说找不到端点。 (Mobile) 是一个虚拟目录,而 (POS) 是 service1.cs 的注册路由
【问题讨论】: