我试图从Android客户端发送一个字符串到.NET服务器.以下是服务器端代码: - IService1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
namespace WcfImageUpload
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebInvoke(UriTemplate = "/JsonData",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json, Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest)]
JsonString SendData(JsonString JsonImage);
// TODO: Add your service operations here
}
// Use a …Run Code Online (Sandbox Code Playgroud) WCF中的webHttp和enableWebScript有什么区别?我应该将哪个用于WCF REST POST请求?