You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sram <sr...@hotmail.com> on 2012/02/16 22:35:39 UTC

Policy Annotation

On CXF2.5.2, I have WS-Security policies declared on WSDL first approach and
works as expected when

@javax.jws.WebService(
                      serviceName = "PingService",
                      portName = "pingPort",
                      targetNamespace = "http://services.mycomp.com/ping",
                      *wsdlLocation = "classpath:WEB-INF/wsdl/ping.wsdl",*
                      endpointInterface =
"com.mycomp.services.ping.PingPortType")


I try to annotate policies and also comment out wsdlLocation, so that I do
not have to carry all WSDL and supporting XSD's within my codebase. 

@Policies({
    @Policy(uri = "Tranpolicy.xml",
            placement = Policy.Placement.BINDING),
    @Policy(uri = "InPolicy.xml", 
            placement = Policy.Placement.BINDING_OPERATION_INPUT)
})

When I hit my service?WSDL url, I can see the policies embedded into my
WSDL, however when I shoot the payload it does not check for policies.

I uncomment wsdlLocation in @javax.jws.WebService, re-run the scenario and
now see the policies being checked.

I'm using WSDL first model, should I always tell @javax.jws.WebService the
wsdl location for the policies to pickup. If I do, I will end up maintaining
two copies of WSDL, one on my external service registry and the other here. 

Any thoughts please.

--
View this message in context: http://cxf.547215.n5.nabble.com/Policy-Annotation-tp5490803p5490803.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Policy Annotation

Posted by Daniel Kulp <dk...@apache.org>.

Had a thread about this earlier in the week:

http://cxf.547215.n5.nabble.com/Ws-trust-java-first-jax-ws-td5477862.html

It's fixed now in the latest 2.5.3-SNAPSHOTs

Dan


On Thursday, February 16, 2012 1:35:39 PM sram wrote:
> On CXF2.5.2, I have WS-Security policies declared on WSDL first approach and
> works as expected when
> 
> @javax.jws.WebService(
>                       serviceName = "PingService",
>                       portName = "pingPort",
>                       targetNamespace = "http://services.mycomp.com/ping",
>                       *wsdlLocation = "classpath:WEB-INF/wsdl/ping.wsdl",*
>                       endpointInterface =
> "com.mycomp.services.ping.PingPortType")
> 
> 
> I try to annotate policies and also comment out wsdlLocation, so that I do
> not have to carry all WSDL and supporting XSD's within my codebase.
> 
> @Policies({
>     @Policy(uri = "Tranpolicy.xml",
>             placement = Policy.Placement.BINDING),
>     @Policy(uri = "InPolicy.xml",
>             placement = Policy.Placement.BINDING_OPERATION_INPUT)
> })
> 
> When I hit my service?WSDL url, I can see the policies embedded into my
> WSDL, however when I shoot the payload it does not check for policies.
> 
> I uncomment wsdlLocation in @javax.jws.WebService, re-run the scenario and
> now see the policies being checked.
> 
> I'm using WSDL first model, should I always tell @javax.jws.WebService the
> wsdl location for the policies to pickup. If I do, I will end up maintaining
> two copies of WSDL, one on my external service registry and the other here.
> 
> Any thoughts please.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Policy-Annotation-tp5490803p5490803.html
> Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com