繁体   English   中英

谁能告诉我SoapDocumentMethodAttribute做什么?

[英]Can anyone tell me what SoapDocumentMethodAttribute does?

谁能向我解释以下代码的作用? 具体来说,是GetStatus方法的属性。 我知道它与SOAP请求有关,但是我尝试使用Google搜索“ SoapDocumentMethodAttribute”,但发现的内容不足以说明问题。 有人可以为我哑巴吗?

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://dummyurl.com/", RequestNamespace = "http://dummyurl.com/", ResponseNamespace = "http://dummyurl.com/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    public string GetStatus(string Username, string Password, string EndSystemUser) {
        object[] results = this.Invoke("GetStatus", new object[] {
                    Username,
                    Password,
                    EndSystemUser});
        return ((string)(results[0]));
    }

肥皂服务向WSDL提供给使用者,该使用者包含有关如何编写SOAP消息的信息。

可以以RPC样式或文档样式编写此WSDL。

文档样式优于RPC样式,因为它意味着较少的耦合,并提供了更好的方法来验证消息。

此属性指示WSDL生成器使用Document Style

MSDN文档中:

Web服务描述语言(WSDL)为XML Web服务方法(称为操作)如何在SOAP消息中格式化提供了两种样式:RPC和Document。 文档是指根据XSD架构格式化XML Web服务方法。 文档样式是指将Body元素格式化为在Body元素之后的一系列一个或多个消息部分。

请参考此链接以获取RPC /文档样式的示例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM