Search code examples
asp.netweb-servicessoapasmx

How do SOAP headers work in ASMX Web Services?


I have a project that uses an asmx file with [WebMethods] and [SoapHeader("Auth")]. I have no experience using SOAP and don't understand how it works yet.

Going through the code I noticed that you can use a variable with the same name as the header and it contains the data. How is the data sent to the header? Where does it come from?


Solution

  • The data comes from XML within the <soap:Header> section of the SOAP envelope.