Consider the following:
public MyCustomHeader MyHeader;
public New()
{
//MyHeader is NOT instantiated
}
[SoapHeader("MyHeader")]
[WebMethod()]
public bool MyFunction()
{
//MyHeader is instantiated, but when was it instantiated?
}
Consider the following:
public MyCustomHeader MyHeader;
public New()
{
//MyHeader is NOT instantiated
}
[SoapHeader("MyHeader")]
[WebMethod()]
public bool MyFunction()
{
//MyHeader is instantiated, but when was it instantiated?
}
In the case of your example, it would be instantiated just prior to the execution of the "MyFUnction" method. As the Header was needed to be able to perform the actions of MyFunction.