Examples of XFire


Examples of org.codehaus.xfire.XFire

        } else if (exchange.getStatus() == ExchangeStatus.ERROR) {
            return;
        }

        // 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

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

            }
            Class cl = Class.forName(pojoClass, true, getServiceUnit().getConfigurationClassLoader());
            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, true, getServiceUnit().getConfigurationClassLoader());
        }

        this.definition = loadDefinition();
        if (definition != null) {
            if (definition.getServices().size() != 1) {
                throw new IllegalArgumentException("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 IllegalArgumentException("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 IllegalArgumentException("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 IllegalArgumentException("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 IllegalArgumentException("The Port defined in the deployed wsdl does not have any binding");
            }
            PortType wsdlPortType = wsdlBinding.getPortType();
            if (wsdlPortType == null) {
                throw new IllegalArgumentException("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 IllegalArgumentException("The name of the PortType defined by the deployed wsdl does not match the interface name of the jbi endpoint");
            }
            // Create the DOM document
            definition = new WSDLFlattener(definition).getDefinition(interfaceName);
            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(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE);
        }
        if (properties != null) {
            props.putAll(properties);
        }
        xfireService = factory.create(serviceClass, svcLocalName, svcNamespace, props);
        xfireService.setInvoker(new BeanInvoker(getPojo()));
        xfireService.setFaultSerializer(new JbiFaultSerializer());
        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() {
        Jsr181Component component = (Jsr181Component) this.serviceUnit.getComponent();
        XFire xfire = component.getXFire();
        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 = 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

        });
    }
   
    synchronized private 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

        Thread.currentThread().setContextClassLoader(overridingContextClassLoader);
        // displayClasspath(overridingContextClassLoader, "classLoader");

        XFireConfigLoader configLoader = new XFireConfigLoader();

        XFire xfire;

        try {
            xfire = configLoader.loadConfig( configUrl );
        } catch (XFireException e) {
            throw new BuildException( "Failure to load the configUrl", e);
        }

        final ServiceRegistry serviceRegistry = xfire.getServiceRegistry();

        Collection services = serviceRegistry.getServices();

       
       
View Full Code Here

Examples of org.codehaus.xfire.XFire

        }
    }

    public XFire getXFire()
    {
        XFire xfire = null;

        try
        {
            xfire = (XFire) getServiceLocator().lookup(XFire.ROLE);
        }
View Full Code Here

Examples of org.codehaus.xfire.XFire

    }

  public XFire createXFire() throws ServletException
  {
        configPath = getInitParameter(PARAM_CONFIG);
        XFire xfire;
        try
        {
      xfire = loadConfig(getConfigPath());
    }
    catch (XFireException e)
    {
      throw new ServletException(e);
    }
       
        if(xfire == null || xfire.getServiceRegistry() == null || xfire.getServiceRegistry().getServices() == null || xfire.getServiceRegistry().getServices().size() == 0)
        {
            xfire = super.createXFire();
        }

        return xfire;
View Full Code Here

Examples of org.codehaus.xfire.XFire

        if(servletCtx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE) == null)
        {
             servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, newCtx);
        }

        XFire xfire = (XFire) newCtx.getBean("xfire");
        xfire.setProperty(XFire.XFIRE_HOME, getWebappBase().getAbsolutePath());
        return xfire;
    }
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.