1 Reply Latest reply on May 16, 2007 5:32 AM by Tom Fennelly

    About SOAPUIClient action

    SLIMI Khalil Newbie

      Hi,

      Can you explain to me what's supposed to be in "paramsLocation" parameter of SOAPUIClient action. From the code I know it's a Map, but how this Map should be constructed and where to put it? is it in the body of the message as an object with a key?

      For example, I have a WS with "operation(String name)" I hava the "name" parameter in the message body, and I want to call SOAPUIClient, what should I put in paramsLocation?


      Regards.

        • 1. Re: About SOAPUIClient action
          Tom Fennelly Master

          First a little background.... The SOAPUIClient action (we'll probably change the name of this to something more generic for the GA) embeds the core of the soapUI client in an ESB action. This action uses soapUI to generate a SOAP template for a given operation on a given wsdl (from which you can also determine the endpoint). The action then uses the position of the template's replacement tokens ("?") to generate OGNL expressions, which are then used to query the Map you refer (using OGNL) to get the token replacement values. So, this OGNL stuff is what you're interested in...

          If you have a SOAP message template such as the following (generated by the SOAPUIClient):

          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:abi="http://org.jboss.esb/quickstarts/bpel/ABI_OrderManager">
           <soapenv:Header/>
           <soapenv:Body>
           <abi:salesOrderNotification>
           <abi:orderNumber>?</abi:orderNumber>
           </abi:salesOrderNotification>
           </soapenv:Body>
          </soapenv:Envelope>
          


          From the position of the "orderNumber" replacement token, the SOAPUIClient will generate an OGNL expression of "salesOrderNotification.orderNumber". This means that, in order to populate this location of the template, the Map needs to contain a bean stored on the key "salesOrderNotification" and this bean needs to contain a property called "orderNumber".

          So, the bean might look like this (not including the setter/getter methods):
          public class Order {
           ...
           private long orderNumber;
           ...
          }
          


          An instance of this bean would "somehow" need to be set on the Map as follows:
           ....
           map.put("salesOrderNotification", order);
           ....
          


          And the Map needs to be set on the ESB message supplied to the SOAPUIClient action. It can be set in the default message location by simply setting it on the message body ala...
           ...
           message.getBody().add(map);
           ...
          

          In this case you don't need to specify the "paramsLocation" action property on SOAPUIClient.

          If the Map is not the primary message payload, then it can be set in a named location on the message body ala...

           ...
           message.getBody().add("xxxxxx", map);
           ...
          


          In this case, the SOAPUIClient action config needs to contain a "paramsLocation" property instance with a value of "xxxxxx". The webservice_bpel quickstart uses this feature since the SOAPUIClient action is preceded by a SmooksTransformer action instance, which builds and populates the Map and stores it on the message body under a key of "EXTRACTED_BEANS_HASH" (hence the "paramsLocation" property on the SOAPUIClient action is set to this value).

          I would like to point out that the SOAPUIClient action is very much in a prototype state. It currently supports just enough to get that webservice_bpel sample up and running. It doesn't support manipulation of the SOAPUI generated template to support collections. It also doesn't support SOAP response processing (i.e. the reverse of what it's doing in that sample). I'm working on adding these features right now.