Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2006

Tip: Looking for answers? Try searching our database.

customize WSE policy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hung Ngo - 18 May 2006 05:29 GMT
I have the below source code:
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Policy("ServicePolicy")> _  '(or <Policy(GetType(UsernamePolicy))> _ )
Public Class Service
   Inherits System.Web.Services.WebService
   <WebMethod()> _
   Public Function test1() As String
       Return "Test1 Function Called"
   End Function

   <WebMethod()> _
   Public Function test2() As String
       Return "Test2 Function Called"
   End Function
End Class 'Service

Now I want to do 2 things:

1. The policy will be only applied for test1 Function, not Function test2()
(  some things like that:
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
   Inherits System.Web.Services.WebService
'The policy will be applied for test1 function
  <Policy("ServicePolicy")> _
  <WebMethod()> _
   Public Function test1() As String
       Return "Test1 Function Called"
   End Function
'and the policy will not be applied for test2 function
  <WebMethod()> _
   Public Function test2() As String
       Return "Test2 Function Called"
   End Function
)

2. By using an application the Admin can configure what policy will apply on
the web service without rebuild (recompile) the web service.
( The service is deployed on IIS server, and then the admin will use another
application to configure that web service)
Kirk Allen Evans [msft] - 24 May 2006 07:40 GMT
Look at the PolicyOnRequestBody sample in the QuickStart samples in the SDK
for an example of selectively applying policy to differet methods within a
single endpoint.

> I have the below source code:
> <WebService(Namespace:="http://tempuri.org/")> _
[quoted text clipped - 40 lines]
> ( The service is deployed on IIS server, and then the admin will use another
> application to configure that web service)
Kirk Allen Evans [msft] - 24 May 2006 07:41 GMT
Look at the PolicyOnRequestBody example in the QuickStart samples in the WSE
3.0 SDK.  This shows how to selectivly apply policy to various methods within
a single endpoint.

> I have the below source code:
> <WebService(Namespace:="http://tempuri.org/")> _
[quoted text clipped - 40 lines]
> ( The service is deployed on IIS server, and then the admin will use another
> application to configure that web service)
Hung Ngo - 26 May 2006 06:54 GMT
I see the solution if I use many <protection> element in single policy type
(ex: usernameForCertificateSecurity or mutualCertificate11Security...).
Now if I have many policy file, first is usernameForCertificateSecurity,
second is mutualCertificate11Security, and so on. Depend on what user chooses
the policy type, the Webservice will apply the coresponding policy file (just
one of them: username or mutual).
Thanks in advance,
Hung.

> Look at the PolicyOnRequestBody example in the QuickStart samples in the WSE
> 3.0 SDK.  This shows how to selectivly apply policy to various methods within
[quoted text clipped - 44 lines]
> > ( The service is deployed on IIS server, and then the admin will use another
> > application to configure that web service)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.