[英]WCF & REST & SOAP
我有一些ASMX Web服务,它们接受一个字符串参数并返回一个json字符串。 他们看起来像这样:
WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class MyService : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
public string MyWebMethod1(string TheParameter1)
{
TheClassThatDoesTheWork MyClass = new TheClassThatDoesTheWork();
return MyClass.DoTheWork1(TheParameter);
}
[WebMethod(EnableSession = true)]
public string MyWebMethod2(string TheParameter2)
{
TheClassThatDoesTheWork MyClass = new TheClassThatDoesTheWork();
return MyClass.DoTheWork2(TheParameter);
}
}
目前,它们可以在HTTP中的IIS上工作。 我想在Azure中移动该应用程序,并将WCF用于Web服务,并使它们在HTTPS中工作。 最好的方法是什么?
谢谢。
WCF服务返回JSON的最佳方法是使用webhttpbinding,请参阅: http : //msdn.microsoft.com/zh-cn/library/system.servicemodel.webhttpbinding.aspx
要确保其安全,请通过HTTPS / SSL运行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.