HTTPClientChannel
Overview
Custom client channel over HTTP protocol. Uses XmlHttpRequest object to post asynchronous requests.
Location
RemObjectsSDK.js
- Ancestry: ClientChannel | HTTPClientChannel
constructor ClientChannel (declared in ClientChannel)
constructor
function constructor ClientChannel(aUrl, params)
Parameters:
- aUrl: Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/
- params: A set of key/value pairs that configure the channel. All params are optional.
constructor HTTPClientChannel
Creates an instance.
function constructor HTTPClientChannel(aUrl, params)
Parameters:
- aUrl: Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/
- params: A set of key/value pairs that configure the channel. All params are optional.
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 ()
params
A set of key/value pairs that configure the channel. All params are optional.
params
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
params
A set of key/value pairs that configure the channel. All params are optional.
params
url
Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/
url
constructor ClientChannel (declared in ClientChannel)
constructor
function constructor ClientChannel(aUrl, params)
Parameters:
- aUrl: Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/
- params: A set of key/value pairs that configure the channel. All params are optional.
constructor HTTPClientChannel
Creates an instance.
function constructor HTTPClientChannel(aUrl, params)
Parameters:
- aUrl: Holds full service URL containing protocol, location and port. Example: http://localhost:8099/bin/
- params: A set of key/value pairs that configure the channel. All params are optional.
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)