Tivoli Directory Integrator, Version 7.1.1

SOAP Parser

The SOAP Parser reads and writes SOAP XML documents. The Parser converts SOAP XML documents to or from entry objects in a simple, straightforward fashion. When writing the XML document, the Parser uses attributes from the entry to build the document. The SOAP_CALL attribute is expected to contain the value for the SOAP call. Similarly, when reading, this attribute is set to reflect the first tag following the SOAP-ENV:Body tag. Then, for each attribute in the entry, a tag with that name and value is created. When reading the document, each tag under the SOAP_CALL tag translates to an attribute in the entry object.

Note:
When working with the WebServices Connector, you must avoid starting attribute names with special characters (such as [0-9] [ - ' ( ) + , . / = ? ; ! * # @ $ % ]). Also, you must avoid having attribute names that include special characters (such as [ ' ( ) + , / = ?; ! * # @ $ % ] ). This is because WebServices builds on SOAP, which is XML. XML does not accept $ as in tags.

The following examples show an entry and a SOAP XML document as they are read or written.

Example Entry

*** Begin Entry Dump
	SOAP_CALL:	'updateLDAP'
	mail:	('john@doe.com)'
	uid:	'johnd'
*** End Entry Dump

Example SOAP document

<SOAP-ENV:Envelope 
	xmlns:SOAP-ENV="(http://schemas.xmlsoap.org/soap/envelope/)"
	xmlns:xsi="(http://www.w3.org/1999/XMLSchema-instance)" 
	xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:updateLDAP xmlns:ns1="" SOAP-ENV:encodingStyle=
			"http://schemas.xmlsoap.org/soap/encoding/">
<uid xsi:type="xsd:string">johnd</uid>
<mail xsi:type="xsd:string">john@doe.com</mail>
</ns1:updateLDAP>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Configuration

The Parser has the following parameters:

Omit XML Declaration
Omit the XML declaration header in the output stream.
Document Validation
Request a DTD/XSchema-validating XML parser.
Namespace Aware
Request a namespace-aware XML parser.
Character Encoding
Character Encoding to be used; the default is UTF-8. Also see Character Encoding conversion.
Detailed Log
If this parameter is checked, more detailed log messages are generated.

Parser-specific calls

You can access the SOAP Parser from your script by dynamically loading the Parser and calling the methods to read or write SOAP documents. The following example shows how to generate the XML document from an entry:

var e = system.newEntry();
e.setAttribute ("soap_call", "updateLDAP");
e.setAttribute ("uid", "johnd");
e.setAttribute ("mail", "(john@doe.com)");

// Retrieve the XML document as a string
var soap = system.getParser ("ibmdi.SOAP");
soap.initParser();
var soapxml = soap.getXML ( e );

task.logmsg ( "SOAP XML Document" );
task.logmsg ( soapxml );

// Write to a file
var soap = system.getParser("ibmdi.SOAP");
soap.setOutputStream ( new java.io.FileOutputStream("mysoap.xml") );
soap.writeEntry ( e );
soap.close();

// Read from file
soap.setInputStream ( new java.io.FileInputStream ("mysoap.xml") );
var entry = soap.readEntry();

// Read from string (from soapxml generated above)
var entry = soap.parseRequest( soapxml );
task.dumpEntry ( entry );

Examples

Go to the TDI_install_dir/examples/soap directory of your IBM® Tivoli® Directory Integrator installation.

[ Top of Page | Previous Page | Next Page | Contents | Terms of use | Feedback ]
(C) Copyright IBM Corporation, 2003, 2012. All Rights Reserved.
IBM Tivoli Directory Integrator 7.1.1