I confess that I'm disoriented by the several discussions of web
services on the various pages on the web site with respect to spring.

What I have: a successful web service that combines aegis and jsr181
using the XFireHttpServer.

What I want: to deploy the same service in jetty and spring, instead.

Could some kind soul give me some assistance?

Here is the code that currently launches the service ...

XFire xfire = XFireFactory.newInstance().getXFire();
                
 
        AegisBindingProvider binder = /* this was an interesting idea
that doesn't quite work. 
            new AegisBindingProvider(new
TypeMappingRegistryForXMLWithNamespacePrefixes());
            */
            new AegisBindingProvider();

        
        AnnotationServiceFactory serviceFactory = new
AnnotationServiceFactory(new Jsr181WebAnnotations(), 
                xfire.getTransportManager(), binder);
        
        DefaultTypeMappingRegistry tmr =
(DefaultTypeMappingRegistry)binder.getTypeMappingRegistry();

        // here we disuade XFire from its rather annoying tendency to
assume that, just because
                // anything in Java can be null, that we want to
advertise all that nullity all over.
                Configuration configuration = tmr.getConfiguration();
                configuration.setDefaultMinOccurs(1);
                configuration.setDefaultNillable(false);
                
//               Create a properties hashmap
                HashMap<String, Object> props = new HashMap<String,
Object>();

//               Enable the writing of xsi:type attributes
                props.put(AegisBindingProvider.WRITE_XSI_TYPE_KEY,
Boolean.TRUE);

//               Supply a list of class names which need to be included
in the wsdl.
                ArrayList<String> l = new ArrayList<String>();
                // add class names here for extra types if we need them.
 
l.add(com.basistech.rnm.index.NameIndexException.class.getName());
                props.put(AegisBindingProvider.OVERRIDE_TYPES_KEY, l);
                Service service =
serviceFactory.create(NameIndexServiceImpl.class, props);

                service.setInvoker(new BeanInvoker(new
NameIndexServiceImpl(configPath)));
        service.addFaultHandler(new AbstractHandler () {
            public void invoke(MessageContext context) throws Exception
{
                StandaloneServiceStarter.this.invoke(context);

            }} );


                xfire.getServiceRegistry().register(service);

                // Start the HTTP server
                server = new XFireHttpServer();
                server.setPort(port);
        server.setStaticContentDirectory(staticContentPath);
                server.start();
                server.join();

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to