Thanks for the quick response. I did not add clientpolicy to the proxy, But
now i do. Still not executing the ProcessMessage method
Microsoft.Web.Services3.WebServicesClientProtocol. And also i don not see a
setpolicy method in my web proxy class.
"Pablo Cibraro" wrote:
> Hi Ken,
>
> Did you set the "ClientPolicy" policy in the web service proxy ?. By the
> way, WSE 2.0 and WSE 3.0 are not interoperable, you are going to need a lot
> of plumbing code to make them work together.
>
> Regards,
> Pablo Cibraro
>
http://weblogs.asp.net/cibrax >
> "ksen" <ksen@discussions.microsoft.com> wrote in message
> news:7F501CF8-5867-43A8-B2B5-76EC8B5DF3C2@microsoft.com...
> >I have a webservice which is built on WSE 2.0.
> >
> > On the client side I am using .net2.0 and WSE 3.0. I added webreference to
> > the above webservice.
> > And also I added a custom filter to add some custom header elements.
> >
> > Here is my question
> > Why the custom filter ProcessMessage method is not getting executed when I
> > invoke a webmethod/
> > I would really appreciate you help.
> >
> >
> >
> > Here is some of my code from the web.config
> >
> > <configSections>
> > <section name="microsoft.web.services3"
> > type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration,
> > Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
> > PublicKeyToken=31bf3856ad364e35" />
> > </configSections>
> >
> > <microsoft.web.services3>
> > <policy filename="wse3policyCache.config"></policy>
> > <diagnostics>
> > <trace enabled="true" input="InputTrace.webinfo"
> > output="OutputTrace.webinfo" />
> > </diagnostics>
> > </microsoft.web.services3>
> >
> >
> > I created a configuration policy file called "wse3policyCache.config"
> >
> > policies xmlns="
http://schemas.microsoft.com/wse/2005/06/policy"> > > <extensions>
> > <extension name="requireActionHeader"
> > type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion,
> > Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
> > PublicKeyToken=31bf3856ad364e35" />
> > <extension name="customFilter"
> > type="CustomPolicy.CustomPolicyAssertion, CustomPolicy"/>
> > </extensions>
> > <policy name="ClientPolicy">
> > <requireActionHeader />
> > <customFilter />
> > </policy>
> > </policies>
> >
> > I created a policy assertion class(CustomPolicyAssertion) and soapfilter
> > class(ClientOutputFilter )
> >
> >
> > using System;
> > using System.Collections.Generic;
> > using System.Text;
> > using System.Security.Cryptography.X509Certificates;
> > using System.Xml;
> > using Microsoft.Web.Services3;
> > using Microsoft.Web.Services3.Design;
> > using Microsoft.Web.Services3.Security;
> > using Microsoft.Web.Services3.Security.Tokens;
> >
> >
> >
> > namespace CustomPolicy
> > {
> >
> > public class CustomPolicyAssertion: PolicyAssertion
> > {
> > public override SoapFilter CreateClientOutputFilter(FilterCreationContext
> > context)
> > {
> > return new ClientOutputFilter ();
> > }
> >
> > public override SoapFilter CreateClientInputFilter(FilterCreationContext
> > context)
> > {
> > return null;
> > }
> >
> > public override SoapFilter CreateServiceOutputFilter(FilterCreationContext
> > context)
> > {
> > return null;
> > }
> >
> > public override SoapFilter CreateServiceInputFilter(FilterCreationContext
> > context)
> > {
> > return null;
> > }
> > }
> > }
> >
> >
> > using Microsoft.Win32;
> > using System;
> > using System.Xml;
> > using Microsoft.Web.Services3;
> > using System.Diagnostics;
> >
> > namespace CustomPolicy
> > {
> > public class ClientOutputFilter : SoapFilter
> > {
> > public ClientOutputFilter()
> > {
> > }
> >
> > public override SoapFilterResult ProcessMessage(SoapEnvelope envelope)
> >
> > {
> > EventLog.WriteEntry("OutputFilter", "Processmessage");
> >
> > //write code here to modify
> >
> > return SoapFilterResult.Continue;
> > }
> > }
> > }
> >
>
>