001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.cxfse;
018    
019    import java.io.IOException;
020    import java.lang.reflect.Field;
021    import java.lang.reflect.Method;
022    import java.util.List;
023    import java.util.Map;
024    import java.util.concurrent.CopyOnWriteArrayList;
025    
026    import javax.annotation.PostConstruct;
027    import javax.annotation.PreDestroy;
028    import javax.jbi.component.ComponentContext;
029    import javax.jbi.management.DeploymentException;
030    import javax.jbi.messaging.DeliveryChannel;
031    import javax.jbi.messaging.ExchangeStatus;
032    import javax.jbi.messaging.InOnly;
033    import javax.jbi.messaging.MessageExchange;
034    import javax.jbi.messaging.NormalizedMessage;
035    import javax.jbi.messaging.RobustInOnly;
036    import javax.wsdl.WSDLException;
037    import javax.wsdl.factory.WSDLFactory;
038    import javax.xml.namespace.QName;
039    import javax.xml.parsers.ParserConfigurationException;
040    import javax.xml.transform.TransformerException;
041    import javax.xml.ws.WebServiceRef;
042    
043    import org.w3c.dom.Element;
044    
045    import org.xml.sax.SAXException;
046    
047    import org.apache.cxf.Bus;
048    import org.apache.cxf.BusException;
049    import org.apache.cxf.aegis.databinding.AegisDatabinding;
050    import org.apache.cxf.binding.soap.SoapMessage;
051    import org.apache.cxf.binding.soap.SoapVersion;
052    import org.apache.cxf.binding.soap.model.SoapBindingInfo;
053    import org.apache.cxf.endpoint.Server;
054    import org.apache.cxf.frontend.ServerFactoryBean;
055    import org.apache.cxf.interceptor.Fault;
056    import org.apache.cxf.interceptor.Interceptor;
057    import org.apache.cxf.interceptor.InterceptorProvider;
058    import org.apache.cxf.jaxws.EndpointImpl;
059    import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
060    import org.apache.cxf.jaxws.ServiceImpl;
061    import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
062    import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
063    import org.apache.cxf.message.Message;
064    import org.apache.cxf.service.model.BindingOperationInfo;
065    import org.apache.cxf.service.model.EndpointInfo;
066    import org.apache.cxf.transport.ConduitInitiatorManager;
067    import org.apache.cxf.transport.jbi.JBIDestination;
068    import org.apache.cxf.transport.jbi.JBIDispatcherUtil;
069    import org.apache.cxf.transport.jbi.JBITransportFactory;
070    import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
071    import org.apache.cxf.xmlbeans.XmlBeansDataBinding;
072    import org.apache.servicemix.common.endpoints.ProviderEndpoint;
073    import org.apache.servicemix.cxfse.interceptors.AttachmentInInterceptor;
074    import org.apache.servicemix.cxfse.interceptors.AttachmentOutInterceptor;
075    import org.apache.servicemix.cxfse.support.ReflectionUtils;
076    import org.apache.servicemix.id.IdGenerator;
077    import org.apache.servicemix.jbi.jaxp.SourceTransformer;
078    import org.apache.servicemix.soap.util.DomUtil;
079    import org.springframework.util.ReflectionUtils.FieldCallback;
080    
081    /**
082     * @author gnodet
083     * @org.apache.xbean.XBean element="endpoint" description="an endpoint using
084     *                         CXF's JAX-WS frontend"
085     */
086    public class CxfSeEndpoint extends ProviderEndpoint implements InterceptorProvider {
087    
088        private static final IdGenerator ID_GENERATOR = new IdGenerator();
089    
090        private Object pojo;
091    
092        private EndpointImpl endpoint;
093    
094        private String address;
095    
096        private ServerFactoryBean sf;
097    
098        private Server server;
099    
100        private List<Interceptor> in = new CopyOnWriteArrayList<Interceptor>();
101    
102        private List<Interceptor> out = new CopyOnWriteArrayList<Interceptor>();
103    
104        private List<Interceptor> outFault = new CopyOnWriteArrayList<Interceptor>();
105    
106        private List<Interceptor> inFault = new CopyOnWriteArrayList<Interceptor>();
107    
108        private Map properties;
109    
110        private boolean mtomEnabled;
111    
112        private boolean useJBIWrapper = true;
113    
114        private boolean useSOAPEnvelope = true;
115    
116        private boolean useAegis;
117        
118        private boolean useXmlBeans;
119    
120        private QName pojoService;
121        private QName pojoEndpoint;
122        private QName pojoInterfaceName;
123    
124        private Server soapBindingServer;
125        
126        /**
127         * Returns the object implementing the endpoint's functionality. It is
128         * returned as a generic Java <code>Object</code> that can be cast to the
129         * proper type.
130         * 
131         * @return the pojo
132         */
133        public Object getPojo() {
134            return pojo;
135        }
136    
137        /**
138         * Specifies the object implementing the endpoint's functionality. This
139         * object should use the JAX-WS annotations.
140         * 
141         * @param pojo a JAX-WS annotated object
142         * @org.apache.xbean.Property description="a bean configuring the JAX-WS
143         *                            annotated implementation for the endpoint"
144         */
145        public void setPojo(Object pojo) {
146            this.pojo = pojo;
147        }
148    
149        /**
150         * Returns the list of interceptors used to process fault messages being
151         * sent back to the consumer.
152         * 
153         * @return a list of <code>Interceptor</code> objects
154         */
155        public List<Interceptor> getOutFaultInterceptors() {
156            return outFault;
157        }
158    
159        /**
160         * Returns the list of interceptors used to process fault messages being
161         * recieved by the endpoint.
162         * 
163         * @return a list of <code>Interceptor</code> objects
164         */
165        public List<Interceptor> getInFaultInterceptors() {
166            return inFault;
167        }
168    
169        /**
170         * Returns the list of interceptors used to process messages being recieved
171         * by the endpoint.
172         * 
173         * @return a list of <code>Interceptor</code> objects
174         */
175        public List<Interceptor> getInInterceptors() {
176            return in;
177        }
178    
179        /**
180         * Returns the list of interceptors used to process responses being sent
181         * back to the consumer.
182         * 
183         * @return a list of <code>Interceptor</code> objects
184         */
185        public List<Interceptor> getOutInterceptors() {
186            return out;
187        }
188    
189        /**
190         * Specifies a list of interceptors used to process requests recieved by the
191         * endpoint.
192         * 
193         * @param interceptors a list of <code>Interceptor</code> objects
194         * @org.apache.xbean.Property description="a list of beans configuring
195         *                            interceptors that process incoming requests"
196         */
197        public void setInInterceptors(List<Interceptor> interceptors) {
198            in.addAll(interceptors);
199        }
200    
201        /**
202         * Specifies a list of interceptors used to process faults recieved by the
203         * endpoint.
204         * 
205         * @param interceptors a list of <code>Interceptor</code> objects
206         * @org.apache.xbean.Property description="a list of beans configuring
207         *                            interceptors that process incoming faults"
208         */
209        public void setInFaultInterceptors(List<Interceptor> interceptors) {
210            inFault.addAll(interceptors);
211        }
212    
213        /**
214         * Specifies a list of interceptors used to process responses sent by the
215         * endpoint.
216         * 
217         * @param interceptors a list of <code>Interceptor</code> objects
218         * @org.apache.xbean.Property description="a list of beans configuring
219         *                            interceptors that process response messages"
220         */
221        public void setOutInterceptors(List<Interceptor> interceptors) {
222            out.addAll(interceptors);
223        }
224    
225        /**
226         * Specifies a list of interceptors used to process faults sent by the
227         * endpoint.
228         * 
229         * @param interceptors a list of <code>Interceptor</code> objects
230         * @org.apache.xbean.Property description="a list of beans configuring
231         *                            interceptors that process fault messages being
232         *                            returned to the consumer"
233         */
234        public void setOutFaultInterceptors(List<Interceptor> interceptors) {
235            outFault.addAll(interceptors);
236        }
237    
238        public Map getProperties() {
239            return properties;
240        }
241    
242        public void setProperties(Map properties) {
243            this.properties = properties;
244        }
245    
246        /*
247         * (non-Javadoc)
248         * 
249         * @see org.apache.servicemix.common.Endpoint#validate()
250         */
251        @Override
252        public void validate() throws DeploymentException {
253            if (getPojo() == null) {
254                // check if the POJO attribute is given.
255                throw new DeploymentException("pojo attribute is mandatory.");
256            }
257            
258            // construct the JBI address
259            String address = "jbi://" + ID_GENERATOR.generateSanitizedId();
260            
261            // construct the CXF server (using JAXB or Aegis)
262            if (isUseAegis()) {
263                sf = new ServerFactoryBean();
264                sf.setServiceBean(getPojo());
265                sf.setAddress(address);
266                sf.getServiceFactory().setDataBinding(new AegisDatabinding());
267              
268                sf.getServiceFactory().setPopulateFromClass(true);
269                sf.setStart(false);
270                if (isUseJBIWrapper()) {
271                    sf.setBindingId(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
272                }
273                if (getPojoService() != null) {
274                    sf.setServiceName(getPojoService());
275                }
276                if (getPojoEndpoint() != null) {
277                    sf.setEndpointName(getPojoEndpoint());
278                }
279                cleanUpDeadDestination();
280                server = sf.create();
281                server.getEndpoint().getInInterceptors().addAll(getInInterceptors());
282                server.getEndpoint().getInFaultInterceptors().addAll(getInFaultInterceptors());
283                server.getEndpoint().getOutInterceptors().addAll(getOutInterceptors());
284                server.getEndpoint().getOutFaultInterceptors().addAll(getOutFaultInterceptors());
285                if (isMtomEnabled()) {
286                    server.getEndpoint().getInInterceptors().add(new AttachmentInInterceptor());
287                    server.getEndpoint().getOutInterceptors().add(new AttachmentOutInterceptor());
288                }
289                if (sf.getServiceFactory().getServiceQName() != null) {
290                    if (getPojoService() == null) {
291                        setPojoService(sf.getServiceFactory().getServiceQName());
292                    }
293                    if (getService() == null) {
294                        setService(sf.getServiceFactory().getServiceQName());
295                    }
296                }
297                if (sf.getServiceFactory().getEndpointInfo().getName() != null) {
298                    if (getPojoEndpoint() == null) {
299                        setPojoEndpoint(sf.getServiceFactory().getEndpointInfo().getName());
300                    }
301                    if (getEndpoint() == null) {
302                        setEndpoint(sf.getServiceFactory().getEndpointInfo().getName().getLocalPart());
303                    }
304                }
305                if (sf.getServiceFactory().getInterfaceName() != null) {
306                    setPojoInterfaceName(sf.getServiceFactory().getInterfaceName());
307                    if (getInterfaceName() == null) {
308                        setInterfaceName(sf.getServiceFactory().getInterfaceName());
309                    }
310                }
311            } else {
312                JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
313                serviceFactory.setPopulateFromClass(true);
314                if (getPojoService() != null) {
315                    serviceFactory.setServiceName(getPojoService());
316                }
317                if (getPojoEndpoint() != null) {
318                    serviceFactory.setEndpointName(getPojoEndpoint());
319                }
320                endpoint = new EndpointImpl(getBus(), getPojo(), new JaxWsServerFactoryBean(serviceFactory));
321                if (isUseJBIWrapper()) {
322                    endpoint.setBindingUri(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
323                }
324                if (isUseXmlBeans()) {
325                    endpoint.setDataBinding(new XmlBeansDataBinding());
326                }
327                endpoint.setInInterceptors(getInInterceptors());
328                endpoint.setInFaultInterceptors(getInFaultInterceptors());
329                endpoint.setOutInterceptors(getOutInterceptors());
330                endpoint.setOutFaultInterceptors(getOutFaultInterceptors());
331                if (isMtomEnabled()) {
332                    endpoint.getInInterceptors().add(new AttachmentInInterceptor());
333                    endpoint.getOutInterceptors().add(new AttachmentOutInterceptor());
334                }
335                JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(getPojo().getClass());
336                if (getPojoService() == null) {
337                    setPojoService(implInfo.getServiceName());
338                }
339                setPojoInterfaceName(implInfo.getInterfaceName());
340                if (getPojoEndpoint() == null ) {
341                    setPojoEndpoint(implInfo.getEndpointName());
342                }
343                if (getService() == null) {
344                    setService(implInfo.getServiceName());
345                }
346                if (getInterfaceName() == null) {
347                    setInterfaceName(implInfo.getInterfaceName());
348                }
349                if (getEndpoint() == null) {
350                    setEndpoint(implInfo.getEndpointName().getLocalPart());
351                }
352    
353            }
354            
355            // prepare the CXF server in case of JAXB
356            if (!isUseAegis()) {
357                cleanUpDeadDestination();
358                endpoint.publish(address);
359                server = endpoint.getServer();
360            }
361    
362            if (getService() == null) {
363                // set the service using CXF endpoint service name
364                setService(server.getEndpoint().getService().getName());
365            }
366    
367            if (getEndpoint() == null) {
368                // set the endpoint using the CXF endpoint info
369                setEndpoint(server.getEndpoint().getEndpointInfo()
370                    .getName().getLocalPart());
371            }
372            setPojoService(server.getEndpoint().getService().getName());
373            setPojoEndpoint(server.getEndpoint().getEndpointInfo().getName());
374            if (!isUseJBIWrapper() && !isUseSOAPEnvelope()) {
375                // cleanup interceptors
376                removeInterceptor(server.getEndpoint().getBinding().getInInterceptors(), "ReadHeadersInterceptor");
377                removeInterceptor(server.getEndpoint().getBinding().getInFaultInterceptors(), "ReadHeadersInterceptor");
378                removeInterceptor(server.getEndpoint().getBinding().getOutInterceptors(), "SoapOutInterceptor");
379                removeInterceptor(server.getEndpoint().getBinding().getOutFaultInterceptors(), "SoapOutInterceptor");
380                removeInterceptor(server.getEndpoint().getBinding().getOutInterceptors(), "StaxOutInterceptor");
381            }
382    
383            // publish the WSDL in the endpoint descriptor
384            try {
385                definition = new ServiceWSDLBuilder(getBus(), server.getEndpoint().getService().getServiceInfos().iterator().next()).build();
386                description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
387            } catch (WSDLException e) {
388                throw new DeploymentException(e);
389            }
390            
391            super.validate();
392    
393        }
394    
395        private void removeInterceptor(List<Interceptor> interceptors, String whichInterceptor) {
396            for (Interceptor interceptor : interceptors) {
397                if (interceptor.getClass().getName().endsWith(whichInterceptor)) {
398                    interceptors.remove(interceptor);
399                }
400            }
401        }
402    
403        /*
404         * (non-Javadoc)
405         * 
406         * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#process(javax.jbi.messaging.MessageExchange)
407         */
408        @Override
409        public void process(MessageExchange exchange) throws Exception {
410            if (exchange.getStatus() != ExchangeStatus.ACTIVE) {
411                return;
412            }
413            JBIContext.setMessageExchange(exchange);
414            try {
415                QName opeName = exchange.getOperation();
416                EndpointInfo ei = server.getEndpoint().getEndpointInfo();
417    
418                if (opeName == null) {
419                    // if interface only have one operation, may not specify the
420                    // opeName
421                    // in MessageExchange
422                    if (ei.getBinding().getOperations().size() == 1) {
423                        opeName = ei.getBinding().getOperations().iterator().next().getName();
424                        exchange.setOperation(opeName);
425                    } else {
426                        NormalizedMessage nm = exchange.getMessage("in");
427                        if (soapBindingServer == null) {
428                            ServerFactoryBean sfForSoapBinding = null;
429                            if (isUseAegis()) {
430                                sfForSoapBinding = new ServerFactoryBean();
431                            } else {
432                                sfForSoapBinding = new JaxWsServerFactoryBean();
433                            }
434                            sfForSoapBinding.setServiceBean(getPojo());
435                            //sfForSoapBinding.setAddress("http://dummyaddress");
436                            sfForSoapBinding.getServiceFactory().setPopulateFromClass(true);
437                            sfForSoapBinding.setStart(false);
438                            sfForSoapBinding.setAddress("local://dummy");
439                            soapBindingServer = sfForSoapBinding.create();
440                        }
441                        Message message = soapBindingServer.getEndpoint().getBinding().createMessage();
442                        opeName = findOperation(nm, message, exchange);
443                        exchange.setOperation(opeName);
444    
445                    }
446                }
447                JBITransportFactory jbiTransportFactory = (JBITransportFactory)getBus()
448                    .getExtension(ConduitInitiatorManager.class)
449                    .getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
450    
451                exchange.setService(getPojoService());
452                exchange.setInterfaceName(getPojoInterfaceName());
453                JBIDestination jbiDestination = jbiTransportFactory.getDestination(getPojoService().toString()
454                                                                                   + getPojoInterfaceName().toString());
455                DeliveryChannel dc = getContext().getDeliveryChannel();
456                jbiTransportFactory.setDeliveryChannel(dc);
457    
458                jbiDestination.setDeliveryChannel(dc);
459                if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
460                    jbiDestination.getJBIDispatcherUtil().dispatch(exchange);
461                }
462                if (exchange instanceof InOnly || exchange instanceof RobustInOnly) {
463                    exchange.setStatus(ExchangeStatus.DONE);
464                    dc.send(exchange);
465                }
466    
467            } finally {
468                JBIContext.setMessageExchange(null);
469            }
470        }
471    
472        /*
473         * (non-Javadoc)
474         * 
475         * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#start()
476         */
477        @Override
478        public void start() throws Exception {
479            super.start();
480            
481            if (isUseAegis()) {
482                // if aegis databinding is used, start the server
483                server.start();
484            }
485            
486            ReflectionUtils.doWithFields(getPojo().getClass(), new FieldCallback() {
487                public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
488                    if (field.getAnnotation(WebServiceRef.class) != null) {
489                        ServiceImpl s = new ServiceImpl(getBus(), null, null, field.getType());
490                        s.addPort(new QName("port"), JBITransportFactory.TRANSPORT_ID, "jbi://" + ID_GENERATOR.generateSanitizedId());
491                        Object o = s.getPort(new QName("port"), field.getType());
492                        field.setAccessible(true);
493                        field.set(getPojo(), o);
494                    }
495                }
496            });
497            ReflectionUtils.callLifecycleMethod(getPojo(), PostConstruct.class);
498            // inject the POJO
499            injectPojo();
500        }
501    
502        /*
503         * (non-Javadoc)
504         * 
505         * @see org.apache.servicemix.common.endpoints.ProviderEndpoint#stop()
506         */
507        @Override
508        public void stop() throws Exception {
509            if (isUseAegis()) {
510                server.stop();
511            } else {
512                endpoint.stop();
513            }
514            ReflectionUtils.callLifecycleMethod(getPojo(), PreDestroy.class);
515            JBIDispatcherUtil.clean();
516            JBITransportFactory jbiTransportFactory = (JBITransportFactory)getBus()
517                .getExtension(ConduitInitiatorManager.class).getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
518            jbiTransportFactory.setDeliveryChannel(null);
519            jbiTransportFactory.removeDestination(getPojoService().toString() + getPojoInterfaceName().toString());
520            super.stop();
521        }
522    
523        protected Bus getBus() {
524            return ((CxfSeComponent)getServiceUnit().getComponent()).getBus();
525        }
526        
527        private void cleanUpDeadDestination() throws DeploymentException {
528            JBITransportFactory jbiTransportFactory;
529            try {
530                jbiTransportFactory = (JBITransportFactory)getBus()
531                    .getExtension(ConduitInitiatorManager.class).getConduitInitiator(CxfSeComponent.JBI_TRANSPORT_ID);
532            } catch (BusException e) {
533                throw new DeploymentException(e);
534            }
535            if (jbiTransportFactory != null 
536                    && getPojoService() != null 
537                    && getPojoInterfaceName() != null) {
538                 jbiTransportFactory.removeDestination(getPojoService().toString() + getPojoInterfaceName().toString());
539            }
540        }
541        
542        private QName findOperation(NormalizedMessage nm, Message message, MessageExchange exchange)
543            throws TransformerException, ParserConfigurationException, IOException, SAXException {
544            // try to figure out the operationName based on the incoming message
545            // payload and wsdl if use doc/literal/wrapped
546            Element element = new SourceTransformer().toDOMElement(nm.getContent());
547    
548            if (!useJBIWrapper) {
549                SoapVersion soapVersion = ((SoapMessage)message).getVersion();
550                if (element != null) {
551                    Element bodyElement = (Element)element.getElementsByTagNameNS(
552                                                                                  element.getNamespaceURI(),
553                                                                                  soapVersion.getBody()
554                                                                                      .getLocalPart()).item(0);
555                    if (bodyElement != null) {
556                        element = (Element)bodyElement.getFirstChild();
557                    }
558                }
559            } else {
560                element = DomUtil.getFirstChildElement(DomUtil.getFirstChildElement(element));
561            }
562    
563            QName opeName = new QName(element.getNamespaceURI(), element.getLocalName());
564            SoapBindingInfo binding = (SoapBindingInfo)soapBindingServer.getEndpoint().getEndpointInfo()
565                .getBinding();
566            for (BindingOperationInfo op : binding.getOperations()) {
567                String style = binding.getStyle(op.getOperationInfo());
568                if (style == null) {
569                    style = binding.getStyle();
570                }
571                if ("document".equals(style)) {
572                    if (op.getName().getLocalPart().equals(opeName.getLocalPart())) {
573                        return new QName(getPojoService().getNamespaceURI(), opeName.getLocalPart());
574                    }
575                } else {
576                    throw new Fault(new Exception("Operation must bound on this MessageExchange if use rpc mode"));
577                }
578            }
579            throw new Fault(new Exception("Operation not bound on this MessageExchange"));
580    
581        }
582    
583        @PostConstruct
584        protected void injectPojo() {
585            try {
586                ComponentContext context = getContext();
587                Method mth = pojo.getClass().getMethod("setContext", new Class[] {ComponentContext.class});
588                if (mth != null) {
589                    mth.invoke(pojo, new Object[] {context});
590                }
591            } catch (Exception e) {
592                //setContext is optional for the pojo
593            }
594    
595        }
596    
597        /**
598         * Specifies if the endpoint can process messages with binary data.
599         * 
600         * @param mtomEnabled a <code>boolean</code>
601         * @org.apache.xbean.Property description="Specifies if the service can
602         *                            consume MTOM formatted binary data. The
603         *                            default is <code>false</code>."
604         */
605        public void setMtomEnabled(boolean mtomEnabled) {
606            this.mtomEnabled = mtomEnabled;
607        }
608    
609        public boolean isMtomEnabled() {
610            return mtomEnabled;
611        }
612    
613        /**
614         * Specifies if the endpoint expects messages that are encased in the JBI
615         * wrapper used for SOAP messages. Ignore the value of useSOAPEnvelope if
616         * useJBIWrapper is true
617         * 
618         * @org.apache.xbean.Property description="Specifies if the endpoint expects
619         *                            to receive the JBI wrapper in the message
620         *                            received from the NMR. The default is
621         *                            <code>true</code>. Ignore the value of
622         *                            useSOAPEnvelope if useJBIWrapper is true"
623         */
624        public void setUseJBIWrapper(boolean useJBIWrapper) {
625            this.useJBIWrapper = useJBIWrapper;
626        }
627    
628        public boolean isUseJBIWrapper() {
629            return useJBIWrapper;
630        }
631    
632        /**
633         * Specifies if the endpoint expects soap messages when useJBIWrapper is
634         * false, if useJBIWrapper is true then ignore useSOAPEnvelope
635         * 
636         * @org.apache.xbean.Property description="Specifies if the endpoint expects
637         *                            soap messages when useJBIWrapper is false, if
638         *                            useJBIWrapper is true then ignore
639         *                            useSOAPEnvelope. The default is
640         *                            <code>true</code>.
641         */
642        public void setUseSOAPEnvelope(boolean useSOAPEnvelope) {
643            this.useSOAPEnvelope = useSOAPEnvelope;
644        }
645    
646        public boolean isUseSOAPEnvelope() {
647            return useSOAPEnvelope;
648        }
649    
650        /**
651         * Specifies if the endpoint use aegis databinding to marshell/unmarshell
652         * message
653         * 
654         * @org.apache.xbean.Property description="Specifies if the endpoint use
655         *                            aegis databinding to marshell/unmarshell
656         *                            message. The default is <code>false</code>.
657         */
658        public void setUseAegis(boolean useAegis) {
659            this.useAegis = useAegis;
660        }
661    
662        public boolean isUseAegis() {
663            return useAegis;
664        }
665    
666        /**
667         * Specifies the servicemodel service name generated from the pojo
668         * 
669         * @org.apache.xbean.Property description="Specifies the servicemodel 
670         *                                         service name generated from the pojo. 
671         *                                         The default is <code>null</code>.
672         */
673        public void setPojoService(QName pojoService) {
674            this.pojoService = pojoService;
675        }
676    
677        public QName getPojoService() {
678            return pojoService;
679        }
680    
681        /**
682         * Specifies the servicemodel endpoint name generated from the pojo
683         * 
684         * @org.apache.xbean.Property description="Specifies the servicemodel 
685         *                                         endpoint name generated from the pojo. 
686         *                                         The default is <code>null</code>.
687         */
688        public void setPojoEndpoint(QName pojoEndpoint) {
689            this.pojoEndpoint = pojoEndpoint;
690        }
691    
692        public QName getPojoEndpoint() {
693            return pojoEndpoint;
694        }
695    
696        protected void setPojoInterfaceName(QName pojoInterfaceName) {
697            this.pojoInterfaceName = pojoInterfaceName;
698        }
699    
700        protected QName getPojoInterfaceName() {
701            return pojoInterfaceName;
702        }
703    
704    
705        /**
706         * Specifies if the endpoint use xmlbeans databinding to marshell/unmarshell
707         * message
708         * 
709         * @org.apache.xbean.Property description="Specifies if the endpoint use
710         *                            xmlbeans databinding to marshell/unmarshell
711         *                            message. The default is <code>false</code>.
712         */
713        public void setUseXmlBeans(boolean useXmlBeans) {
714            this.useXmlBeans = useXmlBeans;
715        }
716    
717        public boolean isUseXmlBeans() {
718            return useXmlBeans;
719        }
720    
721    }