Package org.codehaus.xfire.service

Examples of org.codehaus.xfire.service.Service


public class JibxBindingTest
    extends AbstractXFireAegisTest
{
    public void testBinding() throws Exception
    {
        Service service = new JibxServiceFactory().create(AccountService.class, null, "http://xfire.codehaus.org/", null);
        service.setInvoker(new BeanInvoker(new AccountServiceImpl()));
        getServiceRegistry().register(service);
       
        Document response = invokeService("AccountService", "/org/codehaus/xfire/jibx/getAccountStatus.xml");
        addNamespace("a", "http://xfire.codehaus.org/jibx");
        addNamespace("x", "http://xfire.codehaus.org/");
View Full Code Here


   
    public void testNondefaultBinding() throws Exception
    {
        ServiceBean service = (ServiceBean) getContext().getBean("echoNondefaultBind");
        assertNotNull(service);
        Service endpoint = service.getXfire().getServiceRegistry().getService("EchoBind");
        //There should be no bindings, none specified and no default created
        assertEquals(0, endpoint.getBindings().size());
    }
View Full Code Here

        assertEquals(2, xfire.getInHandlers().size());
        assertTrue(xfire.getInHandlers().get(1) instanceof TestHandler);
        assertEquals(xfire.getOutHandlers().size(),1);
        assertEquals(xfire.getFaultHandlers().size(),1);
       
        Service service = xfire.getServiceRegistry().getService("testservice");
        assertNotNull(service);
       
        assertEquals(4, service.getBindings().size());
        assertNotNull(service.getBinding(SoapHttpTransport.SOAP11_HTTP_BINDING));
        assertNotNull(service.getBinding(SoapHttpTransport.SOAP12_HTTP_BINDING));
       
        assertEquals(1, service.getEndpoints().size());
        Endpoint ep = (Endpoint) service.getEndpoints().iterator().next();
        assertNotNull(ep);
        assertEquals("http://localhost/TestService", ep.getUrl());
       
        assertEquals(3, service.getInHandlers().size());
        Handler testHandler = (Handler) service.getInHandlers().get(2);
        assertTrue(testHandler instanceof TestHandler);
        assertEquals(testHandler.getAfter().size(),1);
        assertEquals(testHandler.getBefore().size(),2);
       
        assertEquals(service.getOutHandlers().size(),1);
       
        assertEquals("value", service.getProperty("myKey"));
        assertEquals("value1", service.getProperty("myKey1"));
        List types = (List) service.getProperty("overrideTypesList");
        assertNotNull(types);
       
        service = xfire.getServiceRegistry().getService("EchoWithJustImpl");
        assertEquals(EchoImpl.class, service.getServiceInfo().getServiceClass());
       
        service = xfire.getServiceRegistry().getService("EchoWithBean");
        Invoker invoker = service.getInvoker();
        assertTrue(invoker instanceof BeanInvoker);
        assertEquals(Echo.class, service.getServiceInfo().getServiceClass());
       
        service = xfire.getServiceRegistry().getService("EchoWithBeanNoServiceClass");
        invoker = service.getInvoker();
        assertTrue(invoker instanceof BeanInvoker);
        assertEquals(EchoImpl.class, service.getServiceInfo().getServiceClass());
       
        service = xfire.getServiceRegistry().getService("EchoWithSchemas");
       
        ServiceBean serviceBean = (ServiceBean) getBean("EchoWithServiceFactory");
        assertTrue(serviceBean.getServiceFactory() instanceof CustomServiceFactory);
View Full Code Here

    {
     
        ServiceBean serviceBean = (ServiceBean) getBean("ConcatService");
        assertEquals(2, serviceBean.getMethods().size());

        Service service = serviceBean.getXFireService();
        OperationInfo opInfo = service.getServiceInfo().getOperation("concat");
        assertNotNull(opInfo);
       
        assertEquals(2, opInfo.getInputMessage().size());

        MessagePartInfo part = opInfo.getInputMessage().getMessagePart(new QName("urn:concat-service", "s1"));
        assertNotNull(part);
       
        opInfo = service.getServiceInfo().getOperation("concatThreeStrings");
        assertNotNull(opInfo);
       
        part = opInfo.getInputMessage().getMessagePart(new QName("urn:test", "two"));
        assertNotNull(part);
       
        part = opInfo.getOutputMessage().getMessagePart(new QName("urn:test", "sum"));
        assertNotNull(part);
       
        opInfo = service.getServiceInfo().getOperation("excluded");
        assertNull(opInfo);
    }
View Full Code Here

    {
        super.setUp();

        ObjectServiceFactory osf = (ObjectServiceFactory) getServiceFactory();

        Service service = osf.create(Echo.class);
        service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, CustomFaultEcho.class);

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

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

        Service service = getServiceFactory().create(Echo.class);
        service.setProperty(ObjectInvoker.SERVICE_IMPL_CLASS, CustomFaultEcho.class);

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

        getServiceRegistry().register(service);
    }

    public void testAnyService() throws Exception
    {
        Service any = factory.create(TestService.class, "TestService", "urn:TestService", null);
        getServiceRegistry().register(any);

        try
        {
            getWSDLDocument("TestService");
View Full Code Here

    protected void setUp()
            throws Exception
    {
        htmlServiceWriter = new HtmlServiceWriter();
        ServiceInfo serviceInfo = new ServiceInfo(new QName("serviceport"), getClass());
        service = new Service(serviceInfo);
        service.setName(new QName("service"));
    }
View Full Code Here

public class BookClient
{
    public static void main(String args[])
    {
        String serviceURL = "http://localhost:8088/book/services/BookService";
        Service serviceModel = new ObjectServiceFactory().create(BookService.class,null,"http://xfire.codehaus.org/BookService",null);
       
        XFireProxyFactory serviceFactory = new XFireProxyFactory();
       
        try
        {
View Full Code Here

    {
        super.setUp();

        ObjectServiceFactory osf = (ObjectServiceFactory) getServiceFactory();
        osf.addSoap12Transport(SoapHttpTransport.SOAP12_HTTP_BINDING);
        Service service = osf.create(EchoImpl.class);
        WSDLWriter writer = new ResourceWSDL(getClass().getResource("/org/codehaus/xfire/echo11.wsdl"));
        service.setWSDLWriter(writer);

        service.addInHandler(new MockSessionHandler());
        getServiceRegistry().register(service);

        Service faultService = getServiceFactory().create(BadEcho.class);

        getServiceRegistry().register(faultService);
       
        // Asynchronous service
        Service asyncService = osf.create(AsyncService.class);
        OperationInfo op = asyncService.getServiceInfo().getOperation("echo");
        op.setMEP(SoapConstants.MEP_IN);
        op.setOutputMessage(null);
        getServiceRegistry().register(asyncService);
    }
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.