none
Comparing WCF and ASHX RRS feed

  • Question

  • Currently we use ASHX service to provide data for the muti-platform like ios or andriod, however I would like to know if there is any advantage to use REST?

    Not quite familiar with REST service, I would like to know following things:

    1, Will REST runs faster than ASHX service? Currently the return format is a JSON.

    2, Can REST have some security implementation? I dont want others use my API to get data.

    3, Is there any migration cost on the app side if i use REST?

    Thanks


    • Edited by Jamles Hez Tuesday, March 8, 2016 4:57 AM
    Tuesday, March 8, 2016 4:53 AM

Answers

  • Hi James,

    >>could you tell me more about how ASHX and WCF comparsion?

    I am very sorry for the late reply.
    In my mind the WCF is a framework to handle asynchronous communication between 2 endpoints. Http/https and tcp are some options for the communication channel. ASHX is a feature of the asp.net framework for handling HttpRequests and modifying HttpResponses. It's a simple, generic handler for the asp.net framework.
    For the lower level handling of your web application's behaviours can be achieved with ASHX. If you want to provide more standardized services, I would recommend you use the WCF Service. Besides, as the @DA924x said the WebAPI is also a good choice.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, March 16, 2016 9:43 AM
    Moderator

All replies

  • Hi Jamles,

    What is the ASHX service? Do you mean the ASMX service? If so, please check the following information:

    >>1, Will REST runs faster than ASHX service? Currently the return format is a JSON.

    Yes, you are right, the WCF Rest service is a way faster, more flexible, more secure then the ASMX Service. Currently the return format for the WCF Rest Service is the json or xml. We can set the return format by using the following code:

      [WebInvoke(Method = "GET", 
       ResponseFormat = WebMessageFormat.Xml)]

    >>2, Can REST have some security implementation? I dont want others use my API to get data.

    Yes, if you do not want others to use your API, you can implement some security authentication in the WCF Rest Service, for example Windows Authentication, Basic Authentication, Certificate Authentication.
    For more information, please try to refer to the following articles:
    Windows Authentication on REST Enabled WCF Service.
    Basic Authentication on a WCF REST Service.
    Certificate Authentication for WCF REST Service.

    >>3, Is there any migration cost on the app side if i use REST?

    Do you mean that if there is any migration cost on muti-platform like ios or andriod when using the WCF Rest service? If so, in my mind it will be little migration cost, because the WCF Rest service supports the IOS and Andriod clients. Since its return type can be json, so it will be fast when using the Rest Service with the mobile clients.

    Best Regars,
    Amy Peng

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

     

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, March 9, 2016 11:51 AM
    Moderator
  • Hi Fang, 

    Sorry my fault, I mean the ASHX web handler not ASMX service, could you tell me more about how ASHX and WCF comparsion?

    Thanks

    James 

    Thursday, March 10, 2016 7:13 AM
  • Hi James,

    >>could you tell me more about how ASHX and WCF comparsion?

    I am very sorry for the late reply.
    In my mind the WCF is a framework to handle asynchronous communication between 2 endpoints. Http/https and tcp are some options for the communication channel. ASHX is a feature of the asp.net framework for handling HttpRequests and modifying HttpResponses. It's a simple, generic handler for the asp.net framework.
    For the lower level handling of your web application's behaviours can be achieved with ASHX. If you want to provide more standardized services, I would recommend you use the WCF Service. Besides, as the @DA924x said the WebAPI is also a good choice.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, March 16, 2016 9:43 AM
    Moderator