考虑以下:
public MyCustomHeader MyHeader;
public New()
{
//MyHeader is NOT instantiated
}
[SoapHeader("MyHeader")]
[WebMethod()]
public bool MyFunction()
{
//MyHeader is instantiated, but when was it instantiated?
}
在您的示例中,它将在方法执行之前被实例化MyFunction
。因为需要 Header 才能执行 MyFunction 的操作。
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"