I have read a simple JAX-WS service article at [1] and found same factory
bean (JaxWsServerFactoryBean) for creating a JAX-WS server endpoint from a
class as in the migration guide at [2].

I have annotated simple service interface:
===================================
@WebService(name = "TicketOrderService",
            serviceName = "TicketOrderService",
            targetNamespace = "http://exoplatform.org/soap/xfire";)
public interface TicketOrderService {...
  public String getTicket (...
===================================
and my service simple implementation TicketOrderServiceImpl, which returns a
string representation of current time.

And here my cxf test:
===================================
        JaxWsServerFactoryBean serviceFactory = new
JaxWsServerFactoryBean();
        serviceFactory.getServiceFactory().setDataBinding(new
AegisDatabinding());
        serviceFactory.setServiceClass(TicketOrderService.class);
        serviceFactory.setAddress("local://TicketOrderService");
        Server server = serviceFactory.create();

        Service service = server.getEndpoint().getService();
        service.setInvoker(new BeanInvoker(new TicketOrderServiceImpl()));

        server.start();

        JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
        client.setServiceClass(TicketOrderService.class);
        client.setAddress("local://TicketOrderService");
        TicketOrderService ticket = (TicketOrderService) client.create();

        String ticketOrder = ticket.getTicket("1", "2", null, "3");
        System.out.println(">>> EXOMAN
TicketOrderServiceTest.testSayHelloService() ticketOrder = "
            + ticketOrder);
        assertNotNull(ticketOrder);
===================================

was an xfire test:
===================================
        XFire xfire = XFireFactory.newInstance().getXFire();
        assertNotNull(xfire);
        AnnotationServiceFactory annotationServiceFactory = new
AnnotationServiceFactory();
        Service ws =
annotationServiceFactory.create(TicketOrderService.getClass());
        xfire.getServiceRegistry().register(ws);

assertTrue(xfire.getServiceRegistry().hasService("TicketOrderService"));
===================================

It works. But whether all that I did was right?

[1]
http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html#AsimpleJAX-WSservice-Publishingyourservice
[2]
http://cwiki.apache.org/CXF20DOC/xfire-migration-guide.html#XFireMigrationGuide-ExampleAnnotationServiceFactoryMigration

On Thu, Sep 18, 2008 at 3:32 PM, Benson Margulies <[EMAIL PROTECTED]>wrote:

> You use the service factory bean to obtain a service, and you 'start'
> it. No need to register it.
>
> Are you moving to JAX-WS or using 'simple'? I can probably point you
> at an example either way.
>
> On Thu, Sep 18, 2008 at 8:10 AM, Alexey Zavizionov
> <[EMAIL PROTECTED]> wrote:
> > Thanks for the reply.
> >
> > Setting up all from java. I should not use Spring.
> >
> > On Thu, Sep 18, 2008 at 2:58 PM, Benson Margulies <[EMAIL PROTECTED]
> >wrote:
> >
> >> The closest equivalent, so far as I know, is publishing an endpoint.
> >> Have you moved to Spring config, or are you setting everything up from
> >> Java?
> >>
> >> On Thu, Sep 18, 2008 at 7:46 AM, Alexey Zavizionov
> >> <[EMAIL PROTECTED]> wrote:
> >> > Hello list,
> >> >
> >> > I have read a migration article at
> >> > http://cwiki.apache.org/CXF20DOC/xfire-migration-guide.html
> >> >
> >> > Where I could find a cxf equivalent to register service:
> >> >
> >>
> XFireFactory.newInstance().getXFire().getServiceRegistry().register(myService);
> >> >
> >> > Alexey.
> >> >
> >>
> >
>

Reply via email to