Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 41674 invoked from network); 30 Aug 2006 14:39:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Aug 2006 14:39:44 -0000 Received: (qmail 38615 invoked by uid 500); 30 Aug 2006 14:39:43 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 38561 invoked by uid 500); 30 Aug 2006 14:39:43 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 38522 invoked by uid 99); 30 Aug 2006 14:39:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 07:39:43 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [204.127.225.94] (HELO alnrmhc11.comcast.net) (204.127.225.94) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2006 07:39:42 -0700 Received: from [192.168.3.100] (c-71-205-191-164.hsd1.mi.comcast.net[71.205.191.164]) by comcast.net (alnrmhc14) with ESMTP id <20060830143920b1400ihk5te>; Wed, 30 Aug 2006 14:39:21 +0000 Message-ID: <44F5A357.1060101@envoisolutions.com> Date: Wed, 30 Aug 2006 10:40:23 -0400 From: Dan Diephouse User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: cxf-dev@incubator.apache.org CC: "Kulp, John Daniel" Subject: Re: Creating SOAP header elements without instantiating full SAAJ model References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Eoghan, One option might be to add a getOrCreateHeaders() method SoapMessage. Then we aren't creating a header everytime. Although that would probably presume that we're working with just DOM headers. I suppose for now it might not be a bad idea to just add an interceptor which does it for us. We can always tweak it later. - Dan Glynn, Eoghan wrote: > Hi Dan, > > I'm recasting the WS-A handlers as interceptors, partly to avoid > instantiating the full SAAJ model (as would be required for a JAX-WS > SOAPHandler). > > I know your working on some smarts around optimizing the creation of the > SOAPMessageContext from the SOAPMessage, perhaps to avoid the full SAAJ > model if only the SOAPHeaders are touched by the handler? So I just > wanted to check that I wasn't working at cross-purposes to you ... > > Now I've found that the way the SOAP interceptors are currently > structured, my WS-A interceptor has to take responsibility for adding > the SOAP header element. > > See below a highly excerpted snippet of the approach my interceptor > takes, I just wanted to check whether this would conflict with your > SOAPMessageContext-related changes ... particularly whether I should > look at adding an extra SOAP interceptor in the out chain that simply > calls SoapMessage.setHeaders() with an empty Element so that this is > available for other interceptors in the pre- or post-protocol phase that > need to add headers. > > Cheers, > Eoghan > > // addition of SOAP header - move to a new SOAP Interceptor? > Element headers = message.getHeaders(Element.class); > if (null == headers) { > DocumentBuilder builder = > DocumentBuilderFactory.newInstance().newDocumentBuilder(); > Document doc = builder.newDocument(); > SoapVersion version = message.getVersion(); > headers = doc.createElementNS(version.getNamespace(), > > version.getHeader().getLocalPart()); > headers.setPrefix(version.getPrefix()); > message.setHeaders(Element.class, headers); > } > > // marshall WS-A MAPs > Marshaller marshaller = jaxbContext.createMarshaller(); > marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); > marshaller.marshal(new JAXBElement(qname, > AttributedURIType.class, maps.getMessageID()), > headers); > // ... similarly for other MAPs > > -- Dan Diephouse Envoi Solutions http://envoisolutions.com http://netzooid.com/blog