cancel
Showing results for 
Search instead for 
Did you mean: 

Consume the multichain service with UI5 app

0 Kudos

I have tried several ways of calling the multichain service with no success. I am using a trial account and I have consistently got the same error. Has anybody had any luck making this work?

getListStreams: function () {
			debugger;


			var mListStreams = new sap.ui.model.odata.v2.ODataModel(
				"myURL");
			mListStreams.setHeaders({
				"apikey": "myKey",
				"Content-Type": "application/json"
			});


			var mParameters = {
				"method": "liststreams"
			}
			mListStreams.read("/", [mParameters])


			var oData = {
				"method": "liststreams"
			};
			mListStreams.create("", oData);
			mListStreams.post({
				uri: "myURL",
				json: true,
				headers: {
					apikey: "myKey"
				},
				body: {
					"method": "liststreams"
				}
			});


		},


		getListStreams2: function () {
			debugger;


			jQuery.ajax({
				type: "POST",
				url: "myURL", //"/blockchainasset/*******************************/rpc",
				beforeSend: function (request) {
					request.setRequestHeader("apikey", "myKey");
				},
				data: JSON.stringify({
					"method": "liststreams"
				}),
				dataType: "json",
				contentType: "application/json",
				success: function (data, textStatus, jQxhr) {
					debugger;
					console.log(data);
				},
				error: function (jqXhr, textStatus, errorThrown) {
					debugger;
					console.log(errorThrown);
				}
			});
		},


		getListStreams3: function () {
			debugger;
			$.ajax({
				headers: {
					"apikey": "myKey"
				},
				method: "GET",
				url: "myURL",
				dataType: "JSON"
			}).done(function (data) {
				debugger;
				console.log(data);
			});
		} 

Accepted Solutions (0)

Answers (0)