Andy Kendall said:
Sure, but then whats different about that scenario and the one I first
tried
where I had an identical class definition (with same namespace) in my soap
extension project?
I know there must be something in the serialised xml telling the runtime
that the serialised soapheader represents the soapheader class defined in
my
web service and not the (identical) one defined in the soapextension
assembly - but I don't know what it is.
I'm not sure of the step by step details, but it's something like this:
1) IIS receives a request directed at some file with a .asmx extension
2) Since there's a sctipt mapping between that extension and ASP.NET, the
request is sent to the ASP.NET worker process
3) The worker process looks at the file extension, and maps it to a
HttpHandler subclass, in this case, WebServiceHandler (I think)
4) WebServiceHandler opens the .asmx file and, based on its contents,
determines which WebService-derived class to use.
5) Based on the metadata on this class, it matches the incoming SOAP message
to a WebMethod
6) Based on the metadata on this WebMethod, it deserializes the SOAP message
6a) You have one or more [SoapHeader] attributes on your WebMethods, right?
6b) Each SoapHeader attribute refers to a public field in your WebService.
6c) The field has a type and maybe other attributes, which guide
deserialization of any matching SOAP headers in the message
So, no magic, just a bit of work going on in the background.
John