Parsing responses for instance IDs in SilkPerformer scripts


The response to most BackChannel ServerRunProcess requests includes an instance ID. This is a typical response:

this.result="SR00142215278Bp3AeRgq2xXBQ04K";

Because the response is simple, you can parse it directly by using the WebParseDataBoundEx function and then saving the response to a variable. Use WebParseDataBoundEx immediately before the WebRemedyBackChannelUrl function. For example:

WebParseDataBoundEx(gsSRInstanceID01, STRING_COMPLETE, "this.result=\"", 1, "\"", WEB FLAG IGNORE WHITE SPACE, 1);
WebRemedyBackChannelUrl("http://standardhost/arsys/BackChannel/", "BackChannel - ServerRunProcess (#1)", ARSYS_BACKCHANNEL 033);

The WebParseDataBoundEx function can parse and save only to one variable. To parse many items in a response, save the entire HTTP response to a variable and write your own parsing function. For more information, see Parsing-AR-System-table-entries-in-SilkPerformer-scripts.

To save the HTTP response to a variable, use WebParseDataBound immediately before the WebRemedyBackChannelUrl function. For example:

WebParseDataBound(buffer,sizeof(buffer), Null, Null);
WebRemedyBackChannelUrl("http://standardhost/arsys/BackChannel/",  "BackChannel - GetTableEntryList (#1)", ARSYS BACKCHANNEL 027);
parseRequestList(buffer);

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*