org.mule.transport.soap
Class WSProxyService

java.lang.Object
  extended by org.mule.transport.soap.WSProxyService
All Implemented Interfaces:
Callable, EventListener, Initialisable, ServiceAware

public class WSProxyService
extends Object
implements Callable, ServiceAware, Initialisable

This class is implemented to act as a Proxy for a Web Service. It listens for requests on the inbound endpoint and if it encounters the "WSDL" property in the address, it will fetch the WSDL from the original web service and return it back. In case the wsdlFile property is set, when the WSProxyService encounters a request for the wsdl, instead of fetching the WSDL from the original web service, it will return back the file expressed in the property. When a normal SOAP request is encountered, it will forward the call to the web service with no modifications to the SOAP message. The outbound router of this class must include the address of the webservice to be proxied. No need to include the method name as a parameter in the address, since it will be in the SOAP message as well. Furthermore a property named uriWsdl can optionally be set which as the name suggests, indicate the URL of the WSDL for the service. If this property is not set, the address of the WSDL will be assumed to be the value of uriWebservice followed by "?WSDL". It is important to note that both urls' of the webservice to be proxied and the WSDL address must contain no xfire or axis endpoints, just plain http endpoints. Even the inbound endpoint of the WSProxyService must be residing on an http protocol (with no xfire or axis).


Field Summary
protected static Log logger
           
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Constructor Summary
WSProxyService()
           
 
Method Summary
 String getWsdlEndpoint()
           
 String getWsdlFile()
           
 void initialise()
          Method used to perform any initialisation work.
 Object onCall(MuleEventContext eventContext)
          Passes the event to the listener
 void setService(Service service)
           
 void setWsdlEndpoint(String urlWsdl)
           
 void setWsdlFile(String wsdlFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
Constructor Detail

WSProxyService

public WSProxyService()
Method Detail

getWsdlEndpoint

public String getWsdlEndpoint()
Returns:
returns the url of the WSDL

setWsdlEndpoint

public void setWsdlEndpoint(String urlWsdl)
Parameters:
urlWsdl - Sets the property urlWsdl (the url of the WSDL of the web service)

getWsdlFile

public String getWsdlFile()
Returns:
returns the location of the local wsdl

setWsdlFile

public void setWsdlFile(String wsdlFile)
Parameters:
wsdlFile - sets the location of the local wsdl file

onCall

public Object onCall(MuleEventContext eventContext)
              throws Exception
Description copied from interface: Callable
Passes the event to the listener

Specified by:
onCall in interface Callable
Parameters:
eventContext - the context of the current event being process
Returns:
Object this object can be anything. When the LifecycleAdapter for the service receives this object it will first see if the Object is an MuleMessage if not and the Object is not null a new message will be created using the returned object as the payload. This new event will then get published via the configured outbound router if-
  1. One has been configured for the component.
  2. the setStopFurtherProcessing(true) wasn't called on the event context event.
Throws:
Exception - if the event fails to process properly. If exceptions aren't handled by the implementation they will be handled by the exceptionListener associated with the service

setService

public void setService(Service service)
Specified by:
setService in interface ServiceAware

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.