Hi All,
I have a client application that used WSE 2.0 SP3.
I used SoapInputFilter class to create a custom filter and use the same
in the application. I used to register this customInputFilter into the
SoapInputFilterCollection, so WSE runtime can use this filter.
I also had to refer to a policy file that would apply on my requests to
the webservice.
But now i am migrating this application to use WSE 3.0.
For WSE to use the policyfile, I set the policy name specified in the
policyfile in the
application as
serverPolicy.SetPolicy(policyName);
For the filters in WSE 3.0 am using SoapFilter class to create my
custom input filter.
CustomInputFilter : SoapFilter
Now there is nothing called as SoapInputFilterCollection where i can
register this custom filter.
So i created a custom assertion using the Policy Assertion class and
overrided the 4 methods and specified my custom input filter in the
CreateClientInputFilter() function.
public override SoapFilter
CreateClientInputFilter(FilterCreationContext context)
{
return (new CustomInputFilter());
}
Later i created the policy and add the assertion on to this class.
public class CustomFilterPolicy : Policy
{
public CustomFilterPolicy()
: base(new PolicyAssertion[1]{new CustomFilterAssertion()})
{
}
}
So i can set this policy obejct in my client as
serverPolicy.SetPolicy(new CustomFilterPolicy());
So can i set both policy object and the policyname in the client
application using the SetPolicy( ).
Or there is some other way that i can use both filter and policy in the
application.
Regards
Immu
Pablo Cibraro - 02 Feb 2006 14:20 GMT
Hi,
Yes, you are approach is correct.
There is no need to develop a custom policy (Policy class) if you specify
your assertion as an extension in the WSE policy file.
Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax
http://www.lagash.com
> Hi All,
>
[quoted text clipped - 53 lines]
> Regards
> Immu