[ 
https://issues.apache.org/jira/browse/CXF-8383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246077#comment-17246077
 ] 

olivier dufour commented on CXF-8383:
-------------------------------------

it come from ServerImpl.Start()

indeed, it seems that I start the server on a side with JaxWsServerFactoryBean

but do not know why it do not work. Here is the full code:
{code:java}
public CxfHandler(CXFServletInfos cxfServletInfos) {
 LOGGER.info("CxfHandler created");
 if (cxfServletInfos == null || cxfServletInfos.getInfos() == null || 
cxfServletInfos.getInfos().isEmpty()) {
 LOGGER.warn("no info transmit to servlet");
 return;
 }
 this.bus = BusFactory.getDefaultBus();
 BusFactory.setDefaultBus(bus);
 this.loader = this.bus.getExtension(ClassLoader.class);

 LOGGER.info("load destination");
 DestinationFactoryManager dfm = 
this.bus.getExtension(DestinationFactoryManager.class);
 destinationFactory = new 
VertxDestinationFactory(Arrays.asList("http://cxf.apache.org/transports/quarkus";),
 new DestinationRegistryImpl());
 dfm.registerDestinationFactory("http://cxf.apache.org/transports/quarkus";, 
destinationFactory);
 ConduitInitiatorManager extension = 
bus.getExtension(ConduitInitiatorManager.class);
 extension.registerConduitInitiator("http://cxf.apache.org/transports/quarkus";, 
destinationFactory);
 bus.setExtension(destinationFactory, HttpDestinationFactory.class);
 this.destinationRegistry = destinationFactory.getRegistry();

 for (CXFServletInfo servletInfo : cxfServletInfos.getInfos()) {
 JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(
 new QuarkusJaxWsServiceFactoryBean(cxfServletInfos.getWrappersclasses()));
 factory.setDestinationFactory(destinationFactory);
 factory.setBus(bus);
 Object instanceService = getInstance(servletInfo.getClassName());
 if (instanceService != null) {
 Class<?> seiClass = null;
 if (servletInfo.getSei() != null) {
 seiClass = loadClass(servletInfo.getSei());
 factory.setServiceClass(seiClass);
 }
 if (seiClass == null) {
 LOGGER.warn("sei not found: " + servletInfo.getSei());
 }
 factory.setAddress(servletInfo.getPath());
 factory.setServiceBean(instanceService);
 if (servletInfo.getWsdlPath() != null) {
 factory.setWsdlLocation(servletInfo.getWsdlPath());
 }
 if (!servletInfo.getFeatures().isEmpty()) {
 List<Feature> features = new ArrayList<>();
 for (String feature : servletInfo.getFeatures()) {
 Feature instanceFeature = (Feature) getInstance(feature);
 features.add(instanceFeature);
 }
 factory.setFeatures(features);
 }
 if (servletInfo.getSOAPBinding() != null) {
 factory.setBindingId(servletInfo.getSOAPBinding());
 }

 Server server = factory.create();
 for (String className : servletInfo.getInFaultInterceptors()) {
 Interceptor<? extends Message> interceptor = (Interceptor<? extends Message>) 
getInstance(className);
 server.getEndpoint().getInFaultInterceptors().add(interceptor);
 }
 for (String className : servletInfo.getInInterceptors()) {
 Interceptor<? extends Message> interceptor = (Interceptor<? extends Message>) 
getInstance(className);
 server.getEndpoint().getInInterceptors().add(interceptor);
 }
 for (String className : servletInfo.getOutFaultInterceptors()) {
 Interceptor<? extends Message> interceptor = (Interceptor<? extends Message>) 
getInstance(className);
 server.getEndpoint().getOutFaultInterceptors().add(interceptor);
 }
 for (String className : servletInfo.getOutInterceptors()) {
 Interceptor<? extends Message> interceptor = (Interceptor<? extends Message>) 
getInstance(className);
 server.getEndpoint().getOutInterceptors().add(interceptor);
 }

 LOGGER.info(servletInfo.toString() + " available.");
 } else {
 LOGGER.error("Cannot initialize " + servletInfo.toString());
 }
 }
}{code}
 

> cxf support for vertx destination
> ---------------------------------
>
>                 Key: CXF-8383
>                 URL: https://issues.apache.org/jira/browse/CXF-8383
>             Project: CXF
>          Issue Type: New Feature
>          Components: Transports
>            Reporter: olivier dufour
>            Priority: Major
>             Fix For: 3.4.1
>
>
> Hello,
> I am working on cxf quarkus extension. And quarkus is migrating from servlet 
> to vertx routing system.  Anyway, I try to make a custom detination/conduit 
> but it seems that cxf have tight integration with servlet. I try to make my 
> own invoke with 
> HttpServerRequest req, HttpServerResponse res, RoutingContext ctx
> instead of
> invoke(final ServletConfig config, final ServletContext context, final 
> HttpServletRequest req,
>  final HttpServletResponse resp)
> but when I see that InMessage store servlet request and servlet response as 
> attribute, I am affraid that this not doable. 
> So, Another solution is to do a wrapper httpServletRequest class which wrap 
> the vertx httpserverrequest. 
>  
> Anyway, in term of architecture, why inMessage do not store body, uri, query 
> param, ... instead of the servlet objects (request, context)?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to