*/ Connect to other onlines and display startup date/time */ and number of currently logged on users. */ Client talks with an apsy called STATUSMON, the code */ for which resides as STATUS****** procedures in file */ TOOLS. To make this work you need two web rules, one */ to make this page work... something like: */ JANUS WEB [port] ON /DEMO/* OPEN FILE JANWEB CMD 'I *' */ And another one so this page can communicate over http */ with the server program. Something like: */ JANUS WEB [port] ON /WEBSTATUSMON/* CMD 'STATUSMON *' UTABLE LPDLST 4000 Begin %dt is string len 20 %host is string len 20 %msg is string len 132 array(3) %port is string len 4 array(12) %test is float %z is float %doc Object XmlDoc %n Object XmlNode %m Object XmlNode %req Object HttpRequest %resp Object HttpResponse %test = 0 %dt = $Web_Date + (30 * 24 * 60 * 60) Call $Web_On Call $Web_Type('TEXT/HTML') Call $Web_Sub('@@') Call $Web_Expire($Web_Date - 1) Call $Web_Response('PRAGMA', 'NO-CACHE') %host = 'sirius.sirius-software.com' %port(1) = 80 %port(2) = 9703 %port(3) = 9702 %port(4) = 9700 %port(5) = 9609 %port(6) = 9608 %port(7) = %port(8) = %port(9) = %port(10) = * Build the XML request. %req = New %doc = New %n = %doc:AddElement('soap:Envelope', , 'http://schemas.xmlsoap.org/soap/envelope/') %n = %n:AddElement('soap:Body') %n = %n:AddElement('StatRequest') %m = %n:AddElement('Stat', 'NLOGON') %m = %n:AddElement('Stat', 'CPU') * Start the HTML page to display results. In file JANWEB include WEB/TEMPLATE_TOP Html
This page is a demonstration program for Janus Sockets and Janus SOAP. Janus Sockets is a product that provides socket connectivity between Model 204 and many other tcp/ip bases services. Sockets are the low-level connection underlying http, ftp, telnet and most other internet services. SOAP (Simple Object Access Protocol) is a stateless, one-way message exchange paradigm on which more complex interactions can also be built. SOAP envelopes contain XML InfoSets, and much of the Janus SOAP API is centered on structuring XML documents.
The program that generates this page opens socket connections to other 204 onlines at Sirius Software to check whether they're running. The remote online responds by sending a short XML document via Janus SOAP. The XML is parsed, also via Janus SOAP functions, and the information is presented here:
| Online Status | ||||||
|---|---|---|---|---|---|---|
| Online | System Initialization | Logged on Users | ||||
| ULSPFPRO | Else Html Data||||||
| ULSPF{$substr(%port(%z),2)} | End If If %resp eq Null Then Html DataRegion or port not accessible | Loop Next End If * Grab the returned info %doc = New * %doc:print If %resp:ParseXML(%doc, 'ErrRet') Then Html DataRemote port not responding as expected | Loop Next End If * If not %doc:SelectCount('//stat') Then If %doc:SelectSingleNode('//stat') eq Null Then Html DataInvalid response from online | {%doc:Value('//@inittime')} | {%doc:Value('//stat')} | End Html End If End For * Close the page. Close: Html|
The code that generated this page can be seen here. This program that responds to the socket call is a small apsy subsystem that responds by sending an XML document. This code can be seen here.
End Html In file JANWEB include WEB/TEMPLATE_BOTTOM STOP INCREMENT: * ... End of mainline. ERRX: Call $Web_Flush Call $Web_Type('text/html') Text