tags:

views:

49

answers:

1

Hello,

I have been doing a lot of work with WCF "self" hosted applications. I recently was requested to write a web service where the calling client was a Linux based program named "WGET". I would like to use WCF instead of a traditional ASMX web service. The web service is returning a standard XML response. I am not sure of the underlining details between the two technologies but I know WCF is the proper route. I created a WCF service to be hosted in IIS ( using basicHttpBinding).

1.) Did classic ASMX web services ( standard HTTP POST/GET) use SOAP to return responses? I created an class from XSD for the web service response. What is really going on behind the scenes? Is there just special XML HTTP headers that know how to handle to response? Is the response not wrapped in SOAP? The traditional ASMX web service worked perfectly with the class I generated using the .Net "XSD" program.

2.) I want to use WCF for this service. Will using basicHttpBinding work? As I have read, that is the correct binding to use for ASMX clients. Does this use SOAP, standard HTTP headers, or something else?

3.) This is a dumb question because I have not done a lot of web service programming. I noticed on the ASMX default landing page there were examples for responses and code to invoke the functionality. When I create the same service using WCF, I had to create a client application to perform these tasks. Is there a way to expose the WCF endpoint like a classic ASMX service or is the WSDL the only route?

As always, I really appreciate the feedback.

Thanks, Brennan

+3  A: 

To answer your questions:

1.) Did classic ASMX web services ( standard HTTP POST/GET) use SOAP to return responses?

Yes. ASMX is using the SOAP 1.1 standard, which is implemented in WCF also.

2.) I want to use WCF for this service. Will using basicHttpBinding work?

The basicHttpBinding is the perfect match for mimicking an ASMX service, yes. It's using SOAP 1.1 just like ASMX, and should behave quite like ASMX.

3.) I noticed on the ASMX default landing page there were examples for responses and code to invoke the functionality. Is there a way to expose the WCF endpoint like a classic ASMX service or is the WSDL the only route?

WCF only shows a default page to give you an idea that there is indeed a service. There are no knobs or options to turn on to get the same ASMX-style page (for security reasons). If you need to, you would have to do this yourself. WSDL / XSD is really the way to go with WCF.

marc_s
Thanks Marc! I appreciate the response.
Brennan Mann