Examples of XFire


Examples of org.codehaus.xfire.XFire

        xfire = createXFire(this.context);
        super.doInit();
    }
   
    public static XFire createXFire(ComponentContext context) {
        XFire xfire = new DefaultXFire();
        Object[] transports = xfire.getTransportManager().getTransports().toArray();
        for (int i = 0; i < transports.length; i++) {
            xfire.getTransportManager().unregister((Transport) transports[i]);
        }
        xfire.getTransportManager().register(new JbiTransport(context));
        return xfire;
    }
View Full Code Here

Examples of org.codehaus.xfire.XFire

        );
    }
   
    private synchronized InvocationHandler getJBIInvocationHandler() throws Exception {
        if (jbiInvocationHandler == null) {
            XFire xfire = Jsr181Component.createXFire(getInternalContext());
            Object o = JbiProxy.create(xfire, context, interfaceName, service,
                    endpoint, type, propagateSecuritySubject);
            jbiInvocationHandler = Proxy.getInvocationHandler(o);
        }
        return jbiInvocationHandler;
View Full Code Here

Examples of org.codehaus.xfire.XFire

        public void setContext(ComponentContext context) throws Exception {
            this.context = context;
            if (context != null) {
                try {
                    XFire xfire = Jsr181Component.createXFire(context);
                    QName service = new QName("http://xfire.jsr181.servicemix.apache.org", "EchoService");
                    proxy = (Echo) JbiProxy.create(xfire, context, null, service, null, Echo.class);
                } catch (Exception e) {
                    e.printStackTrace();
                    throw e;
View Full Code Here

Examples of org.codehaus.xfire.XFire

    protected boolean isInAndOut(MessageExchange exchange) {
        return exchange instanceof InOut || exchange instanceof InOptionalOut;
    }
   
    protected XFire createXFire() {
        XFire xfire = XFireFactory.newInstance().getXFire();
        xfire.getTransportManager().register(new JbiTransport());
        return xfire;
    }
View Full Code Here

Examples of org.codehaus.xfire.XFire

        public void setContext(ComponentContext context) throws Exception {
            this.context = context;
            if (context != null) {
                try {
                    XFire xfire = Jsr181LifeCycle.createXFire(context);
                    QName service = new QName("http://xfire.jsr181.servicemix.apache.org", "EchoService");
                    proxy = (Echo) JbiProxy.create(xfire, context, null, service, null, Echo.class);
                } catch (Exception e) {
                    e.printStackTrace();
                    throw e;
View Full Code Here

Examples of org.codehaus.xfire.XFire

       
    }
   
    synchronized private InvocationHandler getJBIInvocationHandler() throws Exception {
        if( jbiInvocationHandler == null ) {
            XFire xfire = Jsr181LifeCycle.createXFire(getInternalContext());
            Object o = JbiProxy.create(xfire, context, interfaceName, service, endpoint, type);
            jbiInvocationHandler = Proxy.getInvocationHandler(o);
        }
        return jbiInvocationHandler;
    }
View Full Code Here

Examples of org.codehaus.xfire.XFire

            ClassLoader classLoader = ((XBeanServiceUnit) getServiceUnit()).getConfigurationClassLoader();
            Class cl = Class.forName(pojoClass, true, classLoader);
            pojo = cl.newInstance();
        }
        // Create factory
        XFire xfire = getXFire();
        ObjectServiceFactory factory = ServiceFactoryHelper.findServiceFactory(xfire, pojo.getClass(), annotations, typeMapping);
        Class serviceClass = pojo.getClass();
        if (serviceInterface != null) {
            serviceClass = Class.forName(serviceInterface);
        }

        this.definition = loadDefinition();
        if (definition != null) {
            if (definition.getServices().size() != 1) {
                throw new InvalidParameterException("The deployed wsdl defines more than one service");
            }
            javax.wsdl.Service wsdlSvc = (javax.wsdl.Service) definition.getServices().values().iterator().next();
            if (service == null) {
                service = wsdlSvc.getQName();
            } else if (!service.equals(wsdlSvc.getQName())) {
                throw new InvalidParameterException("The name of the Service defined by the deployed wsdl does not match the service name of the jbi endpoint");
            }
            if (wsdlSvc.getPorts().size() != 1) {
                throw new InvalidParameterException("The Service defined in the deployed wsdl must define exactly one Port");
            }
            Port wsdlPort = (Port) wsdlSvc.getPorts().values().iterator().next();
            if (endpoint == null) {
                endpoint = wsdlPort.getName();
            } else if (!endpoint.equals(wsdlPort.getName())) {
                throw new InvalidParameterException("The name of the Port defined by the deployed wsdl does not match the endpoint name of the jbi endpoint");
            }
            Binding wsdlBinding = wsdlPort.getBinding();
            if (wsdlBinding == null) {
                throw new InvalidParameterException("The Port defined in the deployed wsdl does not have any binding");
            }
            PortType wsdlPortType = wsdlBinding.getPortType();
            if (wsdlPortType == null) {
                throw new InvalidParameterException("The Binding defined in the deployed wsdl does not have reference a PortType");
            }
            if (interfaceName == null) {
                interfaceName = wsdlPortType.getQName();
            } else if (!interfaceName.equals(wsdlPortType.getQName())) {
                throw new InvalidParameterException("The name of the PortType defined by the deployed wsdl does not match the interface name of the jbi endpoint");
            }
            // Create the DOM document
            description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
        }
       
        String svcLocalName = (service != null) ? service.getLocalPart() : null;
        String svcNamespace;
        if (interfaceName != null) {
            svcNamespace = interfaceName.getNamespaceURI();
        } else if (service != null) {
            svcNamespace = service.getNamespaceURI();
        } else {
            svcNamespace = null;
        }
        Map props = new HashMap();
        props.put(ObjectServiceFactory.PORT_TYPE, interfaceName);
        if (style != null) {
            props.put(ObjectServiceFactory.STYLE, style);
        }
        props.put(ObjectServiceFactory.USE, SoapConstants.USE_LITERAL);
        if (serviceInterface != null) {
            props.put("annotations.allow.interface", "true");
        }
        xfireService = factory.create(serviceClass, svcLocalName, svcNamespace, props);
        xfireService.setInvoker(new BeanInvoker(getPojo()));
        xfireService.setFaultSerializer(new JbiFaultSerializer(getConfiguration()));
        xfireService.setProperty(SoapConstants.MTOM_ENABLED, Boolean.toString(mtomEnabled));
        xfire.getServiceRegistry().register(xfireService);
       
        // If the wsdl has not been provided,
        // generate one
        if (this.description == null) {
            this.description = generateWsdl();
View Full Code Here

Examples of org.codehaus.xfire.XFire

        return doc;
    }
   
    public XFire getXFire() {
        Jsr181LifeCycle jsr181LifeCycle = (Jsr181LifeCycle) this.serviceUnit.getComponent().getLifeCycle();
        XFire xfire = jsr181LifeCycle.getXFire();
        return xfire;
    }
View Full Code Here

Examples of org.codehaus.xfire.XFire

        configuration.load();
        xfire = createXFire(this.context);
    }
   
    public static XFire createXFire(ComponentContext context) {
        XFire xfire = new DefaultXFire();
        Object[] transports = xfire.getTransportManager().getTransports().toArray();
        for (int i = 0; i < transports.length; i++) {
            xfire.getTransportManager().unregister((Transport) transports[i]);
        }
        xfire.getTransportManager().register(new JbiTransport(context));
        return xfire;
    }
View Full Code Here

Examples of org.codehaus.xfire.XFire

            return;
        }

        // TODO: fault should not be serialized as soap
        // TODO: clean this code
        XFire xfire = endpoint.getXFire();
        Service service = endpoint.getXFireService();
        Transport t = xfire.getTransportManager().getTransport(JbiTransport.JBI_BINDING);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Channel c = t.createChannel();
        MessageContext ctx = new MessageContext();
        ctx.setXFire(xfire);
        ctx.setService(service);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.