Return-Path: Delivered-To: apmail-incubator-cxf-user-archive@locus.apache.org Received: (qmail 23432 invoked from network); 15 Jul 2007 12:02:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jul 2007 12:02:46 -0000 Received: (qmail 78700 invoked by uid 500); 15 Jul 2007 12:02:47 -0000 Delivered-To: apmail-incubator-cxf-user-archive@incubator.apache.org Received: (qmail 78664 invoked by uid 500); 15 Jul 2007 12:02:47 -0000 Mailing-List: contact cxf-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-user@incubator.apache.org Delivered-To: mailing list cxf-user@incubator.apache.org Received: (qmail 78646 invoked by uid 99); 15 Jul 2007 12:02:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jul 2007 05:02:47 -0700 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=MAILTO_TO_SPAM_ADDR,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (herse.apache.org: transitioning domain of bim2007@basistech.com does not designate 199.88.205.99 as permitted sender) Received: from [199.88.205.99] (HELO mail.basistech.com) (199.88.205.99) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jul 2007 05:02:43 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: customizing the HTTP transport factory Date: Sun, 15 Jul 2007 08:02:21 -0400 Message-ID: In-Reply-To: <7b774c950707141056y190e9685ib098445559461a29@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: customizing the HTTP transport factory Thread-Index: AcfGQG79CSSShufhRY2m1RvfbOcxeQAltB/A References: <7b774c950707141056y190e9685ib098445559461a29@mail.gmail.com> From: "Benson Margulies" To: X-Virus-Checked: Checked by ClamAV on apache.org By the way, here's what was really surprising about this.=20 When I first hit the NPE, I thought, "OK, I need to set some transport IDs. Let's see what the standard version of the class has." So, I turned off my class and set a breakpoint at the spot that looked at the transport ids. It was never called. I apologize for not capturing the details, but, in general, when the code is setting up lazily as a result of a call to get a server for a service, the rest of the (un)initialization status causes the logic to assume that there will be no transport ids, and it makes some assumptions, instead. By creating and advertising a factory on the bus before entering that code, I'm obviating all of that. Now, ignorantly, I would suggest that I should be able to arrange the same convenient treatment for my subclass as the standard class gets.=20 Or, alternatively, your concept might be:=20 "As soon as you (ahem) open the jar and start customizing things, we recommend spring wiring, and look at the supplied files to see how it's done." > -----Original Message----- > From: Dan Diephouse [mailto:dan@envoisolutions.com] > Sent: Saturday, July 14, 2007 1:57 PM > To: cxf-user@incubator.apache.org > Subject: Re: customizing the HTTP transport factory >=20 > Hi Benson, >=20 > You're very close to getting it to work :-) If you look at the > cxf-extension-http-jetty.xml file you'll see that we associate several > transport IDs with that transport: >=20 > org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory" > lazy-init=3D"true"> > > > > http://schemas.xmlsoap.org/soap/http > http://schemas.xmlsoap.org/wsdl/http/ > http://schemas.xmlsoap.org/wsdl/soap/http > http://www.w3.org/2003/05/soap/bindings/HTTP/ > > http://cxf.apache.org/transports/http/configuration > > http://cxf.apache.org/bindings/xformat > > > >=20 > In code form, this is equivalent to: >=20 > Set tids =3D new HashSet(); > tids.add("http://schemas.xmlsoap.org/soap/http"); > ... etc for all transport ids >=20 > httpTransport.setTransportIds(tids); >=20 > for (String tid : tids) { > dfm.registerDestinationFactory(tid, httpTransport); > } >=20 > We should really write some docs on the transport layer, but hopefully > this > will get you going in the meantime. >=20 > Thanks, > - Dan >=20 >=20 > On 7/13/07, Benson Margulies wrote: > > > > I set out to replace JettyHTTPTransportFactory with a slightly modified > > version. So, I wrote the code below. > > > > The effect is an NPE when my factory object is asked for its > > transportIds, of which it has none. When I don't try to set this up, the > > default transport factory does not get asked for its transport ids, > > apparently because other things that aren't initialized protect it from > > being asked. > > > > I think I see what the transport Id has to be for SOAP, so I can just > > set it, but is this idea supposed to work without that? > > > > > > > > Bus bus =3D BusFactory.getDefaultBus(); > > DestinationFactoryManager dfm =3D > > bus.getExtension(DestinationFactoryManager.class); > > JettyHTTPTransportFactoryForStaticContent transportFactory = =3D new > > JettyHTTPTransportFactoryForStaticContent(); > > transportFactory.setBus(bus); > > > > dfm.registerDestinationFactory("http://cxf.apache.org/transports/http/co > > nfiguration", transportFactory); > > >=20 >=20 >=20 > -- > Dan Diephouse > Envoi Solutions > http://envoisolutions.com | http://netzooid.com/blog