C-DEngine 5.105

TheCommRequestResponse..::..PublishRequestAsync Method (TheMessageAddress, TheMessageAddress, String, TimeSpan, array<String>[]()[][], String, array<Byte>[]()[][])

Sends a TSM message to the targetThing and return the matching response message

Namespace:  nsCDEngine.Communication
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static Task<TSM> PublishRequestAsync(
	TheMessageAddress originator,
	TheMessageAddress target,
	string messageName,
	TimeSpan timeout,
	string[] txtParameters,
	string PLS,
	byte[] PLB
)
Public Shared Function PublishRequestAsync ( _
	originator As TheMessageAddress, _
	target As TheMessageAddress, _
	messageName As String, _
	timeout As TimeSpan, _
	txtParameters As String(), _
	PLS As String, _
	PLB As Byte() _
) As Task(Of TSM)
public:
static Task<TSM^>^ PublishRequestAsync(
	TheMessageAddress^ originator, 
	TheMessageAddress^ target, 
	String^ messageName, 
	TimeSpan^ timeout, 
	array<String^>^ txtParameters, 
	String^ PLS, 
	array<unsigned char^>^ PLB
)

Parameters

originator
Type: nsCDEngine.Communication..::..TheMessageAddress
Thing or engine to use for response messages. If NULL defaults to ContentService.
target
Type: nsCDEngine.Communication..::..TheMessageAddress
Thing or engine to which the message is to be sent.
messageName
Type: String
Name of the message, as defined by the target thing. The response message will be messageName_RESPONSE.
timeout
Type: TimeSpan
Time to wait for the response message. Can not exceed TheBaseAsset.MaxMessageResponseTimeout (default: 1 hour).
txtParameters
Type: array<String>[]()[][]
Array of simple string parameters, to be attached to the message's TXT field, as defined by the target thing. txtParameters must not contain ":" characters.
PLS
Type: String
String payload to be set as the message's PLS field, as defined by the target thing.
PLB
Type: array<Byte>[]()[][]
Binary pauload to be set as the message's PLB field, as defined by the target thing.

Return Value

The response message as defined by the target thing. The response parameters and correlation token can be parsed using ParseRequestOrResponseMessage, if the target thing used the PublishResponseMessage or an equivalent message format. If the message times out or an error occured while sending the message, the return value will be null.