SoapHeader 字段何时在 ASMX 中实例化?

发布于 2024-07-17 02:54:09 字数 255 浏览 1 评论 0原文

考虑以下:

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?
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沉睡月亮 2024-07-24 02:54:09

在您的示例中,它将在执行 MyFunction 方法之前实例化。 因为需要标头才能执行 MyFunction 的操作。

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.

薯片软お妹 2024-07-24 02:54:09
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"
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"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文