SOAP And SOAP With Attachments Support
 
The SOAP and SOAP With Attachments (SWA) features are provided to support advanced
developers who need to rapidly construct, visualize, query, generate, and process SOAP and SOAP With Attachments documents.
 
SOAP Support Features
 
Since a SOAP document is merely an XML document, all of the standard product capabilities are available including editing, visualization, analytics, transcoding, and source code generation. In addition to these SOAP features, you can also create a SOAP with Attachments (SWA) document.
 
 
SOAP With Attachments Features
 
Understanding the Context SOAP With Attachments (SWA) Document
 
Before we discuss SWA features, it is important to note that all of the tools provide access to a single SWA document. Similar to the “Singleton” programming pattern, this default or context SWA document enables uniform access from both the programming APIs and visual tools. This document is always viewable from the SWA editor.
 
Launching the SOAP With Attachments Editor
 
To launch the SWA editor, select the “SOAP With Attachments Editor (SWA)” menu located in the “SOAP” menu as seen here:
 
 
 
SOAP With Attachments Editor Features
 
To support the SOAP With Attachments (SWA) standard, we provide several technologies to create, parse, visualize, generate, and query SWA MIME documents through a programming API and an editor. The SOAP With Attachments Editor supports the following major functions:
 
  1. 1.SWA MIME visualization in the HyperDOM.  After loading your SWA MIME document, select the “Visualize MIME in HyperDOM” button as seen below:
 
 
The section “Creating a SOAP With Attachments (SWA) Document” discusses how to create or load SWA documents.
 
  1. 2.SWA MIME text generation. After loading your SWA MIME document, select the “Generate MIME Text” button as seen below:
 
 
 
  1. 3.Visualizing the SOAP envelope or any XML attachment in a DOM Browser. After choosing an item in the editor, select the “Browse” menu from the item’s popup menu as seen here:
 
 
 
  1. 4.Deleting the SOAP envelope or any XML attachment. After choosing an item in the SWA editor, select the “Delete…” menu from the item’s popup menu as seen here:
 
 
 
 
Creating a SOAP With Attachments (SWA) MIME Document
    
Whether you are working with a previously created SWA MIME file or want to create a new SWA MIME document, complete support is available using the following techniques:
 
  1. 1.The ability to drag and drop a SWA MIME file from the file system onto the SWA Editor. The editor will parse and display a list of attachments that are XML documents. Attachments are identified by both their physical position in the MIME document as well as any optional MIME header fields such as the Content-Location. This is seen in this screen shot:
 
 
 
  1. 2.The ability to add a SOAP document from the DOM Browser via the “Set As Default SOAP Object” menu from the document node’s popup menu as seen here:
 
 
This option can be used in the creation of a new SOAP document or to replace the current SOAP document.
 
  1. 3.The ability to add an XML document as an attachment from the DOM Browser via the “Add as SOAP Attachment” menu from the document node’s popup menu as seen here:
 
 
  1. 4.The ability to add a SOAP document from the XML Text Editor via the “Set As Default SOAP Envelope” popup menu as seen here:
 
        
 
This option can be used in the creation of a new SWA document or to replace the current SOAP document in the SWA document.
 
 
Visualizing a SWA MIME Document
    
There are several ways to load an SWA MIME document into the HyperDOM:  
  1. 1.Select the “Visualize MIME in HyperDOM” button on the SOAP With Attachments Editor (SWA) as seen here:
 
        
 
  1. 2.Drag and drop the SWA MIME text onto the HyperDOM.
  2. 3.Invoke the XML-RPC API from an external program.
  3. 4.Invoke the Java API from your Java language program.
 
The HyperDOM will create an XML representation that will include MIME headers and other important properties of the MIME document. The root of this document is the <alt:mime-container> element and each attachment is wrapped in an <alt:document> element. This can be seen in the below screen shots:
 
 
 
 
 
 
 
 
SOAP With Attachments (SWA) Remote API
    
The HyperDOM provides an XML-RPC API that may be used by external applications and scripts to visualize SWA MIME content. The internal SWA component provides an XML-RPC API that may be used to search SWA MIME content. The XML-RPC server is automatically started at launch and runs on port 31000.
 
The webSdk.xml configuration file defines the <sdk-xmlrpc> element which has an auto-start and default port number for the XML-RC server.
 
You can also manually start and stop the XML-RPC server through the XML-RPC menu item found on the menu bar as seen here:
 
 
 
The following method signature list relates to the SWA XML-RPC support:
  1. 1.String findAttachmentDocumentWithMimeHeaderValue (
String absolutePathString,
String headerString,
String valueString)
  1. 2.String hyperVisualizeSOAPWithAttachmentsFile (String absolutePathString)
 
Visit http://altmobile.com/pdf/Remote%20API.pdf for a complete list of our remote APIs.
 
Client programs using the XML-RPC APIs can be found in the ALTMobile/macos/rpc directory and are implemented using Applescript. A simple .NET client demo is also available in the ALTMobile/dotNet directory.
 
 
SOAP With Attachments (SWA) Java API
    
Augmenting the standard SAAJ API, we provide a Java language API to accomplish the following:
  1. 1.Parse a SWA MIME document and load it as the default SWA document. The class UIUtilities with the namespace com.altmobile.platform.ui implements the following parsing-related method signatures:
  2. 1.public static void populateDefaultSAAJObject(File mimeFile) throws IOException
  3. 2.public static void populateDefaultSAAJObject(String mimeContentString)
    
  1. 2.Visualize an SWA document in the HyperDOM after parsing and setting it as the default SWA document. The class UIUtilities with the namespace com.altmobile.platform.ui implements the following visualization-related method signatures:
    1. 1.public static void hyperVisualizeDefualtSAAJObject()
    2. 2.public static void hyperVisualizeDefualtSAAJObjectInActiveHyperDOMBrowser()
 
  1. 3.Search for an attachment based on the value of a MIME header. The class SOAPUtil with the namespace com.altmobile.platform.util.browser.xml provides the following query-related method signatures:
    1. 1.public static String findSerializedAttachmentDocumentWithMimeHeaderValue (
String absolutePathString,
String headerString,
String valueString)
    1. 2.public static Document findAttachmentDocumentWithMimeHeaderValue (
String absolutePathString,
String headerString,
String valueString)
 
  1. 4.Set MIME headers. The class DocumentWithLocation with the namespace of com.altmobile.platform.agent.mime supports programmatic setting of MIME headers. To see an example of this class in use, view the SWA generation sample below.
 
  1. 5.Create and generate a SWA MIME document. The class SAAJAgent with the namespace of com.altmobile.platform.agent.messaging enables programmatic generation of an SWA document. The following code snippet demonstrates how to use the DocumentWithLocation and SAAJAgent classes:
 
import com.altmobile.platform.agent.*;
import com.altmobile.platform.agent.mime.DocumentWithContentLocation;
import com.altmobile.platform.agent.messaging.SAAJAgent;
 
SAAJAgent aSAAJAgent= new SAAJAgent();
AgentMessage aAgentMessage = aSAAJAgent.getAgentMessage();
 
DocumentWithContentLocation soapDocumentWithContentLocation =
new DocumentWithContentLocation (yourSOAPDocument);
 
soapDocumentWithContentLocation.setLocationString("Envelope94x");
// or use the generic API addHeader(String, String)
 
aAgentMessage.write("soapDocument", soapDocumentWithContentLocation);
 
int index = 1; //used in the content-location header and in the attachment index
 
DocumentWithContentLocation aDocumentWithContentLocation =
new DocumentWithContentLocation (yourTaxReturnDocument);
 
aDocumentWithContentLocation.setLocationString("Envelope94x" + index);
 
aAgentMessage.write(new Integer(index).toString(),aDocumentWithContentLocation);
 
t_aSAAJAgent.processMessage(aAgentMessage);