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