Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.soa.esb.actions.soap.wise
Class SOAPClient

    java.lang.Object
      org.jboss.soa.esb.actions.AbstractActionLifecycle
          org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
              org.jboss.soa.esb.actions.soap.wise.SOAPClient

All Implemented Interfaces:
  ActionLifecycle, ActionPipelineProcessor

    public class SOAPClient

extends AbstractActionPipelineProcessor

SOAP Client action processor.

Uses the Wise Client Service to generate JAXWS client class and call the target service. This action then routes that message to that service.

## Endpoint Operation Specification

Specifying the endpoint operation is a straightforward task. Simply specify the "wsdl" and "SOAPAction" properties on the SOAPClient action as follows:

            <action name="soap-wise-client-action" class="org.jboss.soa.esb.actions.soap.wise.SOAPClient">
                <property name="wsdl" value="http://localhost:8080/acme/services/OrderManagement?wsdl"/>
                <property name="SOAPAction" value="http://www.acme.com/OrderManagement/SendSalesOrderNotification"/>
            </action>

The SOAP operation is derived from the SOAPAction. There are some optional attribute:

            <property name="EndPointName" value="PingWSPort"/>

The EndPoint invoked. Webservices can have multiple endpoint. If it's not specified the first specified in wsdl will be used

            <property name="SmooksRequestMapper" value="smooks-request-config.xml"/>

It's a smooks config file to define the mapping java-to-java defined for the request

            <property name="SmooksResponseMapper" value="smooks-response-config.xml"/>

It's a smooks config file to define the mapping java-to-java defined for the response

            <property name="serviceName" value="PingWS"/>

It's a symbolic service name used by wise to cache object generation and/or use already generated object. It it isn't provided wise use the servlet name of wsdl.

            <property name="userName" value=""/>
            <property name="password" value=""/>

User and password used if webservice is protected by BAsic Authentication HTTP user and password

## SOAP Request Message Construction

The SOAP operation parameters are supplied in one of 2 ways:

1. As a `Map` instance set on the default body location (Message.getBody().add(Map))
2. As a `Map` instance set on in a named body location (Message.getBody().add(String, Map)), where the name of that body location is specified as the value of the "paramsLocation" action property.

The parameter `Map` itself can also be populated in one of 2 ways:

1. Option 1: With a set of Objects of any type. In this case a smooks config have to be specified in action attribute SmooksRequestMapper and smooks is used to make the java-to-java conversion
2. Option 2: With a set of String based key-value pairs(<String, Object>), where the key is the name of the SOAP parameter as specified in wsdls (or in generated class) to be populated with the key's value.

## SOAP Response Message Consumption

The SOAP response object instance can be is attached to the ESB `Message` instance in one of the following ways:

1. On the default body location (Message.getBody().add(Map))
2. On in a named body location (Message.getBody().add(String, Map)), where the name of that body location is specified as the value of the "responseLocation" action property.

The response object instance can also be populated (from the SOAP response) in one of 3 ways:

1. Option 1: With a set of Objects of any type. In this case a smooks config have to be specified in action attribute SmooksResponseMapper and smooks is used to make the java-to-java conversion
2. Option 2: With a set of String based key-value pairs(<String, Object>), where the key is the name of the SOAP answer as specified in wsdls (or in generated class) to be populated with the key's value.

## JAX-WS Handler for the SOAP Request/Response Message

It's often necessary to be able to transform the SOAP request or response, especially in header. This may be to simply add some standard SOAP handlers. Wise support JAXWS Soap Handler, both custom or a predefined one based on smooks.

Transformation of the SOAP request (before sending) is supported by configuring the SOAPClient action with a Smooks transformation configuration property as follows:

         <property name="smooksTransform" value="/transforms/order-transform.xml" />

The value of the "smooksTransform" property is resolved by first checking it as a filesystem based resource. Failing that, it's checked as a classpath resource and failing that, as a URI based resource.

It's also possible to provide a set of custom standard JAXWS Soap Handler. The parameter accept a list of classes implementing SoapHandler interface. Classes have to provide full qualified name and be separated by semi-columns.

         <property name="custom-handlers" value="package.Class1;package.Class2" />

## Logging the SOAP Request/Response Message

It's useful for debug purpose to view soap Message sent and response received. Wise achieve this goal using a JAX-WS handler printing all messages exchanged on System.out You can enable as follow:

         <property name="LoggingMessages" value="true" />

Author:
  stefano.maestri@javalinux.it

Field Summary

Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
`PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD`

Constructor Summary
`SOAPClient(ConfigTree config)`

Method Summary
`void` | `destroy()` Destroy the action instance.
`void` | `initialise()` Initialise the action instance.
`Message` | `process(Message message)` Perform the action processing on the specified message.

Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
`processException, processSuccess`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SOAPClient

    public SOAPClient(ConfigTree config)
               throws ConfigurationException

Throws:
  `ConfigurationException`

Method Detail

### initialise

    public void initialise()
                    throws ActionLifecycleException

  Description copied from class: `AbstractActionLifecycle`
  Initialise the action instance.

  This method is called after the action instance has been instantiated so that configuration options can be validated.

  Specified by:
    `initialise` in interface `ActionLifecycle`
  Overrides:
    `initialise` in class `AbstractActionLifecycle`
  Throws:
    `ActionLifecycleException` - for errors during initialisation.

### destroy

    public void destroy()
                 throws ActionLifecycleException

  Description copied from class: `AbstractActionLifecycle`
  Destroy the action instance.

  This method is called prior to the release of the action instance. All resources associated with this action instance should be released as the instance will no longer be used.

  Specified by:
    `destroy` in interface `ActionLifecycle`
  Overrides:
    `destroy` in class `AbstractActionLifecycle`
  Throws:
    `ActionLifecycleException`

### process

    public Message process(Message message)
                    throws ActionProcessingException

  Description copied from interface: `ActionPipelineProcessor`
  Perform the action processing on the specified message. This method is invoked for each message passing throught the pipeline.

  Parameters:
    `message` - The current message being processed.
  Returns:
    The message to be passed to the next stage of the pipeline.
  Throws:
    `ActionProcessingException` - for errors during processing.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD