Package org.codehaus.xfire.example

Source Code of org.codehaus.xfire.example.ServiceStarterTest

package org.codehaus.xfire.example;

import junit.framework.TestCase;

import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import org.codehaus.xfire.test.Echo;

public class ServiceStarterTest extends TestCase
{
 
    public void testService() throws Exception
    {
        // START SNIPPET: service
        ServiceStarter starter = new ServiceStarter();
        starter.start();
       
        // Create a service model for the client
        ObjectServiceFactory serviceFactory = new ObjectServiceFactory();
        Service serviceModel = serviceFactory.create(Echo.class);

        // Create a client proxy
        XFireProxyFactory proxyFactory = new XFireProxyFactory();
        Echo echo = (Echo) proxyFactory.create(serviceModel, "http://localhost:8191/Echo");
       
        System.out.println(echo.echo("Hello World"));
       
        starter.stop();
        // END SNIPPET: service
    }
}
TOP

Related Classes of org.codehaus.xfire.example.ServiceStarterTest

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.