Patrick Townsend & Associate's Newsletter

XML on Native AS/400| Volume 2| May 2004


Table of Contents:

                             Alliance XML/400- Easy as <pie> 

                             10% Off Special Offer

                             XML/400 Technical Tip

                             Support News

 


 

Alliance XML/400 makes XML processing easy on your AS/400

 

Back To Top                            As easy as <ApplePie>.

 

Everyone seems to have an XML project waiting in the wings. If you are feeling some dread about starting the project, you can relax! Alliance XML/400 makes integrating web XML documents with your AS/400 easy to do. It won’t take any complicated programming and you won’t need to install the IBM DB2 XML extender application. Alliance can convert any XML document to one or more externally described DB2 database files, or create an XML document from your database files.  Alliance can do everything for you and it all happens right on the AS/400 – no external PC servers are required.

 

The first thing you need for XML is a good map. If you are receiving the XML document, you will create an Inbound XML Map using the interactive mapper. The mapper lets you select an XML tag, and associate it with a field in the database. If you have repeating groups of data, you can tell Alliance to write each repeating group to a specific database file. You can have many different database files in your map - you just add them as you need them. To help with processing the data, Alliance can assign a unique key for each XML document. That makes it easy to process, once the translation is complete.

 

If you need to create an XML document to send to your trading partner, you can create an Outbound XML Map using the interactive mapper. You add your DB2 database files to the map and tell the map what XML tags you want to use. You can have repeating groups and multiple files as the source of the XML data. The Alliance mapper implements control level breaks  (just like RPG!) to help you format the XML tags just the way you want them. Alliance handles all of the data conversions of packed numeric fields. There is no complicated API processing needed to convert the data.

 

Once you have a map you are ready to translate. Alliance provides a command interface for translation, or you can use one of the automation interfaces. Usually you will want to use the command interface during testing, then hook up the translation into one of the automated interfaces. The Alliance Translate from AS/400 (ALLTRN400) command will translate DB2 database data to XML format. The Alliance Translate from XML (ALLTRNXML) command will translate an XML document to your database files. Both commands can be used interactively or in CL programs. The translation command takes the map name, DB2 file name, and XML document as input, and performs the data translation following the rules in the map. Like magic you get the data converted to the format you want!

 

After you have translation working you can use the Alliance communications interface to send or receive the XML documents. If you are receiving XML documents you can use the Alliance HTTP or HTTPS (secure) server to receive them. You don’t need to configure the IBM Apache server or worry about security issues with that server. The Alliance server receives an XML document, translates it with your map, and calls your application program to process the data. You can even return an XML response in the same session. For outbound communications you can use the Alliance HTTP or HTTPS (secure) communications commands. These commands give you a complete interface for sending XML documents to your trading partners. You can use the commands interactively or from your own CL commands. You can also completely automate the translation process with Alliance library scan.

 

Alliance has lots of goodies to help you be successful with your XML project. You can decode JPEG and TIFF image files and store them in an IFS directory, convert dates to several different formats, encrypt and decrypt data, deploy web services, process SOAP/XML files, and much more! With the comprehensive Alliance Roadmap and sample projects you will have your XML project done in no time.

  </ApplePie>.

 

 


Back To Top

Special Offer

We are giving you a great way to satisfy your software needs, and your budget.
For a limited time, we are offering our existing customers who are current on maintenance an extra 10% off on a new license from us.
This offer includes an additional copy of a product, or a different product. This is over and above your regular 20% discount.
For new customers, we are offering 10% off any product.
To use this offer, please notify us immediately. In order to receive your discount, we must have a valid Purchase Order by June 30, 2004.


XML/400 Technical Tip

Back To Top

Monitoring for transmission errors in Alliance XML/400

 

If you are using the Alliance commands in your CL programs to send XML documents to a remote server you can easily monitor for errors in the communications session using the MONMSG command. The commands used to send XML documents to a remote server are Alliance Send XML (ALLSNDXML) and Alliance Send XML Secure (ALLSNDXMLS). If the communications session fails the Alliance command will receive an exception message that you can monitor for. All of the Alliance message IDs start with “ATC”. You can monitor for all Alliance errors by using message ID ATC0000. Your code in your CL program might look like this:

 

/* Call the Alliance Send XML command */

 

ALLSNDXML +

RMTSYS(WWWCIE.UPS.COM) +

URL('/ups.app/xml/Register') +

CONTYPE('application/xml') +

LOGOPT(*YES) +

IFSOPT(*YES) +

IFSFILE('/tmp/UPSLicense.xml') +

RSPIFSOPT(*YES) +

RSPIFSFILE('/tmp/UPSLicResponse.xml')

 

/* Monitor for errors */

 

MONMSG MSGID(ATC0000) EXEC(DO)

      /* Error handling goes here */

ENDDO

 

When you capture the error you can send a message to the system operator or take other actions in your program. Alliance also has support for sending error messages by email or Simple Network Management Protocol (SNMP). See the sample code in the product library if you want to use these error message options.

 

Lastly, remember that the communications session may be successful, but your trading partner may not be able to process your XML document correctly. You won’t be able to use the MONMSG command for this type of error.

 

 


Support News

Back To Top

Getting XML logs.

 

If you experience a problem and want technical support, the best way to get support is to start a support ticket. To expedite our support team getting back to you, please supply us with a log. Logs help us to see what is happening on your system. They help us to more effectively help you. So before contacting us, please set diagnostic logging and recreate the problem. Then when you start a support ticket, you can attach the logs to the ticket and we will be able to help you quicker.

 

To set Diagnostic Logging options.

 

You should set diagnostic logging in two places.

 

In Global Options:

 

Main Menu / Configuration / Configure XML 400.

Set diagnostic logging is the first option.

 

In the Map

 

For Inbound Mapping:

 

Main Menu / XML Mapping / Work with inbound XML maps / (select the map) / diagnostic logging is on the first page.

 

For Outbound Mapping:

 

Main Menu / XML Mapping / Data Translation / Convert AS/400 to XML  (ALLTRN400) / diagnostic logging is on the first page.

 

 

Now, for parser errors we require different logging.

 

If you are adding an XML document to an inbound map or translating an inbound document, you may get a parser error. These are usually caused by an ill-formed document.

 

Please go to the IFS directory. You will want to look at two logs:

 

(1) Alliance / XML / xmstdout.txt

 

(2) Fnnnnnnnnn.log  (where nnnnnnnn is the number.)

 

Back To Top

LINKS:

Product Information  

 Questions or comments about our newsletter 

 Current versions of all our products  

Product FAQ's 

Get Support  



 

If you would like to Subscribe or Unsubscribe from our newsletter please Click on the appropriate link below and send us the automatically generated E-Mail

  Click here to subscribe to our Newsletter   Click here to unsubscribe from our Newsletter


Privacy Statement

Your privacy is important to us. We do not share your personal
information, including your email address, with any third
party. You can read our full privacy statement here:
http://www.patownsend.com/Legal.htm


Copyright 2004.
 Patrick Townsend & Associates, Inc.7700 Earling Street NE, Olympia, WA 98506
http://www.patownsend.com

Home l Products l Industries l Partners l Support l Search l Technology l Customers l Contact l Legal/Privacy