RIT - SOAP

SOAP

SOAP Header

Normally there should not be any change in code to utilize the stubs, but I found that you must (...) have a SOAPAction in the code, because that was generated in line with the WSDL definition. The request must match the service/stub definition.

Tip! IF the SOAPAction is not defined in the stub, you don't need any SOAPAction in your code.
        // You must have a "SOAPAction" to be processed by RIT-stub
        MimeHeaders headers = soapMessage.getMimeHeaders();
        headers.addHeader("SOAPAction", "\"Add\"");

Complete source for addNumbers can be found: First.java

SOAP Message

With RIT you can write your message to a file (use Publish). This is an example of such a request. The contents can be different depending on the configuration of the message.

<?xml version="1.0" encoding="utf-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
   <ns:addition xmlns:ns="http://GH.endpoint/">
      <arg0>88</arg0>
      <arg1>45</arg1>
   </ns:addition>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Repeating Elements

Source files:

See: ECMAScript

In a SOAP message element can be repeated. As an example, inspired on a real case, is a single SOAP message which contains one or multiple transactions.

On the input (e.g. a Subscribe):

Figure: Apply the repeating element, just reference the list elements to store values

We don't want to create a simple variable, but a list of values.

Figure: Make sure you apply the "Append to list of values"

On the output (e.g. a Publish):

Figure: Using repeating element, just reference the list elements

See also ECMA Script

Choice Element

A choice element in the soap message can result in a totally different structure of the message and data. This can be handled by specification of a filter on the stub definition.

Figure: Multiple Envents definitions

Figure: Make sure you apply a Does Exists filter on the node.

transactionfinder.wsdl (rebuild of HotelFinder to transactions).

SOAP 1.2

By default we use SOAP1.1.

Figure: Setting the SOAP Version which is a property of the schema.

When tests are created one can edit the setting of the test by changing the properties of the text-node. You can set SOAP1.2 by

  1. Contextual menu on text-node
  2. Select properties
  3. Select SOAP tab
  4. Set SOAP Version to SOAP 1.2

Figure: Setting the SOAP Version which is a property of the text-node.

Multiple SOAPActions in 1 Stub

You can define in one stub, multiple SOAPActions.

Figure: Setting the SOAP Version which is a property of the text-node.

Other sources