Package org.codehaus.xfire

Examples of org.codehaus.xfire.XFire


  }

  private XFireHttpServer startXFireServer(int httpPort, XFireExporter exporter) throws Exception {
    Service service = exporter.getXFireService();

        XFire xfire = XFireFactory.newInstance().getXFire();
        xfire.getServiceRegistry().register(service);
       
    XFireHttpServer server = new XFireHttpServer();
    server.setPort(httpPort);
    server.start();
   
View Full Code Here


        ObjectServiceFactory serviceFactory = new ObjectServiceFactory();
        Service service = serviceFactory.create(Echo.class);
        service.setInvoker(new BeanInvoker(new EchoImpl()));
       
        // Register the service in the ServiceRegistry
        XFire xfire = XFireFactory.newInstance().getXFire();
        xfire.getServiceRegistry().register(service);
       
        // Start the HTTP server
        server = new XFireHttpServer();
        server.setPort(8191);
        server.start();
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();
       
        // Register the web service.
        XFire xfire = getXFire();
        ServiceFactory factory = new ObjectServiceFactory(xfire.getTransportManager(), null);
       
        Service service = factory.create(BookService.class);
        service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, BookServiceImpl.class);
        xfire.getServiceRegistry().register(service);
    }
View Full Code Here

{
    public void testConfigLoader()
        throws Exception
    {
        XFireConfigLoader configLoader = new XFireConfigLoader();
        XFire xfire = configLoader.loadConfig("META-INF/xfire/sservices.xml", null);
       
        doAssertions(xfire);
    }
View Full Code Here

   
    public void testConfigLoaderWithFilesystem()
        throws Exception
    {
        XFireConfigLoader configLoader = new XFireConfigLoader();
        XFire xfire = configLoader.loadConfig(getTestFile("src/test/META-INF/xfire/sservices.xml").getAbsolutePath());
       
        doAssertions(xfire);
    }
View Full Code Here

    public void testConfigLoaderWithMultipleFiles()
        throws Exception
    {
        XFireConfigLoader configLoader = new XFireConfigLoader();
        configLoader.setBasedir(getTestFile("."));
        XFire xfire = configLoader.loadConfig("src/test/META-INF/xfire/sservices.xml, " +
                "org/codehaus/xfire/spring/config/OperationMetadataServices.xml");
       
        doAssertions(xfire);
    }
View Full Code Here

    {
      ServletContext servletCtx = new MockServletContext();
      ClassPathXmlApplicationContext appCtx = new ClassPathXmlApplicationContext(new String[] {"org/codehaus/xfire/spring/xfire.xml"});

        XFireConfigLoader configLoader = new XFireConfigLoader();
        XFire xfire = configLoader.loadConfig("META-INF/xfire/sservices.xml", appCtx);

        doAssertions(xfire);
    }
View Full Code Here

    extends AbstractXFireAegisTest
{
    public void testWSDL() throws Exception
    {  
       XFireConfigLoader loader = new XFireConfigLoader();
       XFire xfire = loader.loadConfig(new File(new File(getBasedir()), "target/auth-service/META-INF/xfire/services.xml").getAbsolutePath());
      
       assertTrue(xfire.getServiceRegistry().getServices().size() == 1);
      
       Service service = xfire.getServiceRegistry().getService(new QName("urn:xfire:authenticate", "AuthService"));
      
       assertNotNull(service);
      
       assertTrue(service.getWSDLWriter() instanceof ResourceWSDL);
    }
View Full Code Here

            }
            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) {
            updateDescription();
        }
       
        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));
        if (validationEnabled != null) {
            if ("jaxb2".equals(typeMapping)) {
                xfireService.setProperty(JaxbType.ENABLE_VALIDATION, validationEnabled.toString());
            } else {
                throw new IllegalArgumentException("Currently you can controll validation only for jaxb2 mapping. "
                                                   + typeMapping + " is not supported.");
            }
        }
        xfire.getServiceRegistry().register(xfireService);
       
        // If the wsdl has not been provided,
        // generate one
        if (this.description == null) {
            createDescription();
View Full Code Here

        } 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

TOP

Related Classes of org.codehaus.xfire.XFire

Copyright © 2018 www.massapicom. 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.