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 6C7DCECC6 for ; Wed, 20 Feb 2013 08:41:26 +0000 (UTC) Received: (qmail 50078 invoked by uid 500); 20 Feb 2013 08:41:25 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 50035 invoked by uid 500); 20 Feb 2013 08:41:25 -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 49998 invoked by uid 99); 20 Feb 2013 08:41:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2013 08:41:24 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ashakirin@talend.com designates 64.95.72.241 as permitted sender) Received: from [64.95.72.241] (HELO mxout.myoutlookonline.com) (64.95.72.241) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2013 08:41:19 +0000 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id CB8BC8BE5B7; Wed, 20 Feb 2013 03:40:58 -0500 (EST) X-Virus-Scanned: by SpamTitan at mail.lan Received: from S10HUB002.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 32C378BE557; Wed, 20 Feb 2013 03:40:58 -0500 (EST) Received: from S10BE002.SH10.lan ([::1]) by S10HUB002.SH10.lan ([::1]) with mapi id 14.01.0438.000; Wed, 20 Feb 2013 03:40:57 -0500 From: Andrei Shakirin To: "users@cxf.apache.org" CC: "s.r.s@web.de" Subject: RE: Insert elements in soap header? Thread-Topic: Insert elements in soap header? Thread-Index: AQHODrTOu/3Sl840RkObMNVst4+d1ZiCbOyw Date: Wed, 20 Feb 2013 08:40:57 +0000 Message-ID: References: <1344437126925-5712191.post@n5.nabble.com> <50227F1C.5010903@talend.com> <2D0F06EE-F9AF-4992-806E-89E79E172CC1@gmail.com> <1361287265861-5723378.post@n5.nabble.com> In-Reply-To: <1361287265861-5723378.post@n5.nabble.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [87.193.254.34] 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, Basically you can add any custom soap header on client side using this code= : Client proxy =3D ClientProxy.getClient(serviceClient); List
headersList =3D new ArrayList
(); Header testSoapHeader1 =3D new Header(new QName("uri:singz.ws.sample", "soa= pheader1"), "SOAP Header Message 1", new JAXBDataBinding(String.class)); Header testSoapHeader2 =3D new Header(new QName("uri:singz.ws.sample", "soa= pheader2"), "SOAP Header Message 2", new JAXBDataBinding(String.class)); headersList.add(testSoapHeader1); headersList.add(testSoapHeader2); proxy.getRequestContext().put(Header.HEADER_LIST, headersList); Or in interceptor: public void setSoapHeaderValue(SoapMessage soapMessage, QName name, String= value) { List
headers =3D soapMessage.getHeaders(); Header testSoapHeader =3D new Header(new QName("uri:singz.w= s.sample", "soapheader1"), "SOAP Header Message 1", new JAXBDataBinding(Str= ing.class)); headers.add(testSoapHeader); } Anyway to set WS-Addressing header I would recommend to use standard CXF fe= ature or WS-policy: http://cxf.apache.org/docs/ws-addressing.html Regards, Andrei. > -----Original Message----- > From: meteora28 [mailto:s.r.s@web.de] > Sent: Dienstag, 19. Februar 2013 16:21 > To: users@cxf.apache.org > Subject: Re: Insert elements in soap header? >=20 > Thank you for your answers, but I could not solve it yet. >=20 > Currently I have this message: >=20 > POST /onvif/services HTTP/1.1 > Content-Type: application/soap+xml; > action=3D"http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/Pu= ll > MessagesRequest"; > charset=3DUTF-8 > Accept: */* > User-Agent: Apache CXF 2.7.2 > Cache-Control: no-cache > Pragma: no-cache > Host: 172.16.101.130 > Connection: keep-alive > Content-Length: 1463 >=20 > envelope"> > > xmlns:wsse=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > wssecurity-secext-1.0.xsd" > xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > wssecurity-utility-1.0.xsd" > soap:mustUnderstand=3D"true"> > 14"> > root > Type=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > username-token-profile- > 1.0#PasswordDigest">FyjTaK5w90bDNRb5hzWwoaYpX5M=3D d> > EncodingType=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > soap-message-security- > 1.0#Base64Binary">VNAN0Nuy6gsm6YwAZh8HwA=3D=3D > 2013-02- > 19T15:16:46.862Z > > > > > xmlns:ns10=3D"http://www.onvif.org/ver10/events/wsdl" > xmlns:ns11=3D"http://docs.oasis-open.org/wsrf/r-2" > xmlns:ns2=3D"http://www.w3.org/2005/08/addressing" > xmlns:ns3=3D"http://docs.oasis-open.org/wsn/b-2" > xmlns:ns4=3D"http://docs.oasis-open.org/wsrf/bf-2" > xmlns:ns5=3D"http://docs.oasis-open.org/wsn/t-1" > xmlns:ns6=3D"http://www.onvif.org/ver10/schema" > xmlns:ns7=3D"http://www.w3.org/2004/08/xop/include" > xmlns:ns9=3D"http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xmime=3D"http://www.w3.org/2005/05/xmlmime"> > PT60S > 10 > > > >=20 > I just want to add these lines to the header of this/a certain message: >=20 > xmlns:wsa5=3D"http://www.w3.org/2005/08/addressing">http://172.16.101.13 > 0/onvif/services > xmlns:dom0=3D"http://www.axis.com/2009/event">3 >=20 > How can I do that? Do you need some more information about my > implemenetation? >=20 > Thank you! >=20 > meteora28 >=20 >=20 >=20 > -- > View this message in context: http://cxf.547215.n5.nabble.com/Insert- > elements-in-soap-header-tp5712191p5723378.html > Sent from the cxf-user mailing list archive at Nabble.com.