none
Any benefits of using WCF client to access ASMX service? RRS feed

  • Question

  • Hi,

    In an existing client application we are hitting an ASMX service using ASMX client reference. Someone suggested to rewrite the client to WCF - for reasons unknown. So I wonder: Are there any benefits of deleting the old AMSX proxy classes and create a WCF client access instead?

    Are there perhaps any cons of doing so? For example, though the WCF client would use the XmlSerializer, perhaps there are some very complex data structures that the client doesn't support?

    -- 
    Werner



    Wednesday, December 4, 2013 10:49 AM

All replies

  • WCF provides tons and tons of flexibility over asmx in terms of transport layer mechanisms, bindings etc.

    http://www.bishoylabib.com/2009/08/comparing-asmx-and-wcf.html

    http://msdn.microsoft.com/en-us/library/ff648181.aspx

    Wednesday, December 11, 2013 2:31 AM
  • You are answering in general terms about WCF service. I'm asking about a WCF client. Obviously the WCF client also has a ton of binding possibilities but that doesn't matter as the service is standard ASMX.

    Wednesday, December 11, 2013 9:31 AM
  • Hi,

    Web service proxies for asmx web services are quite annoying. They are supposed to represent the contract between the service and the client and without any doubt there should be such a contract. But in reality they represent not only the contract between the service and the client but also the tool that generates them. And they make you vulnerable to any inefficiencies of that tool. Do you like to be dependant in such a way?

    Well, fortunately WCF offers much better approach. The contract between the service and the client is represented by an interface decorated with the right attributes. That is all you need for the contract between the client and the server. There is no third party involved and everything is clear.

    For more information, please try to refer to:
    #WCF Client for ASMX Web Service:
    http://blog.bodurov.com/Create-a-WCF-Client-for-ASMX-Web-Service-Without-Using-Web-Proxy/ .

    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.

    Thursday, December 19, 2013 8:11 AM
    Moderator
  • Hi,

    Web service proxies for asmx web services are quite annoying. They are supposed to represent the contract between the service and the client and without any doubt there should be such a contract. But in reality they represent not only the contract between the service and the client but also the tool that generates them. And they make you vulnerable to any inefficiencies of that tool. Do you like to be dependant in such a way?

    Well, fortunately WCF offers much better approach. The contract between the service and the client is represented by an interface decorated with the right attributes. That is all you need for the contract between the client and the server. There is no third party involved and everything is clear.

    For more information, please try to refer to:
    #WCF Client for ASMX Web Service:
    http://blog.bodurov.com/Create-a-WCF-Client-for-ASMX-Web-Service-Without-Using-Web-Proxy/ .

    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.

    Hi Amy, 

    Not sure I follow this reasoning. If you take the example from your link, the ASMX service delivers some "BusinessObj" class. Surely this class isn't handmade, but instead built by VS when reading the WSDL. How does that differ from the old fashion proxy classes?

    -- 
    Werner

    Monday, December 23, 2013 8:25 AM