I try set soap extension attributes on client side. For example:
Implementation in web service:
[AttributeUsage(AttributeTargets.Method)]
public class EncryptMessageAttribute : SoapExtensionAttribute
{
private string strKey="null";
public string StrKey
{
get { return strKey; }
set { strKey = value; }
}
}
Soap extension class:
public class EncryptMessage : SoapExtension
{
...
}
Used on web method:
[WebMethod]
[EncryptMessage( StrKey = "pass")]
public string test2()
{
return "ok";
}
Implementation in Proxy class:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/test", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[EncryptMessage( StrKey = "pass")]
public string test() {
object[] results = this.Invoke("test", new object[0]);
return ((string)(results[0]));
}
Soap extension attributes are::[EncryptMessage( StrKey = "pass")]
I want to set Soap Extension Attribute on client side, before than I use Soap Extension, when I call some web methods.
Example: I call some method, wich set soap extension attributes on both side, before than soap extension is used. Can somebody help me ?