DestinationFactory with JAX-WS?

2011-03-01 Thread David Sills
Hi!

 

I'm a new user of CXF (though a long-time veteran of Java and other WS
implementations) and have to admit I find the documentation very
confusing. Of course, it's easy to write confusing documentation if the
people who write it know what they are doing (they don't realize the
things their readers won't know). On the other hand

 

What's got me at the moment, is writing a standalone server. I need to
add some static pages to the server programmatically and was thrilled to
see that I could do so with the code at
http://cxf.apache.org/docs/standalone-http-transport.html. However,
there's a problem; the code is not complete. In particular, it uses a
method on a DestinationFactory that simply appears (that is, the
variable df is nowhere declared, so I don't know where it came from):

 

Destination destination = df.getDestination(ei);

// etc., other code I understand

 

Fine, once I can get there I understand what's going on, but my service
works very well with the JAX-WS frontend, which I am declaring simply
with:

 

Endpoint e =
Endpoint.publish(http://localhost:9000/DsiServer;, new
PRServiceImpl());

 

So my question: how do I locate the appropriate DestinationFactory if I
am using the JAX-WS frontend in this way?

 

There is some discussion about how the whole thing works also in
http://cxf.apache.org/docs/jax-ws-configuration.html but about half of
it I am having difficulty with the underlying assumptions about how to
use it and the other half doesn't get me to where I need to go.

 

Many thanks for your pity on a new user.

 

David

 



Re: DestinationFactory with JAX-WS?

2011-03-01 Thread Daniel Kulp

I'm not 100% sure on this. I'd need to play around, but I THINK it would 
be something like:

Bus bus = BusFactory.getThreadDefaultBus();
DestinationFactory df = bus.getExtension(DestinationFactoryManager.class)
  .getDestinationFactory(http://cxf.apache.org/transports/http;);

That SHOULD get you the JettyHTTPTransportFactory.

Dan


On Tuesday 01 March 2011 10:39:58 AM David Sills wrote:
 Hi!
 
 
 
 I'm a new user of CXF (though a long-time veteran of Java and other WS
 implementations) and have to admit I find the documentation very
 confusing. Of course, it's easy to write confusing documentation if the
 people who write it know what they are doing (they don't realize the
 things their readers won't know). On the other hand
 
 
 
 What's got me at the moment, is writing a standalone server. I need to
 add some static pages to the server programmatically and was thrilled to
 see that I could do so with the code at
 http://cxf.apache.org/docs/standalone-http-transport.html. However,
 there's a problem; the code is not complete. In particular, it uses a
 method on a DestinationFactory that simply appears (that is, the
 variable df is nowhere declared, so I don't know where it came from):
 
 
 
 Destination destination = df.getDestination(ei);
 
 // etc., other code I understand
 
 
 
 Fine, once I can get there I understand what's going on, but my service
 works very well with the JAX-WS frontend, which I am declaring simply
 with:
 
 
 
 Endpoint e =
 Endpoint.publish(http://localhost:9000/DsiServer;, new
 PRServiceImpl());
 
 
 
 So my question: how do I locate the appropriate DestinationFactory if I
 am using the JAX-WS frontend in this way?
 
 
 
 There is some discussion about how the whole thing works also in
 http://cxf.apache.org/docs/jax-ws-configuration.html but about half of
 it I am having difficulty with the underlying assumptions about how to
 use it and the other half doesn't get me to where I need to go.
 
 
 
 Many thanks for your pity on a new user.
 
 
 
 David

-- 
Daniel Kulp
dk...@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com