csharp[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class SomeService : System.Web.Services.WebService
{
[WebMethod(Description = "我是描述信息")]
public void MethodName(string json)
{
// 当请求方发送一个随意的JSON参数: param,此时此处的 json 并不等同于 param
// 此处 json 映射的 是 param 中的 "json"属性,若 param 中不存在属性 "json", 则报错
var stream = HttpContext.Current.Request.InputStream;
stream.Position = 0; // 读取流之前把Position设置为0
var streamReader = new StreamReader(stream, Encoding.UTF8);
// 获取真正的 param
string param = streamReader.ReadToEnd();
// todo something
JObject data = null;
try
{
data = JObject.Parse(param);
}
catch (Exception ex)
{
Console.WriteLine("入参非json字符")
}
Context.Response.Flush();
Context.Response.Write(param);
Context.Response.End();
}
}
1、官方地址:https://multipass.run/
2、博客参考:
github:https://github.com/canonical/multipass
Multipass 使用笔记:http://wkdaily.cpolar.cn/archives/multipass
multipass 实战心得:https://www.jianshu.com/p/24b2a73fe6b2
配置Multipass外部储存位置:https://blog.csdn.net/sinat_41870148/article/details/130094471