CXF, WS-Policy and Spring
Hello! I'm currently trying to create a web service with CXF that can be used by a .NET client (WCF). In the documentation of Sun's Metro I read about WSIT which supports the interoperability between Java and .NET. WSIT in NetBeans is automatically adding a few things to the WSDL: wsp:Policy wsu:Id=HelloWorld_policy wsp:ExactlyOne wsp:All wsrm:RMAssertion wsrm:InactivityTimeout Milliseconds=60/ wsrm:AcknowledgementInterval Milliseconds=200/ /wsrm:RMAssertion wsoma:OptimizedMimeSerialization/ /wsp:All /wsp:ExactlyOne /wsp:Policy Can I do the same thing with CXF? I tried adding the following to the endpoint's Spring bean: bean id=classifierService class=com.example.HelloWorldImpl !-- properties -- /bean jaxws:endpoint id=helloWorldEndpoint implementorClass=com.example.HelloWorldImpl implementor=#helloWorld address=/helloWorld jaxws:properties entry key=mtom-enabled value=true / /jaxws:properties jaxws:features wsp:Policy wsrm:RMAssertion wsrm:InactivityTimeout Milliseconds=60/ wsrm:AcknowledgementInterval Milliseconds=200 / /wsrm:RMAssertion wsam:Addressing/ mtom:OptimizedMimeSerialization / /wsp:Policy /jaxws:features /jaxws:endpoint However, that didn't work as expected. Spring throws some type conversion exceptions when I add the jaxws:features to the endpoint's bean. Am I doing something completely wrong? I'd be really grateful if somebody could provide a working example that shows a complete Spring configuration file with namespaces, schemaLocations and the policy configuration. Thanks in advance for your help. Best regards, Gerhard -- View this message in context: http://www.nabble.com/CXF%2C-WS-Policy-and-Spring-tp16718063p16718063.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF, WS-Policy and Spring
Hello Sergey, Sergey Beryozkin wrote: I'm sorry to say it but I've never got to ensuring that for java-first services WS-Policy expressions get automatically added to a (generated) WSDL. I can't commit myself to fixing this issue at this stage, but whenever I get a chance to look at a WS-Policy stuff, I'll get it fixed first as it's obvious it's a major blocket to utilizing the CXF WS-Policy framework at a wider scale. Current WS-Policy implementation is a bit complicated, but the fix for this issue should be reasonably simple, it would probably require an update to a WS-PolicyFeature implementation which should register the policy extensors it discovers from a spring configuration with either the Endpoint or WSDLManager... Now I'm a little bit confused. After reading [1] I thought it would be possible to configure the WS-Policy with Spring. I just couldn't get it working because of some exceptions (I can post them in a few hours if you need them) that Spring was throwing at me. ;-) So, are you saying it currently can't be done at all? That would be too bad. I had some problems with Sun's Metro in conjunction with Spring and Hibernate so I switched back to CXF. It looks like I can't use both of them. Writing my own patch is not possible since I need a solution within the next few days. Would it work if I used WSDL first? However, I guess I won't be able to use Spring's dependency injection then, will I? :-( [1] http://netzooid.com/blog/2007/04/23/cxf-spring-and-ws-policy-internals/ -- View this message in context: http://www.nabble.com/CXF%2C-WS-Policy-and-Spring-tp16718063p16721675.html Sent from the cxf-user mailing list archive at Nabble.com.