对于具有自定义属性的C#方法,我们如何使用在属性构造函数中传递给实际方法的参数?

时间:2013-11-20 07:30:18

标签: c# web-services methods attributes

我有一个Web服务方法,它接受一个复杂的对象和一个字符串(ActionID)。对于以下示例,如何将ActionID传递给我的方法属性构造函数之一?

[TraceExtensions.TraceExtension(ActionID), System.Web.Services.Protocols.SoapDocumentMethodAttribute(" ", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("RCreateResponse", Namespace = "test")]
public WSRCResponse create([System.Xml.Serialization.XmlElementAttribute(Namespace = "test")] WSRCRequest RCreateRequest, string ActionID)
{
    object[] results = this.Invoke("create", new object[] { RCreateRequest });
    return ((WSRCResponse)(results[0]));
}

0 个答案:

没有答案