ConnectorRequest method: IntBroker class

Syntax

ConnectorRequest(&Message[, process_exceptions])

Description

Use the ConnectorRequest method to return a response message from the connector based on the message passed in.

You would only use this method after you had set the connector information.

Parameters

Parameter Description

&Message

Specify an already instantiated message object to return a response message from the connector.

process_exceptions

Specifies a Boolean value indicating whether the PeopleCode program will process exceptions.

Important: When this parameter is set to True, your program must read the response status property of the response message to determine if the call was successful. If there is an exception, then interrogate the IBException object within the Message object to get the details of the exception.

Returns

A Message object.

Example

   Local string &nonXmlData = "<?xml version=""1.0""?><data psnonxml=""yes""><!⇒
[CDATA[" | &encoded | "]]></data>";
   &soapMsg = CreateXmlDoc(&nonXmlData);
   &reqMsg.SetXmlDoc(&soapMsg);
   Local Message &respMsg;
   %This.SetConnectorProperties(&reqMsg, &url);
   &respMsg = %IntBroker.ConnectorRequest(&reqMsg);
   If &respMsg = Null Then /* Throw exception */
   %This.HandleNullSoapResponse(&soapMsg, &url);
   End-If;

This second example demonstrates how to evaluate the response message status when process_exceptions is True:

Local Message &MSG, &resp_MSG;

&resp_MSG = %IntBroker.ConnectorRequest(&MSG, True);

If &resp_MSG.ResponseStatus = %IB_Status_Success Then
   /* Perform processing of a successful response message */
Else
   /* Read the IBException object for exception specifics */
   &error = &resp_MSG.IBException.ToString();
End-If;