Class Index

Classes


Class Message


Extends CompositionItem.

Class Summary
Constructor Attributes Constructor Name and Description
 
Represents a Message within the Composition.
Field Summary
Field Attributes Field Name and Description
{integer}  
The number of bytes that were received.
{integer}  
The number of bytes that were sent.
{boolean}  
True if this Message had any validation failures.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
<constant> {integer}  
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method.
{integer}  
The total amount of time, in milliseconds, that it took to send the message and receive the response.
{integer}  
The number of retries that were required due to unavailable local ports when sending the message.
{integer}  
The total amount of time, in milliseconds, that was spent retrying due to unavailable local ports when sending the message.
{Target}  
The Target object for this Message.
{integer}  
The "time to first byte" measurement for this message.
{integer}  
The "time to last byte" measurement for this message.
{String}  
The value "Message".
Fields borrowed from class CompositionItem:
children, completionType, failureText, forEachValue, hasErrorEvents, index, name, nextItem, parent, path, playNumber, playNumberBeforeRenewal, playNumberWithinRenewal, previousItem, propertyList, REPEAT_DISTRIBUTION_CONSTANT, REPEAT_TIMING_PARALLEL, REPEAT_TIMING_SERIAL, REPEAT_TYPE_COUNT_CONSTANT, repeatIndex, systemPropertyList
Method Summary
Method Attributes Method Name and Description
 
Clears any current response from memory.
{String}  
getMessage(messageFieldIndicator)
Returns all or the specified portion of the message that is to be sent.
{String[]}  
If the response to this Message is HTML, the HTML is parsed and any links on the HTML page to external resources are extracted and returned as an array of URLs.
{Object}  
getResponse(responseFieldIndicator, param)
Returns all or the specified portion of the response, if a response has been received.
 
setMessage(value, messageFieldIndicator)
Sets all or the specified portion of the message that is to be sent.
Methods borrowed from class CompositionItem:
clearRepeat, end, endRepeat, getChild, getItemViaPath, setRepeat
Class Detail
Message()
Represents a Message within the Composition.
Field Detail
{integer} bytesReceivedCount
The number of bytes that were received. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{integer} bytesSentCount
The number of bytes that were sent. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{boolean} hasValidationFailures
True if this Message had any validation failures.

False until the Message plays. If the Message never plays, remains false.

Read only.

Since:
Build 5618

<constant> {integer} MESSAGE_HTTP_BODY
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods. (See the descriptions of those methods.)

Read only.


<constant> {integer} MESSAGE_HTTP_HEADERS
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods. (See the descriptions of those methods.)

Read only.


<constant> {integer} MESSAGE_TEXT
A constant that can be passed as the "indicator" parameter in calls to the "getMessage" and "setMessage" methods. (See the descriptions of those methods.)

Read only.


<constant> {integer} RESPONSE_HTTP_BODY
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_BODY_AS_HTML
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_BODY_AS_JSON
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_BODY_AS_XML
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_BODY_WITH_JSONPATH
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_HEADER
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_HEADER_LIST
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_PROTOCOL
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_STATUSCODE
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_HTTP_STATUSTEXT
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_TEXT
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_TEXT_AS_HTML
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_TEXT_AS_JSON
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_TEXT_AS_XML
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


<constant> {integer} RESPONSE_TEXT_WITH_JSONPATH
A constant that can be passed as the "indicator" parameter in calls to the "getResponse" method. (See the description of the "getResponse" method.)

Read only.


{integer} responseTime
The total amount of time, in milliseconds, that it took to send the message and receive the response. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{integer} retryCount
The number of retries that were required due to unavailable local ports when sending the message. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{integer} retryTotalTime
The total amount of time, in milliseconds, that was spent retrying due to unavailable local ports when sending the message. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{Target} target
The Target object for this Message. Can be null.

Read only.


{integer} timeToFirstByte
The "time to first byte" measurement for this message. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{integer} timeToLastByte
The "time to last byte" measurement for this message. Will be null if the message has not yet been sent or if in "preview" mode.

Read only.


{String} type
The value "Message". Read only.
Method Detail
clearResponse()
Clears any current response from memory.

Can be used after the Message plays to free up the memory used to hold the response if the Message does not have scope "private".

If the Mesage has scope private, this call is not necessary, since the memory will be freed automatically by the system when it goes out of scope.


{String} getMessage(messageFieldIndicator)
Returns all or the specified portion of the message that is to be sent.

The indicator values that are permitted, and the type and format of the information returned, depends upon the type of the Message's Target. The type of the Target is set at the time the Target is created, through the "Target Creation Wizard", Clip generation from a Recording, or through a manual creation process. The types of Targets are: WSDL, HTTP, WebUI/Ajax, JMS, and REST. (Note that types JMS and REST cannot currently be created through the Target Editor and can only be created through a manual creation process by SOASTA Support.) Targets of type WebUI/Ajax cannot be used with Messages (they are used with Browser Actions only) and thus are not applicable here.

The "indicator" parameter must be one of the following:

If the "indicator" parameter is omitted, null or undefined, "MESSAGE_HTTP_BODY" will be assumed for all types other than JMS. For JMS, "MESSAGE_TEXT" will be assumed.

Example of the XML returned for indicator "MESSAGE_TEXT" for JMS Targets:

<Content xmlns="http://www.soasta.com/services/repository">
  <JMS xmlns="http://www.soasta.com/services/repository">
    <Mapped xmlns="http://www.soasta.com/services/repository">
      <Field name="Field1 string" type="string" xmlns="http://www.soasta.com/services/repository">Base64 test value</Field>
      <Field name="Field2 boolean" type="boolean" xmlns="http://www.soasta.com/services/repository">false</Field>
      <Field name="Field3 byte" type="byte" xmlns="http://www.soasta.com/services/repository">23</Field>
      <Field name="Field4 short" type="short" xmlns="http://www.soasta.com/services/repository">234</Field>
      <Field name="Field5 int" type="int" xmlns="http://www.soasta.com/services/repository">2345</Field>
      <Field name="Field6 long" type="long" xmlns="http://www.soasta.com/services/repository">23456</Field>
      <Field name="Field7 float" type="float" xmlns="http://www.soasta.com/services/repository">234.567</Field>
      <Field name="Field8 double" type="double" xmlns="http://www.soasta.com/services/repository">765.432</Field>
      <Field name="Field9 bytes" type="base64Binary" xmlns="http://www.soasta.com/services/repository">QmFzZTY0IHRlc3QgdmFsdWU=</Field>
    </Mapped>
    <Properties xmlns="http://www.soasta.com/services/repository">
      <Property name="Prop1$string" type="string" value="Message 1, Prop1, string" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop2$boolean" type="boolean" value="true" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop3$byte" type="byte" value="12" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop4$short" type="short" value="123" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop5$int" type="int" value="1234" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop6$long" type="long" value="12345" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop7$float" type="float" value="123.456" xmlns="http://www.soasta.com/services/repository"/>
      <Property name="Prop8$double" type="double" value="654.321" xmlns="http://www.soasta.com/services/repository"/>
    </Properties>
    <Headers xmlns="http://www.soasta.com/services/repository">
      <CorrelationID value="Message 1A correlation ID" xmlns="http://www.soasta.com/services/repository"/>
      <Type value="Message 1A Type" xmlns="http://www.soasta.com/services/repository"/>
      <DeliveryMode value="1" xmlns="http://www.soasta.com/services/repository"/>
      <Expiration value="100000000" xmlns="http://www.soasta.com/services/repository"/>
      <Priority value="9" xmlns="http://www.soasta.com/services/repository"/>
    </Headers>
  </JMS>
</Content>

Example of the XML returned for indicator "MESSAGE_HTTP_BODY" for HTTP Targets:

<Content xmlns="http://www.soasta.com/services/repository">
<HTTPCommon xmlns="http://www.soasta.com/services/repository">
<Headers xmlns="http://www.soasta.com/services/repository">Host: confidence.soasta.com
Origin: http://confidence.soasta.com
Accept-Language: en-us
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png;q=0.5
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4
Accept-Encoding: gzip, deflate
Referer: http://confidence.soasta.com/concerto/Login
Content-Type: application/x-www-form-urlencoded
Proxy-Connection: keep-alive
Connection: keep-alive
Pragma: no-cache
</Headers>
</HTTPCommon>
<REST verb="POST" xmlns="http://www.soasta.com/services/repository">
<Location xmlns="http://www.soasta.com/services/repository">/concerto/Login</Location>
<Document xmlns="http://www.soasta.com/services/repository">goto=&userName=Fred&password=pw</Document>
</REST>
</Content>

If the data to be sent is binary, the data in the "Document" tag will be Base 64 encoded, and the attribute base64Encoded="true" will be present on that tag.

Example of the XML returned for indicator "MESSAGE_HTTP_BODY" for REST Targets:

<Content xmlns="http://www.soasta.com/services/repository">
  <REST xmlns="http://www.soasta.com/services/repository">
    <Params xmlns="http://www.soasta.com/services/repository">string=%7B%22ResultSet%22:%7B%22Result%22:%22lincoln%22%7D%7D</Params>
    <Location xmlns="http://www.soasta.com/services/repository">/DevTest/echoString</Location>
  </REST>
</Content>

For WSDL Targets, the message's SOAP XML is returned for indicator "MESSAGE_HTTP_BODY", as in the following example:

<soapenv:Envelope xmlns:ns="http://www.soasta.com/services" xmlns:ns1="http://webservice.maestrotestservice.testservices.soasta.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
  <ns:testOutput><!-- minOccurs=1  maxOccurs=1 -->
    <ns:inputValue1>aaa</ns:inputValue1><!-- minOccurs=1  maxOccurs=1 -->
    <ns:inputValue2>bbb</ns:inputValue2><!-- minOccurs=1  maxOccurs=1 -->
    <ns:inputValue3>ccc</ns:inputValue3><!-- minOccurs=1  maxOccurs=1 -->
    <ns:inputValue4>ddd</ns:inputValue4><!-- minOccurs=1  maxOccurs=1 -->
    <ns:inputValue5>eee</ns:inputValue5>
  </ns:testOutput>
</soapenv:Body>
</soapenv:Envelope>

Parameters:
{integer} messageFieldIndicator Optional

An indicator as to what is to be returned.

Returns:
{String}

The requested portion of the Message to be sent.


{String[]} getResourceLinksFromHTMLResponse()
If the response to this Message is HTML, the HTML is parsed and any links on the HTML page to external resources are extracted and returned as an array of URLs.

If there is no response, or the response is not HTML, null is returned.

Returns:
{String[]}

Array of URL strings.


{Object} getResponse(responseFieldIndicator, param)
Returns all or the specified portion of the response, if a response has been received. Can return null.

The meaning of the "param" parameter depends upon the value of the "indicator" parameter. The "indicator" parameter must be one of the following:

Parameters:
{integer} responseFieldIndicator Optional, Default: RESPONSE_TEXT

Indicator of what is to be returned.

{String | String[]} param Optional

Depends upon the value of responseFieldIndicator.

Returns:
{Object}

Depending upon the situation, either null, String or array of String.


setMessage(value, messageFieldIndicator)
Sets all or the specified portion of the message that is to be sent.

The "value" parameter is the value (as a text string) to be placed into the message. See the description of the getMessage method, for descriptions of the formats required for this value for each of the Target types and "indicator" values.

The indicator values that are permitted, and the type and format of the information required, depends upon the type of the Message's Target. The type of the Target is set at the time the Target is created, through the "Target Creation Wizard", Clip generation from a Recording, or through a manual creation process. The types of Targets are: WSDL, HTTP, WebUI/Ajax, JMS, and REST. (Note that types JMS and REST cannot currently be created through the Target Editor and can only be created through a manual creation process by SOASTA Support.) Targets of type WebUI/Ajax cannot be used with Messages (they are used with Browser Actions only) and thus are not applicable here.

The "indicator" parameter must be one of the following:

Parameters:
{object} value

The value that is to be placed into the Message.

{object} messageFieldIndicator Optional

An indication of what portion of the Message is to be set.


SOASTA CloudTest Script Documentation (build 8744.736). Copyright 2006-2011. All rights reserved.