0

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?
}
Larsenal
  • 49,878
  • 43
  • 152
  • 220

2 Answers2

0
how to convert this part and attach to XML in android?
POST /SharingpointCheckBarcode.asmx HTTP/1.1
Host: awc.test.trin-it.nl
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/checkBarcode"
Wajeeha
  • 51
  • 1
  • 4
  • Should probably be posted as a separate question to get the best response. – Larsenal Aug 02 '12 at 15:18
  • i was new to stackoverflow didn't know how to post my question so i posted here, now i got knw and posted my question in separate post http://stackoverflow.com/questions/11814962/sending-xml-to-a-web-service-in-android – Wajeeha Aug 06 '12 at 05:16
0

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.

Larsenal
  • 49,878
  • 43
  • 152
  • 220
Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
  • What are the other possibilities? If I added the SoapHeader attribute to the constructor, would it be instantiated there? – Larsenal Apr 22 '09 at 20:43
  • Potentially, the key is that the soap header, is something that comes in with the message, so it isn't instantiated with values until a method call is actually made. – Mitchel Sellers Apr 22 '09 at 21:39