Using SoapExtensionAttributes on client side with async web methods
- by Maxim Polishchuk
Hey,
I have a simple question. I implemented custom soap extension and registered it into client application configuration file. It works fine.
(I would like to implement progress bar functionality like http://msdn.microsoft.com/en-us/library/aa480520.aspx)
But I don't like some thing - custom soap extension is invoked by every call of my web service. In order to fix this situation (call WS just by required methods) I implemented custom SoapExtensionAttribute like below:
[AttributeUsage(AttributeTargets.Method)]
public class CustomSoapExtensionAttribute : SoapExtensionAttribute
{
public override int Priority { get; set; }
public CustomSoapExtensionAttribute() : this (1)
{
}
public CustomSoapExtensionAttribute(int priority)
{
Priority = priority;
}
public override Type ExtensionType
{
get { return typeof(CustomSoapExtension); }
}
}
I added this attribute to required methods of web service proxy classes (and removed registration into client configuration file).
My soap extension doesn't invoke when required web methods are calling.
Can someone help me to solve this problem or select any other solution?
Anotherone, I don't know it is important or not - my required methods are async web methods.
Best regards, Maxim