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 / January 2006

Tip: Looking for answers? Try searching our database.

WSE 3 - How to map policy to webmethods?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul.evans.groups@googlemail.com - 02 Nov 2005 15:48 GMT
Hi all,
 I've been finding examples on the web about using a "mappings"
element to map policy to some methods and not others.  However they all
seem to be WSE2.0 examples, and I can't quite see how to map the same
thing over to WSE3.0.

I searched the documentation that installed with WSE and couldn't find
mappings or even policyDocument mentioned anywhere.

So can anyone supply a sample of how I might use the mapping thing with
WSE3?  Should I be editing the wse3policyCache.config file or the
web.config file?

Thanks in advance,

Paul
Pablo Cibraro - 03 Nov 2005 15:05 GMT
Hi Paul,
You can specify the method name in the protection element. For example,

<policy ....> <!-- This can be any kind of policy, username, X509, etc -->
 <clientToken>
 </clientToken>
 <serviceToken>
 </serviceToken>
 <protection>
   <request signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
   <response signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
   <fault signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
 </protection>
 <protection requestAction="shipmentNotice">
   <request signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
   <response signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
   <fault signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
 </protection>
 <protection requestAction="submitPOFault">
   <request signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
   <response signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
   <fault signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
 </protection>
</policy>

In this example, I defined a policy for a web service with 2 or more web
methods. ("shipmentNotice", "submitPOFault" and default)
The protection element without requestAction attribute is the default
protection.

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax

> Hi all,
>  I've been finding examples on the web about using a "mappings"
[quoted text clipped - 12 lines]
>
> Paul
paul.evans.groups@googlemail.com - 03 Nov 2005 16:16 GMT
ah wow, this is great. But I think I asked the wrong question.

My problem is that I want to have some methods requiring a
UsernameToken and some being allowed to just use be anonymous.

Is it possible to have both usernameForCertificateSecurity and
anonymousForCertificateSecurity in the same policy file, so some
require authorisation and some don't?
Pablo Cibraro - 04 Nov 2005 14:36 GMT
Unfortunately, that is not possible.
A policy applies at class level (it applies to all web methods defined in
the same web service).
If you want to use different policies, you will have to separate the
webmethods in different web services.

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax

> ah wow, this is great. But I think I asked the wrong question.
>
[quoted text clipped - 4 lines]
> anonymousForCertificateSecurity in the same policy file, so some
> require authorisation and some don't?
Bob - 20 Jan 2006 18:57 GMT
I had a similar question. We want apply WS-ReliableMessaging to some, but not
all of our messages. Do we have to split our messages between multiple
SoapServices, with and without the reliable messaging PolicyAttribute applied?
Signature

Dr. R.A. Knutson
Magenic Technologies

> Unfortunately, that is not possible.
> A policy applies at class level (it applies to all web methods defined in
[quoted text clipped - 14 lines]
> > anonymousForCertificateSecurity in the same policy file, so some
> > require authorisation and some don't?

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.