views:

62

answers:

2

i saw that in asp.net .asmx file, we create webservices

[webmethod]
//method definition here

now for soap webservice

[webmethod]
[SoapHeader(some parameters here)]
//method defination here

my question is what's the difference between both webservices type and how to choose which service type to choose

+3  A: 

There really isn't. A standard webmethod is still transported using soap. The second one just has a custom SoapHeader attached to it. This is commonly used when using authorization to perform access control to the webservice or to post special header information along with the standard service request.

Try this as an example: http://www.codeproject.com/KB/cpp/authforwebservices.aspx

Joel Etherton
A: 

You could be confusing what you've heard about WCF and ASMX web services. Microsoft considers ASMX services to be "legacy technology", anad say that all new web service development should be done using WCF.

John Saunders