Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2875411F8B for ; Sat, 12 Apr 2014 13:17:37 +0000 (UTC) Received: (qmail 14246 invoked by uid 500); 12 Apr 2014 13:17:35 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 14206 invoked by uid 500); 12 Apr 2014 13:17:33 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 14198 invoked by uid 99); 12 Apr 2014 13:17:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Apr 2014 13:17:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ashakirin@talend.com designates 74.201.97.201 as permitted sender) Received: from [74.201.97.201] (HELO mxout.myoutlookonline.com) (74.201.97.201) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Apr 2014 13:17:25 +0000 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id CF27D8BE067 for ; Sat, 12 Apr 2014 09:17:03 -0400 (EDT) X-Virus-Scanned: by SpamTitan at mail.lan Received: from S10HUB003.SH10.lan (unknown [10.110.2.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mxout.myoutlookonline.com (Postfix) with ESMTPS id 010B18BE055 for ; Sat, 12 Apr 2014 09:17:03 -0400 (EDT) Received: from S10BE002.SH10.lan ([::1]) by S10HUB003.SH10.lan ([::1]) with mapi id 14.01.0379.000; Sat, 12 Apr 2014 09:17:02 -0400 From: Andrei Shakirin To: "users@cxf.apache.org" Subject: RE: ws-policy with camel CXF Thread-Topic: ws-policy with camel CXF Thread-Index: Ac9V8cU0GuEghVi3T2CFf5K7iDc/GwAXp1pA Date: Sat, 12 Apr 2014 13:17:02 +0000 Message-ID: References: <513B8E348061B5448E09BE0230DA88A4F425F6@G1W3650.americas.hpqcorp.net> In-Reply-To: <513B8E348061B5448E09BE0230DA88A4F425F6@G1W3650.americas.hpqcorp.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [94.216.68.31] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I wonder how you apply the policy embedded in your WSDL. IMO you spring configuration should have wsdlLocation or wsdlURL pointing t= o your wsdl on classpath: ... Regards, Andrei. > -----Original Message----- > From: Lopez, Scott [mailto:scott.lopez2@hp.com] > Sent: Samstag, 12. April 2014 04:07 > To: users@cxf.apache.org > Subject: ws-policy with camel CXF >=20 > What I'm doing seems like it should work, on the server side the policy i= s being > read in and enforced because messages are being denied. I'm trying to do= a > simple username/password to get started but the client does seem interest= ed > in reacting to the policy. Messages are being sent across the queues > successfully but they contain no username/password information, causing t= he > receiving server to deny the request. >=20 > I have spent a good bit of time searching the internet so I wouldn't both= er > anyone, but I haven't been able to find the answer. One thing I did noti= ce is > that the examples used jaxws:client for their policies to work. I'm not = sure > that's an option since we are using JMS for the transport. >=20 > I've also debugged as much as I can and nothing obvious seems to stand ou= t, it > seems to enter the policy interceptor and then exit without doing any wor= k. >=20 > Any help is greatly appreciated, thanks in advance. >=20 > CXF Version is 2.7.7 (included with JBoss Fuse) >=20 > Spring configuration file (for the web service): >=20 > **************************************************************** > ******************************************** >=20 > > class=3D"org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> > =20 > value=3D"com.hp.usa.es.csg.filetransfer.SecurityFileTransferServicePortPo= rtType" > /> > value=3D"camel://direct:SecurityFileTransferServiceP= ortPortType" /> > > > > > class=3D"org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor"= /> > > > >=20 > class=3D"org.apache.cxf.jaxws.JaxWsProxyFactoryBean" > factory-bean=3D"securityFileTransferServiceProxyFactory" fa= ctory- > method=3D"create" > scope=3D"prototype" /> > **************************************************************** > ******************************************** >=20 > I have tried removing the interceptor shown above and leaving it in. >=20 > I also have the following defined in the spring framework: >=20 >=20 > **************************************************************** > ******************************************** >=20 > > > > > >=20 >=20 > **************************************************************** > ******************************************** >=20 > My application is as follows: >=20 >=20 > **************************************************************** > ******************************************** >=20 > SecurityFileTransferServicePortPortType serviceClient =3D > (SecurityFileTransferServicePortPortType)applicationContext.getBean("secu= rity > FileTransferServiceClient"); >=20 > Send in =3D new Send(); > Send.Properties properties =3D new Send.Properties(); > in.setProperties(properties); <.. a bunch of code that doesn't matter ..> > in.setData(sendData); >=20 >=20 > **************************************************************** > ******************************************** >=20 > The WSDL looks like the following, I took the policy directly from the CX= F policy > example: >=20 >=20 > **************************************************************** > ******************************************** >=20 > > targetNamespace=3D"http://soa.jboss.org/SecurityFileTransferServiceServic= e" > xmlns:ns1=3D"http://com.hp.usa.csg.services.filetransfer.service/" > xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" > xmlns:tns=3D"http://soa.jboss.org/SecurityFileTransferServiceService" > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" > xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/"> > > xmlns:xs=3D"http://www.w3.org/2001/XMLSchema" > targetNamespace=3D"http://com.hp.usa.csg.services.filetransfer.service/" > version=3D"1.0"> >=20 > namespace=3D"http://soa.jboss.org/SecurityFileTransferServiceService"/> >=20 > >=20 > > > > > > nillable=3D"true"> > > > > > > > > > > > > > >=20 > > > > > > >=20 >=20 > > > message=3D"tns:SecurityFileTransferServicePortOp"> > > > >=20 >=20 > type=3D"tns:SecurityFileTransferServicePortPortType"> > xmlns:wsp=3D"http://schemas.xmlsoap.org/ws/2004/09/policy" > URI=3D"#UP_policy"/> > transport=3D"http://schemas.xmlsoap.org/soap/http"/> > > soapAction=3D"http://soa.jboss.org/SecurityFileTransferServiceService/Sec= urityFil > eTransferServicePortOp" style=3D"document"/> > > > > > >=20 >=20 > > binding=3D"tns:FileTransferServiceServiceSoapBinding"> > location=3D"https://localhost:8183/SecurityFileTransferServicePortPortTyp= ePort"/ > > > > >=20 > policy" xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-= wss- > wssecurity-utility-1.0.xsd"> > > > securitypolicy/200702"> > > > > > > > > > > > > > > > > > > > > > > securitypolicy/200702"> > > sp:IncludeToken=3D"http://docs.oasis-open.org= /ws-sx/ws- > securitypolicy/200702/IncludeToken/AlwaysToRecipient"> > > > > > > > > > > >=20 > **************************************************************** > ******************************************** >=20