You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by lv <lv...@live.cn> on 2013/02/27 09:43:00 UTC

How to use Neethi to build policy Dynamically

I need to build web service policy dynamically. Where is the example of neethi ?
 		 	   		  

RE: How to use Neethi to build policy Dynamically

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

> Could you give me more detail cade example?

Sure, but I would like to understand your use case a little bit more. 
Do you prepare your own policies in CXF interceptor and apply it dynamically?

Cheers,
Andrei.  


> -----Original Message-----
> From: lv [mailto:lv.123@live.cn]
> Sent: Mittwoch, 27. Februar 2013 11:15
> To: users@cxf.apache.org
> Subject: RE: How to use Neethi to build policy Dynamically
> 
> 
> Thank you!
> Could you give me more detail cade example?
> 
> > From: ashakirin@talend.com
> > To: users@cxf.apache.org
> > Subject: RE: How to use Neethi to build policy Dynamically
> > Date: Wed, 27 Feb 2013 10:01:09 +0000
> >
> > Hi,
> >
> > Basically org.apache.neethi.PolicyBuilder does this job:
> http://ws.apache.org/neethi/apidocs/org/apache/neethi/PolicyBuilder.html
> .
> >
> > Anyway, to create Neethi policy from XML in CXF, you can reuse CXF
> PolicyBuilder:
> > org.apache.cxf.ws.policy.PolicyBuilder builder =
> message.getExchange().getBus()
> >
> 	.getExtension(org.apache.cxf.ws.policy.PolicyBuilder.class);
> > Policy genericPolicy = builder.getPolicy(xmlPolicyElement);
> >
> > Cheers,
> > Andrei.
> >
> 
> 

RE: How to use Neethi to build policy Dynamically

Posted by lv <lv...@live.cn>.
Thank you!
Could you give me more detail cade example?

> From: ashakirin@talend.com
> To: users@cxf.apache.org
> Subject: RE: How to use Neethi to build policy Dynamically
> Date: Wed, 27 Feb 2013 10:01:09 +0000
> 
> Hi,
> 
> Basically org.apache.neethi.PolicyBuilder does this job:  http://ws.apache.org/neethi/apidocs/org/apache/neethi/PolicyBuilder.html.
> 
> Anyway, to create Neethi policy from XML in CXF, you can reuse CXF PolicyBuilder:
> org.apache.cxf.ws.policy.PolicyBuilder builder = message.getExchange().getBus()
> 				.getExtension(org.apache.cxf.ws.policy.PolicyBuilder.class);
> Policy genericPolicy = builder.getPolicy(xmlPolicyElement);
> 
> Cheers,
> Andrei.
> 

 		 	   		  

RE: How to use Neethi to build policy Dynamically

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

Basically org.apache.neethi.PolicyBuilder does this job:  http://ws.apache.org/neethi/apidocs/org/apache/neethi/PolicyBuilder.html.

Anyway, to create Neethi policy from XML in CXF, you can reuse CXF PolicyBuilder:
org.apache.cxf.ws.policy.PolicyBuilder builder = message.getExchange().getBus()
				.getExtension(org.apache.cxf.ws.policy.PolicyBuilder.class);
Policy genericPolicy = builder.getPolicy(xmlPolicyElement);

Cheers,
Andrei.

> -----Original Message-----
> From: lv [mailto:lv.123@live.cn]
> Sent: Mittwoch, 27. Februar 2013 09:43
> To: users@cxf.apache.org
> Subject: How to use Neethi to build policy Dynamically
> 
> 
> I need to build web service policy dynamically. Where is the example of
> neethi ?
>