Hi, 

I think that you can hack your way to get access to another servlet, but this 
was not what I hoped for. 
Isnt there a more elegant way to use the CXFServlet without using XML 
configuration. I just wanted to 
create a little example, how to use CXF with our own product, which should be 
small and clean. 
Therefore the example should not contain some "tricks" to get access to the CXF 
servlet. So I think, will use
The XML config way instead.

Thanks, 

Andreas

> -----Ursprüngliche Nachricht-----
> Von: Willem Jiang [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 21. September 2007 12:03
> An: [email protected]
> Betreff: Re: AW: AW: CXFServlet and the EndPoint API?
> 
> Hi ,
> 
> You can have a look at the CXFServlet code[1] to see how it 
> setup the default transport to servlet transport :) I 
> remember there is a way to get the servlet's reference from 
> other servlet , may be you need use google to find them.
> [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/tra
> nsports/http/src/main/java/org/apache/cxf/transport/servlet/CX
> FServlet.java
> 
> Willem.
> 
> Andreas Bucksteeg wrote:
> > Hi Willem,
> >
> > I know that I have to set the CXFServelt Bus, but I do not 
> see a way to get a reference of the CXFServlet in my test 
> JSP. I find some mails where the setting of the CXFServlet 
> bus was described, but I did not find any info, on how the 
> obtain this reference. 
> >
> > Is there maybe a way to set the default transport factory 
> to CXFServletTransportFactory ?
> >
> > Andreas
> >
> >   
> >> -----Ursprüngliche Nachricht-----
> >> Von: Willem Jiang [mailto:[EMAIL PROTECTED]
> >> Gesendet: Freitag, 21. September 2007 05:20
> >> An: [email protected]
> >> Betreff: Re: AW: CXFServlet and the EndPoint API?
> >>
> >> Hi Andreas,
> >>
> >>  From your stack trace , I think you did not use the right 
> bus when 
> >> you publish the endpoint.
> >> Because it uses the JettyHttpTransportFactory , not the 
> >> CXFServletTransportFactory Can you get the CXFServlet's reference 
> >> cxfServlet?
> >> If so , you can take a look at this blew codes, which just 
> uses the 
> >> cxfServlet already loaded bus.
> >>
> >> BusFactory.setThreadDefaultBus(cxfServlet.getBus());
> >> Endpoint.publish("/Greeter", new GreeterImpl()); 
> >> BusFactory.setThreadDefaultBus(null);
> >>
> >> Willem.
> >>
> >>
> >> Andreas Bucksteeg wrote:
> >>     
> >>> Hi,
> >>>
> >>> I have the same problem and I understand what the code
> >>>       
> >> should do, but
> >>     
> >>> I dont see, how I should get access to the CXFServlet 
> from my code.
> >>>
> >>> I am trying to setup my service using the CXFServlet 
> running in an 
> >>> Tomcat using the Endpoint API.
> >>>
> >>> http://cwiki.apache.org/CXF20DOC/servlet-transport.html
> >>>       
> >> describes to
> >>     
> >>> configure the servlet in the web.xml of the webapp and 
> then just to 
> >>> use
> >>>
> >>>   
> >>>       
> >>>> Endpoint.publish("/Greeter", new GreeterImpl());
> >>>>     
> >>>>         
> >>> I am not sure, where to put this code. For tests I used a
> >>>       
> >> jsp in the
> >>     
> >>> webapp I configured the CXFServlet and using the above line
> >>>       
> >> results in:
> >>     
> >>> java.net.MalformedURLException: no protocol: /HelloWorldService
> >>>   java.net.URL.<init>(URL.java:567)
> >>>   java.net.URL.<init>(URL.java:464)
> >>>   java.net.URL.<init>(URL.java:413)
> >>>   
> >>>
> >>>       
> >> 
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.<init>(Jetty
> >> H
> >>     
> >>> TT
> >>> PDestination.java:86)
> >>>   
> >>>
> >>>       
> >> 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createD
> >> e
> >>     
> >>> st
> >>> ination(JettyHTTPTransportFactory.java:96)
> >>>   
> >>>
> >>>       
> >> 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDest
> >> i
> >>     
> >>> na
> >>> tion(JettyHTTPTransportFactory.java:83)
> >>>   
> >>>
> >>>       
> >> 
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapT
> >> r
> >>     
> >>> an
> >>> sportFactory.java:74)
> >>>
> >>> How should I get the CXFServlet to set its bus as the default bus?
> >>>
> >>> I search the docs and the mailing list, some people had the same 
> >>> problem to get CXFServlet running without xml configuration
> >>>       
> >> in Tomcar,
> >>     
> >>> but I havent found a solution yet...
> >>>
> >>> Any ideas?
> >>>
> >>> Cheers,
> >>>
> >>> Andreas
> >>>
> >>>   
> >>>       
> >
> >   
> 

Reply via email to