How canI set soap extension attribute on client side:
For example:
Code on service side:
[AttributeUsage(AttributeTargets.Method)]
public class EncryptMessageAttribute : SoapExtensionAttribute
{
private string[] xPathExpressionArray = new string[] {
"/soap:Envelope"};
public string StrKey
{
get {
return strKey;
}
set {
strKey = value;
}
}
public override Type ExtensionType
{
get
{
return typeof(EncryptMessage);
}
}
public override int Priority
{
get
{
return 0;
}
set
{
}
}
public string XPathEncryption
{
get
{
StringBuilder sb = new StringBuilder();
foreach (string query in xPathExpressionArray)
{
sb.Append(query);
sb.Append(',');
}
return sb.ToString(0, sb.Length - 1);
}
set
{
xPathExpressionArray = value.Split(',');
}
}
internal string[] XPathExpressionArray
{
get
{
return xPathExpressionArray;
}
}
}
Soap extension class:
public class EncryptMessage : SoapExtension
{
...
}
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(XPathEncryption = "//soap:Body/*/*", StrKey = "pass")]
public string test() {
object[] results = this.Invoke("test", new object[0]);
return ((string)(results[0]));
}
Soap extension attributes are:[EncryptMessage(XPathEncryption =
"//soap:Body/*/*", StrKey =
"pass")]
I can not call methods from class EncryptMessageAttribute : SoapExtensionAttribute in proxy class on client side . I want set soap attributes on server side and client side before I use soap extension in web methodos. Example: I call some method, wich set soap extension attributes on both side, before than soap extension is used. Can somebody help me ?