简体   繁体   中英

WCF & REST & SOAP

I have some ASMX web services that take in a string parameter and return a json string. They look like this:

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);
     }
}

For the moment, they work on IIS in HTTP. I want to move the app in Azure, and use WCF for the web services and make them work in HTTPS. What's the best way to do this?

Thanks.

Best way for a WCF service to return a JSON is to use webhttpbinding, see: http://msdn.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx

To secure it run it over HTTPS/SSL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM