C-DEngine 5.105

TheCommRequestResponse..::..PublishRequestAndParseResponseAsync Method (TheThing, TheThing, String, array<String>[]()[][], String, array<Byte>[]()[][])

Sends a TSM message to the targetThing and return the matching response message. Uses a timeout of 60 seconds.

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

Syntax


public static Task<ParsedMessage> PublishRequestAndParseResponseAsync(
	TheThing senderThing,
	TheThing targetThing,
	string messageName,
	string[] txtParameters,
	string PLS,
	byte[] PLB
)
Public Shared Function PublishRequestAndParseResponseAsync ( _
	senderThing As TheThing, _
	targetThing As TheThing, _
	messageName As String, _
	txtParameters As String(), _
	PLS As String, _
	PLB As Byte() _
) As Task(Of ParsedMessage)
public:
static Task<ParsedMessage^>^ PublishRequestAndParseResponseAsync(
	TheThing^ senderThing, 
	TheThing^ targetThing, 
	String^ messageName, 
	array<String^>^ txtParameters, 
	String^ PLS, 
	array<unsigned char^>^ PLB
)

Parameters

senderThing
Type: nsCDEngine.Engines.ThingService..::..TheThing
Thing from which the message is sent.
targetThing
Type: nsCDEngine.Engines.ThingService..::..TheThing
Thing to which the message is to be sent.
messageName
Type: String
Name of the message, as defined by the target thing
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 parsed response message as defined by the target thing. The target thing must use 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.