- Understanding SOAP FAQs
- How do I invoke a method on a server when I'm using SOAP?
- Do M-POST calls have to occur before POST calls?
- When I'm using XML in SOAP, do I have to use namespaces?
- What happens when a method call has been requested?
- What are the values in a SOAP payload?
- What could cause the performance of a SOAP call to degrade or suffer?
- What kind of security does SOAP implement?
- When using SOAP, how do I implement a simple API for XML?
- How will SOAP impact .Net application development?
- How is ASP+ used when creating web services?
- How do I validate SOAP-based XML using a schema?
- When using SOAP, what is the most efficient way to access services from a client over the Internet?
When using SOAP, how do I implement a simple API for XML?
The Simple API for XML (SAX) is a low-level, event-driven or event-based system which operates in a fashion similar to a Graphical User Interface (GUI). For instance, when a start tag is encountered during parsing, an event can be triggered which executes your event handler or callback function to handle the event. One benefit of this method is that it requires much less memory and resources than the DOM does because SAX doesn't store the document in memory. This can be extremely useful when dealing with very large XML documents. Another advantage to using the SAX callback functionality is that you can implement your own data structures for internally storing the document. Therefore, you don't have to make a copy of the parser's tree structure into one of your own structure, as you would have done with the DOM.
In the following sample code fragments, you will see some of the available event handlers, using the Apache.org parser. The following is a slightly modified version of the examples provided with the Apache.org parser. Here, the SAXHandlers class in the class header file encapsulates the event handlers for both document and error events.
See code:Using this class, the handler object is registered for both document events and error events: (see below)