Zimlet JavaScript API Reference - AjxSoapDoc

Class AjxSoapDoc


Note: do not directly instantiate AjxSoapDoc. Use one of the create methods instead

Defined in: AjxSoapDoc.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Default constructor.
Method Summary
Method Attributes Method Name and Description
<static>  
AjxSoapDoc.create(method, namespace, namespaceId, soapURI)
Creates a SOAP document.
<static>  
AjxSoapDoc.createFromDom(doc)
Creates from a DOM object.
<static>  
AjxSoapDoc.createFromXml(xml)
Creates from an XML object.
 
Creates a header element.
 
Gets the body.
 
Gets the document.
 
Gets the header.
 
Gets the method.
 
Gets the XML.
 
set(name, value, parent, namespace)
Creates arguments to pass within the envelope.
Class Detail
AjxSoapDoc()
Default constructor.
See:
AjxSoapDoc.create
Method Detail
<static> {AjxSoapDoc} AjxSoapDoc.create(method, namespace, namespaceId, soapURI)
Creates a SOAP document.
Parameters:
{string} method
the soap method
{string} namespace
the method namespace
{string} namespaceId Optional
the namespace id
{string} soapURI Optional
the SOAP uri
Returns:
{AjxSoapDoc} the document

<static> {AjxSoapDoc} AjxSoapDoc.createFromDom(doc)
Creates from a DOM object.
Parameters:
{Object} doc
the DOM object
Returns:
{AjxSoapDoc} the document

<static> {AjxSoapDoc} AjxSoapDoc.createFromXml(xml)
Creates from an XML object.
Parameters:
{Object} xml
the XML object
Returns:
{AjxSoapDoc} the document

{Element} createHeaderElement()
Creates a header element.
Returns:
{Element} the header element

{Element} getBody()
Gets the body.
Returns:
{Element} the body element

{Document} getDoc()
Gets the document.
Returns:
{Document} the document

{Element} getHeader()
Gets the header.
Returns:
{Element} the header or null if not created

{string} getMethod()
Gets the method.
Returns:
{string} the method

{string} getXml()
Gets the XML.
Returns:
{string} the XML

{Element} set(name, value, parent, namespace)
Creates arguments to pass within the envelope. "value" can be a JS object or a scalar (string, number, etc.).

When "value" is a JS object, set() will call itself recursively in order to create a complex data structure. Don't pass a "way-too-complicated" object ("value" should only contain references to simple JS objects, or better put, hashes--don't include a reference to the "window" object as it will kill your browser).

Example:

   soapDoc.set("user_auth", {
      user_name : "foo",
      password  : "bar"
   });
will create an XML like this under the method tag:
   <user_auth>
     <user_name>foo</user_name>
     <password>bar</password>
   </user_auth>
Of course, nesting other hashes is allowed and will work as expected.

NOTE: you can pass null for "name", in which case "value" is expected to be an object whose properties will be created directly under the method el.

Parameters:
{string} name
the name
{hash} value
the attribute name/value pairs
{string} parent Optional
the parent element to append to
{string} namespace Optional
the namespace
Returns:
{Element} the node element

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)