A Programmer's Introduction to WebServer/IDMS -III

Live XML Access to IDMS Database

XML - Extensible Markup Language, is the new universal format for structured documents and data on the Web. Communication and messaging format in a distributed environment, using XML as its encapsulation language is becoming incerasingly popular and widely used. We may call it an XML Protocol.

This means that IDMS must be able to deliver data in an XML format to other systems - with or without Web. Vegasoft TCP/Interface and supporting tools are tailored to suit this need. Here we use the same WebServer in a different way to generate XML style output instead of traditional static html format.

Here we have an example of the XML Picture for the Department List.

The Source Code of ADS Process:

DIS MOD PHELLO4-PM WITH MOD SOU ONLY AS SYN.                            
------------------------------------------------------------           
MOVE HTMLPAGE(WWWWPTR,'SHELLO4-A',1,                                    
      'DUMMY', ' ')                                                     
   TO WWWWHTTP-STATUS.                                                  
OBTAIN FIRST DEPARTMENT within org-demo-region allowing(db-any-error).  
if (db-any-error)                                                       
  MOVE 'Critical Database Error ' TO WWWWHTML-TXT.                      
While db-status-ok                                                      
REPEAT.                                                                 
MOVE HTMLPAGE(WWWWPTR,'SHELLO4-B',1,                                    
   'DEPTID', DEPT-ID-0410,                                              
   'DEPTNAME', DEPT-NAME-0410,                                          
   'DEPTHEAD', DEPT-HEAD-ID-0410)                                       
   TO WWWWHTTP-STATUS.                                                  
OBTAIN NEXT DEPARTMENT within org-demo-region allowing(db-any-error).   
IF DB-ANY-ERROR EXIT.                                                   
END.                                                                    
CALL WWWSEND.                                                           
move '</Dept_List>'                                                     
   to wwwwhtml-txt.                                                     
CALL WWWSEND.    
RETURN.                                                                                                                        
-------------------------------                                
DEFINE WWWSEND.                                                 
--------------------------------                               
MOVE SLEN(EXTRACT(WWWWHTML-TXT)) TO WWWWSLEN.                   
PUT SCRATCH AREA ID WWWWHTML-SCR  FROM WWWWHTML-TXT LENGTH      
WWWWSLEN.                                                       
GOBACK.                                                         

SHELLO4-A and SHELLO4-B are xml templates stored in IDD.

Here is the source:

     ADD                                                             
     MODULE NAME IS SHELLO4-A VERSION IS 1                           
         LANGUAGE IS HTML                                            
         PUBLIC ACCESS IS ALLOWED FOR ALL                            
         MODULE SOURCE FOLLOWS                                       
<??xml version="1.0" encoding="ISO-8859-1" standalone="no"??> ?_LBR  
<!-- S212 Vegasoft TCP/IP Interface for IDMS -->                     
<Dept_List>                                                          
         MSEND                                                       
         .                                                           
     ADD                                                             
     MODULE NAME IS SHELLO4-B VERSION IS 1                           
         LANGUAGE IS HTML                                            
         PUBLIC ACCESS IS ALLOWED FOR ALL                            
         MODULE SOURCE FOLLOWS                                       
<Dept>?_LBR                                                          
<Dept_Id> ?DEPTID          </Dept_Id>                                
<Dept_Name> ?DEPTNAME                </Dept_Name>                    
<Dept_Head> ?DEPTHEAD                </Dept_Head>                    
</Dept>                                                              
         MSEND                                                       
         .                                                                                                                 

XML is generated by ADS/Online Code. We use templates with tags, which are dynamically filled by the ADS Process. This way one can change the format without compiling the program. Just the template in IDD need to be changed.

This way IDMS DB/DC system can stand up to any modern systems in terms of technology. In reality database access and interface provided by these tools are far superior to patchwork solutions one see in other 'boxes'.

Please send us your comments to idmssql@yahoo.com