xmlTlSend

CAS XML Script Library

The xmlTlSend function sends an XML taglist to a NET SatisFAXtion server by way of a specified CAS/XML proxy component running on a web server.  The response from this function is an XMLDOM object containing the response XML from NET SatisFAXtion or from the local script in the case of a communications error.

After the xmlTlSend function is called, the xmlTl object representing the XML taglist is no longer valid, and must not be used again.  To send more taglists, the xmlTlNew function must be called to create a new XML taglist.

Please Note:  Before xmlTlSend can be used, a CAS/XML proxy must be installed on a web server, and the proxy must have access to the NET SatisFAXtion server that will process the taglist.  Starting with version 7.0, NET SatisFAXtion includes an integrated HTTP server that has a built-in CAS/XML proxy.  Alternatively, a CAS/XML proxy can be installed on Microsoft's IIS web server, by downloading the CAS XML Tools from this website.

xmlDoc Object xmlTlSend(
  Object xmlTl, // xmlTl object returned from xmlTlNew
  BSTR   DomainName, // NET SatisFAXtion domain name
  BSTR   ServerName, // NET SatisFAXtion server name
  LONG   Protocol, // Protocol for proxy to use 
  BSTR   ProxyURL // URL of proxy on web server
)


Parameters:
xmlTl An xmlTl object returned from the xmlTlNew function.  This object cannot be used again after xmlTlSend has been called. 

DomainName The NET SatisFAXtion domain for the server that will process the taglist.  The CAS/XML proxy uses this value for the DOMAIN_NAME when logging on to a NET SatisFAXtion domain.

ServerName The NET SatisFAXtion server that will process the taglist.  The CAS/XML proxy uses this value for the REMOTE_LOGON_NAME when opening a session with a  NET SatisFAXtion server.

Protocol The CAS protocol to use for connecting with the server that will process the taglist.  The CAS/XML proxy uses this value for the PROTOCOL when opening a session with a NET SatisFAXtion server.

ProxyURL The URL of the CAS/XML proxy located on a web server.  The proxy receives the XML taglist from your application via HTTP and sends a native CAS taglist to NET SatisFAXtion over a LAN or through direct-memory.  

Return Value:
An XMLDOM object containing the response XML.  Tags within the response can be accessed with the xmlTlGetTag function, or any other method provided by the XMLDOM.  The layout of the response XML is identical to XML taglists that are sent to the server, for example, the following is the response XML from GET_FILE_FUNCTION.

<CAS>
 <TAGLIST>
  <GET_FILE_RESULT/>
  <STATUS_NUM>0</STATUS_NUM>
  <STATUS>Operation Succeeded</STATUS>
  <CONTENT_DATA>VGV4dCB0byBhcHBlYXIgb24gdGhlIGNvdmVyIHBhZ2Uu</CONTENT_DATA>
 </TAGLIST>
 <STATUS_NUM>0</STATUS_NUM>
 <STATUS_EXTENDED_NUM>0</STATUS_EXTENDED_NUM>
 <STATUS/>
</CAS>


Example:
function SendCoverText( CoverText, SubjectText )
  {
  var Tl = xmlTlNew();
  xmlTlAddTag(Tl,"SEND_MESSAGE",null);
  xmlTlAddTag(Tl,"REGISTERED_NAME","Webclient");
  xmlTlAddTag(Tl,"REGISTERED_PASSWORD","");
  xmlTlAddTag(Tl,"TRANSFER_TYPE",0);   // 1= EMAIL, 0=FAX

  xmlTlCreateSection(Tl,"RECEIVER_ADDRESS","555-123-4567");
    xmlTlAddTag(Tl,"RECEIVER_NAME","MyRecipient");
  xmlTlCloseSection(Tl);
    
  xmlTlCreateSection(Tl,"CONTENT_PART",2);  // Cover Message
    xmlTlAddTag(Tl,"CONTENT_TYPE",1);       // File Type ASCII
    xmlTlAddTag(Tl,"CONTENT_DATA",Base64Encode(CoverText));
  xmlTlCloseSection(Tl);

  xmlTlCreateSection(Tl,"CUSTOM_SECTION",null);
    xmlTlAddTag(Tl,"EMAIL_SENT",0);
    xmlTlAddTag(Tl,"SUBJECT",SubjectText);
  xmlTlCloseSection(Tl);
      
  var responseXML =
        xmlTlSend(Tl,
                  "\\\\CASDEV\\NETSATISFAXTION",
                  "NETSATISFAXTION",
                  2,
                  "http://casdev.faxback.com/cgi-bin/casxml.asp");
    
  return (xmlTlGetTag(responseXML,"STATUS_NUM"));
  }

See Also:
xmlTlNew, xmlTlAddTag, Base64Encode, xmlTlGetTag