io/ RemoteObject.js

This library is used to unmarshal a soap xml document into javascript objects at present it has only been used with coldfusion mx web serivces - though it should work with all type of services

Copyright

2004 Rob Rohan (robr.nosp@m.ohan@gmai.nosp@m.l.com) All rights reserved

Related

util/Collections.js xml/XmlDocument.js io/Gateway.js

Summary
This library is used to unmarshal a soap xml document into javascript objects at present it has only been used with coldfusion mx web serivces - though it should work with all type of services
the library version
the default handler uses this as a scratch pad var (not thread safe!)
This provides a wrapper for RemoteObjectFactory that accepts a listener/event handler to be registered that will be called when the object is ready.
mostly used internally.
Factory to create a remoting object in a non-browser specific way (mostly)
set the async mode (defaults to false)
after an object is unmarshaled this function can be used to get the object
This is a monster method.
The default handler.
try to break apart the soap message and get it to the proper place.

Variables

REMOTE_OBJECT_VERSION

var REMOTE_OBJECT_VERSION

the library version

__dfh__variable

var __dfh__variable

the default handler uses this as a scratch pad var (not thread safe!)

Functions

__gateway__map_from_struct

function __gateway__map_from_struct(frag,
xmldoc,
nstruct)
not an APIinternal only function - used to make a coldfusion struct (java Map) into a js map (recursive function)

Parameters

lookupid xmldoc nstruct

RemoteObjectLoader

function RemoteObjectLoader(url,
handler,
async)

This provides a wrapper for RemoteObjectFactory that accepts a listener/event handler to be registered that will be called when the object is ready.  Much nicer than the setTimeout method.

Note

This may move to another file in the future

Parameters

urlthe web service to load the object from
handlerthe callback function to run when the object is loaded
asyc(optional) set to true to use async mode sync mode by default

RemoteFunction

mostly used internally. an object to hold remote function information

RemoteObjectFactory

Factory to create a remoting object in a non-browser specific way (mostly)

Summary
set the async mode (defaults to false)
after an object is unmarshaled this function can be used to get the object
This is a monster method.

Functions

RemoteObjectFactory. setAsync

set the async mode (defaults to false)

Parameters

toboolean of true (async) or false (snyc)

RemoteObjectFactory. getObject

after an object is unmarshaled this function can be used to get the object

Returns

the Webservice as a JS object

RemoteObjectFactory. createObject

This is a monster method.  Basically this is what loads the web service into a JS Object.  This returns nothing - what you’ll need to do is poll getObject to get the object once its done cooking

Parameters

connectionan HTTPConnection object to use to query the server
urlthe url to the web service

DefaultHandler

The default handler.  Used to set variables to what the web service returns.  You can write your own, but you have to handle the soap parsing... unless you want the raw soap response

Parameters

vthe variable name that the parse result should be written to NOTE this is a string its the variables name not the variable itself
Summary
try to break apart the soap message and get it to the proper place.

Functions

DefaultHandler. handle

try to break apart the soap message and get it to the proper place.  Note: this is a break off fuction so the “this” is useless :-/

Parameters

strthe SOAP XML
var REMOTE_OBJECT_VERSION
the library version
var __dfh__variable
the default handler uses this as a scratch pad var (not thread safe!)
function __gateway__map_from_struct(frag,
xmldoc,
nstruct)
function RemoteObjectLoader(url,
handler,
async)
This provides a wrapper for RemoteObjectFactory that accepts a listener/event handler to be registered that will be called when the object is ready.