WSE 3 > VB.Net > CreateClientOutputFilter

WSE 3 > VB.Net > CreateClientOutputFilter

Post by SmVyb2V » Tue, 28 Mar 2006 07:51:34

I would like to add an UsernameToken to every outgoing wse request. I created
a custom clientoutputfilter and put the assertion together with a Policy in
my wse3Policycache. On the webservices server i have a custom usernametoken
manager wich validates the message.

Is it possible to define the custom filter for all wse3 webservice requests,
without defining the policy imperatively in code?

Otherwise i have to edit al my existing 2.0 Code, and set the policy

// create policy
Policy policy = new Policy();

// and set it to web service

WSE 3 > VB.Net > CreateClientOutputFilter

Post by Pablo Cibr » Tue, 28 Mar 2006 23:14:57


You can also define the policy declaratively by means of an attribute in the
web service proxy.
However, there is no way to apply security for all requests without
specifying a policy.

Pablo Cibraro


WSE 3 > VB.Net > CreateClientOutputFilter

Post by SmVyb2V » Thu, 30 Mar 2006 23:25:02

Hi Pablo,

Thanks for your reply, the reason i'm asking this, is because we are using
ObjectDatasources to fill datalists and other stuff. I can change the
typename for the objectdatasource to classname + Wse but I don't have the
option to add the wse policy imperatively. I have found a solution with
partial classes, but cannot get it to work.

Our policy contains an custom securitypolicyassertion with a
clientoutputfilter as SendSecurityFilter wich adds an usernametoken to the
security.tokens collection.

This is what i have tried:

Namespace svcSecurityService

<Microsoft.Web.Services3.Policy("FrontendWSESecurity")> _
Partial Class SecurityServiceWse
Inherits Microsoft.Web.Services3.WebServicesClientProtocol

End Class

End Namespace

' Tried this, but also didn't work
<Microsoft.Web.Services3.Policy("FrontendWSESecurity")> _
Partial Class monitoring
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Dim SecurityService As New svcSecurityService.SecurityServiceWse
'' // Toepassen policy op de webservice....

We are developing our webapplication entirely in VB.



WSE 3 > VB.Net > CreateClientOutputFilter

Post by SmVyb2V » Thu, 30 Mar 2006 23:32:02

The setpolicy used imperatively works like a charm.....

But i need the suggested class
<Microsoft.Web.Services3.Policy("FrontendWSESecurity")> attribute to work.....