Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.Service


    }
   
    public void testExecutor()
        throws Exception
    {
        Service service = getServiceFactory().create(Messenger.class);
        service.setExecutor(new Executor());
        getServiceRegistry().register(service);
       
        invokeService("Messenger", "/org/codehaus/xfire/echo11.xml");
       
        assertTrue(Executor.run);
View Full Code Here


    }

    public void testCreateClass()
            throws Exception
    {
        Service endpoint = objectServiceFactory.create(Echo.class);
        assertNotNull(endpoint);
        ServiceInfo service = endpoint.getServiceInfo();
        assertEquals(new QName("http://binding.service.xfire.codehaus.org", "Echo"), endpoint.getName());
        assertTrue(endpoint.getFaultSerializer() instanceof SoapFaultSerializer);
       
        assertTrue(service.isWrapped());
       
        AbstractSoapBinding soapOp = (AbstractSoapBinding) endpoint.getBindings().iterator().next();
        assertEquals(SoapConstants.USE_LITERAL, soapOp.getUse());
    }
View Full Code Here

    {
        Map properties = new HashMap();
        properties.put(ObjectServiceFactory.STYLE, SoapConstants.STYLE_RPC);
        properties.put(ObjectServiceFactory.USE, SoapConstants.USE_ENCODED);
       
        Service endpoint = objectServiceFactory.create(Echo.class,
                                                       "EchoService",
                                                       "http://xfire.codehaus.org",
                                                       properties);
        assertNotNull(endpoint);
        ServiceInfo service = endpoint.getServiceInfo();
        assertEquals(new QName("http://xfire.codehaus.org", "EchoService"), endpoint.getName());
       
        AbstractSoapBinding binding = (AbstractSoapBinding) endpoint.getBindings().iterator().next();
        assertEquals(SoapConstants.STYLE_RPC, binding.getStyle());
        assertEquals(SoapConstants.USE_ENCODED, binding.getUse());

        assertEquals(3, endpoint.getBindings().size());
    }
View Full Code Here

    {
        Map properties = new HashMap();
        properties.put(ObjectServiceFactory.STYLE, SoapConstants.STYLE_RPC);
        properties.put(ObjectServiceFactory.USE, SoapConstants.USE_ENCODED);
       
        Service endpoint = objectServiceFactory.create(Echo.class,
                                                       (String) null,
                                                       null,
                                                       properties);
        assertNotNull(endpoint);
        ServiceInfo service = endpoint.getServiceInfo();
        assertEquals(new QName("http://binding.service.xfire.codehaus.org", "Echo"), endpoint.getName());

        AbstractSoapBinding binding = (AbstractSoapBinding) endpoint.getBindings().iterator().next();
        assertEquals(SoapConstants.STYLE_RPC, binding.getStyle());
        assertEquals(SoapConstants.USE_ENCODED, binding.getUse());
    }
View Full Code Here

       
        ArrayList s12 = new ArrayList();
        s12.add(LocalTransport.BINDING_ID);
        properties.put(ObjectServiceFactory.SOAP12_TRANSPORTS, s12);
       
        Service endpoint = objectServiceFactory.create(Echo.class, (String) null, null, properties);
        assertNotNull(endpoint);
        ServiceInfo service = endpoint.getServiceInfo();
        assertEquals(new QName("http://binding.service.xfire.codehaus.org", "Echo"), endpoint
                .getName());

        assertEquals(2, endpoint.getBindings().size());
    }
View Full Code Here

    }

    public void testOverridenNames()
        throws Exception
    {
        Service service = getServiceFactory().create(OperationNameService.class);
       
        assertTrue( service.getServiceInfo().getOperation("doSomething") != null );
        assertTrue( service.getServiceInfo().getOperation("doSomething1") != null );
    }
View Full Code Here

               
                return method.getParameterTypes()[j].equals(String.class);
            }
        };
       
        Service service = osf.create(HeaderService.class);
        ServiceInfo info = service.getServiceInfo();
       
        MessageInfo inMsg =info.getOperation("doSomething").getInputMessage();
        assertEquals(1, inMsg.getMessageParts().size());
       
        AbstractSoapBinding soapOp = (AbstractSoapBinding) service.getBindings().iterator().next();
        MessagePartInfo part = soapOp.getHeaders(inMsg).getMessagePart(new QName(service.getName().getNamespaceURI(), "header"));
        assertNotNull(part);
    }
View Full Code Here

    }
   
    public void testFaultInfo()
        throws Exception
    {
        Service service = objectServiceFactory.create(EchoWithFault.class);
       
        OperationInfo op = service.getServiceInfo().getOperation("echo");
       
        assertEquals(1, op.getFaults().size());
       
        FaultInfo info = op.getFault("EchoFault");
        assertNotNull(info);
       
        assertEquals(1, info.getMessageParts().size());
        MessagePartInfo mp = info.getMessagePart(new QName(service.getName().getNamespaceURI(),
                                                           "EchoFault"));
        assertEquals(EchoFault.class, mp.getTypeClass());
    }
View Full Code Here

                return (j == 1);
            }
        };
        osf.setStyle(SoapConstants.STYLE_MESSAGE);
       
        Service service = osf.create(HeaderService.class, "HeaderService", "urn:HeaderService", null);
        getXFire().getServiceRegistry().register(service);
       
        OperationInfo op = (OperationInfo) service.getServiceInfo().getOperations().iterator().next();
        assertEquals(2, op.getInputMessage().getMessageParts().size());
       
        Binding binding = (Binding) service.getBindings().iterator().next();
        assertEquals(1, binding.getHeaders(op.getInputMessage()).getMessageParts().size());
       
        Document response = invokeService("HeaderService", "header.xml");
        assertNotNull(HeaderService.a);
        assertEquals("a", HeaderService.a.getName());
View Full Code Here

    public void setUp()
            throws Exception
    {
        super.setUp();

        Service service = getServiceFactory().create(AttachmentEcho.class);

        getServiceRegistry().register(service);
    }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.service.Service

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.