To consume non trivial web services one must fully understand its xml contract (WSDL) along with any other additional requirements, capabilities or preferences which translates to the configuration of the service, and essentially becomes the policies of the service.
WS Policy framework provides a way to express the policies of a service in a machine-readable way. Web services infrastructure can be enhanced to understand and enforce policies at runtime. For instance, a service author might write a policy requiring digital signature and encryption, while service consumers could use the policy information to reason out whether they can adhere to this policy information to use the service or not.
Further more, web service infrastructure could be enhanced to enforce those requirements without requiring the service author to write even single line of code.
In this current release Axis2 framework uses ws-commons/policy as an object model to manipulate policy documents. All its description builders store any policy information included in description documents (services.xml, axis2.xml, .. etc) in the appropriate description classes. This information is available at both deployment and run time via these description classes.
When generating WSDL dynamically for each service, policy information in the description classes is included. For instance, if you declare a policy in axis2.xml then that policy is reflected in service elements of WSDL of every service. If a policy is declared in a services.xml, it is shown in the service element of WSDL for that particular service.
Next step is to use that information to engage and configure required modules and allow the module to make use of this policy information.
It is evident that a great deal of work is required to make axis2 a fully fledged ws-policy supported web service infrastructure. But it is encouraging to note that we've taken the first steps towards this goal. We appreciate any suggestions, patches etc you send us in this regard. Keep on contributing...!