RemObjects with React application

How can I connect a React application with RemObjects SDK?

I already have the SDK and the intf.js file in my project, and I use it this way:

var channel = new RemObjects.SDK.HTTPClientChannel("");
var message = new RemObjects.SDK.JSONMessage();

but it returns the following error:

TypeError: Cannot read property ‘HTTPClientChannel’ of undefined.

I hope you can help me.


This error means that the RemObjects.js file was not imported properly for some reason.

Also, according to your code you are going to connect to the binary endpoint of your server ( .../bin ). So you need to use the binary message instead of JSON one.


1 Like

I am importing the SDK like this:

import RemObjects from './RemObjectsSDK';

Could you help me import it properly?


Here is the testcase / sample:
RO (205.2 KB)

RO SDK and _Intf files are referenced via index.html and later are used in App.js as

import logo from './logo.svg';
import './App.css';

function SuccessSumMethod(result) {
  console.log('Result is ' + result);

function App() {
  const channel = new RemObjects.SDK.HTTPClientChannel(""); // eslint-disable-line
  const message = new RemObjects.SDK.BinMessage(); // eslint-disable-line
  var service = new MegaDemoService(channel, message);  // eslint-disable-line
  service.Sum(1, 2, SuccessSumMethod);

  return (

    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
          Edit <code>src/App.js</code> and save to reload.
          rel="noopener noreferrer"
          Learn React

export default App; 

Note the // eslint-disable-line line that prevents JS processing errors