Mule : Glue
This page last changed on Oct 12, 2006 by andrew.
WebMethods Glue integrates with Mule meaning you can expose Mule components as Glue Web Services and invoke Glue Web Services from Mule. To expose a Mule component as an Glue service all you have to do is set the components receive endpoint to An Glue URL, i.e. <mule-descriptor name="echoService" inboundEndpoint="glue:http://localhost:81/services" implementation="org.mule.components.simple.EchoComponent"> </mule-descriptor> When Mule starts, the service will be available on http://localhost:81/services/echoService. The Echo component class has a single method called echo that accepts a single parameter string that it will echo back to the client. To invoke the service you can use the Mule Client i.e. TestEchoService.java public static void main(String[] args) { MuleClient client = new MuleClient(); UMOMessage result = client.send ("glue:http://localhost:81/services/echoService?method=echo", "Hello!", null); System.out.println("Message Echoed is: " + result.getPayload()); } When the TestEchoService is run you will see the following output - Message Echoed is: Hello! Getting the WSDLTo get the WSDL for a Glue service hosted by Mule you add ".wsdl" to the service URL. Using the example service above you would use - http://localhost:81/services/echoService.wsdl
Configuring Mule Components As Glue ServicesService Initialiation CallbackIf you need control over the Glue service created by Mule it is possible for your component to implement org.mule.providers.soap.glue.GlueInitialisable. GlueInitialisable.java public interface GlueInitialisable { public void initialise(IService service, ServiceContext context) throws InitialisationException; } This gets called when the service is initialised and allows you to customise the service configuration form your Mule component. The service created is an instance of electric.service.virtual.VirtualService which is a proxy that invokes the underlying Mule component. Developers can use the the ServiceContext to add handlers and other configuration to the service before it is registered with the Glue server. Unlike the Axis Support the Glue provider uses Glue's internal Http server rather that the Mule Http provider. |
Document generated by Confluence on Nov 27, 2006 10:27 |