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.

WSE 3.0 - Apply Policy w/out Policy Attribute?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
William Leary - 19 Apr 2006 22:36 GMT
Is there any possible way to apply policies to web services without having to
actually update the codebase by adding the Policy attribute to the web
service class? We would like for this to be doable via XML configuration so
that we do not need to update existing web services code bases to plug in
what we want, which is a custom filter to track messages. In WSE 2.0 we could
do this purely via configuration, which was nice. It appears that this is
impossible in WSE 3.0.
Pablo Cibraro - 20 Apr 2006 15:59 GMT
Hi William,

Unfortunately, it is not possible to specify a policy for a service by means
of a configuration setting.
If you do not want to modify the code for your web services, a security
router solution may solve your problem.

The WSE quickstart contains some samples about service routing, C:\Program
Files\Microsoft WSE\v3.0\Samples\CS\QuickStart\Routing
You can also check the Perimeter Service Router pattern,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/WSS
_Ch6_PerimServRout.asp


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

> Is there any possible way to apply policies to web services without having
> to
[quoted text clipped - 6 lines]
> do this purely via configuration, which was nice. It appears that this is
> impossible in WSE 3.0.
William - 20 Apr 2006 16:30 GMT
Thanks Pablo. Darn. I was afraid of that. I'm rather unimpressed with the
way this was implemented. We are putting together a custom in-house solution
that uses custom SOAP headers to implement web services management. (We can
track flow of calls between services, track response times, keep message
history for troubleshooting, etc) The desire is to keep the solution
transparent to the web services themselves. This was possible with WSE 2,
but now it's not possible with 3. We'd like to use 3, particularly for the
speed enhancement and wire compatibility with WCF, but now we have to have
this code referring to the mgmt functionality in each service, at the
individual class level.

Very unelegant. I cannot understand why they could not have implemented
something like so:

<applyPolicy>
   <service name="foo.asmx" policy="myPolicy" />
</applyPolicy>

I must be missing something here. Is there any functional reason for
specifying policy at the class attribute level? Seems utterly ridiculous to
not have this configurable.

> Hi William,
>
[quoted text clipped - 11 lines]
> Pablo Cibraro
> http://weblogs.asp.net/cibrax
Pablo Cibraro - 24 Apr 2006 15:02 GMT
Hi William,

I forgot to mention a workaround to do something like that.

You can develop a base class for your services, and set the policy in the
constructor of that class.

public class MyWebServiceBase : WebService
{
   public MyWebServiceBase()
   {
       //Look for the right policy name in the configuration.

       this.SetPolicy(policy);
   }
}

public class MyWebService1 : MyWebServiceBase
{
   public void HelloWorld(string hello)
   {
   }
}

Still, you need to modify the web services to use a different base class.

Regards,
Pablo.

> Thanks Pablo. Darn. I was afraid of that. I'm rather unimpressed with the
> way this was implemented. We are putting together a custom in-house
[quoted text clipped - 33 lines]
>> Pablo Cibraro
>> http://weblogs.asp.net/cibrax
Loyola stalin - 23 May 2006 08:50 GMT
Hi Pablo Cibraro,

public class MyWebServiceBase : WebService
{
  public MyWebServiceBase()
 {
    //Look for the right policy name in the configuration.

      this.SetPolicy(policy);
 }

Hoping this.SetPolicy  will come only under  WebServicesClientProtocol, So
that i tried with this as

 WebServicesClientProtocol ob = new WebServicesClientProtocol();
ob.SetPolicy("Serverplocy");

Though it's not working ...

please  tell me  the righ path ?

Thanks and Regards
loyola

}

> Hi William,
>
[quoted text clipped - 62 lines]
> >> Pablo Cibraro
> >> http://weblogs.asp.net/cibrax

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.