HTTPClientChannel

Overview

Custom client channel over HTTP protocol. Uses XmlHttpRequest object to post asynchronous requests.

Location

RemObjectsSDK.js

 

constructor ClientChannel    (declared in ClientChannel)

You don't need to create an instance of abstract class.

function constructor ClientChannel(aUrl)

Parameters:

  • aUrl: string

constructor HTTPClientChannel

Creates an instance.

function constructor HTTPClientChannel(aUrl)

Parameters:

  • aUrl: string

dispatch

Sends message to the service and passes result to onSuccessFunction callback or server's error message to onErrorFunction callback. Called by service proxy class methods (usually generated by codegen).

onErrorFunction takes message and an exception object (usually local but it could be ROException) too. There is RemObjects.UTIL.showError function that can be passed as error callback and displays error message.

function dispatch(aMessage, onSuccessFunction, onErrorFunction)

Parameters:

  • aMessage: Message
  • onSuccessFunction: function (aMessage)
  • onErrorFunction: function (aMessage, anException)

onLoginNeeded

Called when the channel receives EROSessionNotFound server exception. Initially holds a stub and should be replaced with a user function that performs actual login procedure and calls the callback function.

function onLoginNeeded(aCallback)

Parameters:

  • aCallback: function ()

post

Passes request data to the server via HTTP POST using browser's XmlHttpRequest** object. Used internally by dispatch method.

function post(aMessage, isBinary, onSuccess, onError)

Parameters:

  • aMessage: Message
  • isBinary: boolean
  • onSuccess: function(httpResponse, httpStatus)
  • onError: function(httpResponse, httpStatus)

url

Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/

url

 

url

Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/

url

 

constructor ClientChannel    (declared in ClientChannel)

You don't need to create an instance of abstract class.

function constructor ClientChannel(aUrl)

Parameters:

  • aUrl: string

constructor HTTPClientChannel

Creates an instance.

function constructor HTTPClientChannel(aUrl)

Parameters:

  • aUrl: string

dispatch

Sends message to the service and passes result to onSuccessFunction callback or server's error message to onErrorFunction callback. Called by service proxy class methods (usually generated by codegen).

onErrorFunction takes message and an exception object (usually local but it could be ROException) too. There is RemObjects.UTIL.showError function that can be passed as error callback and displays error message.

function dispatch(aMessage, onSuccessFunction, onErrorFunction)

Parameters:

  • aMessage: Message
  • onSuccessFunction: function (aMessage)
  • onErrorFunction: function (aMessage, anException)

onLoginNeeded

Called when the channel receives EROSessionNotFound server exception. Initially holds a stub and should be replaced with a user function that performs actual login procedure and calls the callback function.

function onLoginNeeded(aCallback)

Parameters:

  • aCallback: function ()

post

Passes request data to the server via HTTP POST using browser's XmlHttpRequest** object. Used internally by dispatch method.

function post(aMessage, isBinary, onSuccess, onError)

Parameters:

  • aMessage: Message
  • isBinary: boolean
  • onSuccess: function(httpResponse, httpStatus)
  • onError: function(httpResponse, httpStatus)