Schlagwort-Archive: microservices

IBM Doors DXL: Call REST Services / REST-Services aufrufen


Von Doors aus sollen REST Services aufgerufen werden.

REST Services shall be called within a DXL Script in IBM Doors

Approach – Ansatz

Usage of OLE Automization

Solution – Lösung

pragma runLim,0
OleAutoArgs args = create
OleAutoArgs args2 = create
OleAutoObj http = oleCreateAutoObject("WinHttp.WinHttpRequest.5.1")
void sendResult(string commandId, string result) {
	put(args, "POST")
	put(args, "" commandId "/result")
	OleAutoArgs args2 = create
	put(args2, result)
	oleMethod(http, "open", args)
	string res = oleMethod(http, "send", args2)
				print "\n" stringOf(dateAndTime(today)) ": Sending data data Failed"
				print "\n" res
Regexp lines = regexp ".*"
bool connected = true
while(connected) {
	put(args, "GET")
	put(args, "")
	oleMethod(http, "open", args)
	oleMethod(http, "send")
	int status
	oleGet(http, "status", status)
	connected = status == 200
	string response
	oleGet(http, "responseText", response)
	print "RESPONSE:" response "\n"
	lines response
	string commandId = response[0:end 0]
	string resultUrl = "" commandId "/result"
	string command = "pragma runLim,0\nstring resultUrl = \"" resultUrl "\"\n" response[end 0+2:]
	sendResult(commandId, eval_(command))