Lescasse Consulting
 Home    Company    News    Prices    Download    Buy    Forums   
Read Me
Buy
Forums
Resume
AntiSpam 1.2
wBackup 1.11
NetAccess 2.0
Visual APL 1.0 
APL+Win 7.3 
APL+Win Products 
APL+Win Objects™ 
APL+Win Training 
APL+Web Services
APL+Web Component 
APL+ History
Dyalog.Net Tutorial
Conferences 
Powerpoint
White Papers
Web Hosting
References
Links
 
APL+Win Objects™ 6.0

TADO5
TADO5 Tutorial
TAPLDraw5
TAPLEdit5
TAPLSession5
TAbale5
TAboutBox5
TAccess5
TAgent5
TBlatMail5
TButton5
TCDO5
TCRC5
TCancelButton5
TCheck5
TCheckGroup5
TChildForm5
TChooseColor5
TChooseFont5
TClipBoard5
TClock5
TCodeStats5
TColors5
TCombo5
TComboDrive5
TComboFilter5
TComboList5
TComboTree5
TCommandBar5
TCommandButton5
TControlClass5
TCueCard5
TDHTML5
TDHTMLEditor5
TDateTime5
TDateTimeFr5
TDates5
TDemoHandlers5
TDisplay5
TDOS5
TDualSelect5
TEdit5
TEditAmount5
TEditDir5
TEditEnter5
TEditFile5
TEditGrid5
TEditList5
TEditListview5
TEditMenu5
TEditNum5
TEditSelect5
TEditSpin5
TEmail5
TError5
TExampleForm5
TExcel5
TExcel5 Tutorial
TFindReplace5
TFOne5
TFTP5
TFTP5 Tutorial
TFileCompare5
TFileMenu5
TFileMenuDef5
TFlatButton5
TForm5
TFormClass5
TFormEditor5
TFrame5
TGetDir5
TGif5
TGifForm5
TGifWb5
TGoMenu5
TGraphX5
TGrid5
TGridDisplay5
TGridPrint5
TGUID5
THLine5
THTML5
THTML5 Tutorial
THTTP5
THelp5
THelpMenu5
TImagelist5
TInfo5
TIniFile5
TInstall5
TInternet5
TJpg5
TJpgWb5
TLabel5
TList5
TListview5
TLock5
TLogs5
TMAPI5
TMath5
TMDIForm5
TMSOutlook5
TMaskEdit5
TMedia5
TMenu5
TMessage5
TModalCall5
TMsgBox5
TNavigator5
TNetwork5
TNonVisualClass5
TODBC5
TOKButton5
TObject5
TOpenFile5
TOption5
TOptionGroup5
TOutlook5
TOutlookMail5
TOWCSpread5
TPDF5
TPFKeys5
TPage5
TPassword5
TPicture5
TPing5
TPopupMenu5
TPowerpoint5
TPowerpoint5 Tutorial
TPrinter5
TProgress5
TProgressDlg5
TQuestion5
TRegistry5
TRegistryKey5
TResource5
TRichEdit5
TSPX5
TSQLDMO5
TScheduler5
TScroll5
TSelector5
TSpinner5
TSplitter5
TStatus5
TStopWatch5
TTest5
TTestError5
TTextFile5
TTimer5
TTip5
TTipForm5
TTLI5
TToolBar5
TToolbox5
TToolsMenu5
TTrackbar5
TTranslate5
TTree5
TVLine5
TViewMenu5
TWebBrowser5
TWebServer5
TWebSite5
TWebSiteNet5
TWinMenu5
TWord5
TYesNo5
    Visits:  3764 (11 on line) Last Update: Apr 22, 2003  
    APL+Web Services    Printer Friendly  
APL+Web Services

APL+Win 5.0 is delivered with APL+Web Services, apackage which allows you to create Web Services in APL+Win.

With APL+Web Services you can easily have your Internet or Intranet site display
data computed by your APL application

We will soon post an article on this Web Site showing how to set up simple Web Services as the ones demonstrated below.

New APL+Web Services Hosting Service

As a matter of fact the main difficulty is not to design your APL+Web Services, but to find a provider which will accept to install APL+Win 5.0 on one of this servers to host your APL Web Services.

For this reason, we have recently set up a new powerful Internet Server equiped with the Microsoft .Net Framework, with APL+Win 5.0 and APL+Web Services and offer a new service to our customers for hosting their APL+Web Services on our server.


Simple APL+Web Services Examples

Here are some APL+Win Web Services:

   RandomTable This APL+Win Web Service draws a 10 by 10 matrix of Random Numbers and then generates an HTML response stream displaying this Random Numbers matrix in a simple HTML table
 
   RandomTable2 This APL+Win Web Service draws a 10 by 10 matrix of Random Numbers and then generates an HTML response stream with a VB Script using the Microsoft OWC (Office Web Component) spreadsheet to display the Random Numbers table
 
Explaining the 2 Sample APL Web Services

The RandomTable APL Web Services

Here is the APL RandomTable Web Service function:

    ’ response„RandomTable;R;I;J;table
[1]   ©’ RandomTable APL+Win Web Service
[2]   ©’ (c) Eric Lescasse 14jan04
[3]
[4]   table„?10 10½1000
[5]
[6]   R„'<HTML><HEAD></HEAD>'
[7]   R„R,Œtcnl,'<BODY>'
[8]   R„R,Œtcnl,'<DIV ALIGN="center">'
[9]   R„R,Œtcnl,'<H1>APL+Win Web Service</H1>'
[10]  R„R,Œtcnl,'<H2>RandomTable</H2>'
[11]  R„R,Œtcnl,'<FONT STYLE="font: 8pt Verdana, Helvetica, Arial, sans-serif;">'
[12]  R„R,Œtcnl,'This APL+Win Web Service draws a 10 by 10 matrix of Random Numbers<BR>'
[13]  R„R,Œtcnl,'and then generates an HTML response stream displaying this Random Numbers matrix<BR>'
[14]  R„R,Œtcnl,'in a simple HTML table<BR> '
[15]  R„R,Œtcnl,'</FONT>'
[16]  R„R,Œtcnl,'<TABLE>',Œtcnl
[17]  :for I :in ¼10
[18]      R„R,Œtcnl,'  <TR>',Œtcnl
[19]      :for J :in ¼10
[20]          R„R,Œtcnl,'    <TD ALIGN="right">',(•table[I;J]),'</TD>',Œtcnl
[21]      :end
[22]      R„R,Œtcnl,'  </TR>',Œtcnl
[23]  :end
[24]  R„R,Œtcnl,'</TABLE>',Œtcnl
[25]  R„R,Œtcnl,'<BR>'
[26]  R„R,Œtcnl,''
[27]  R„R,Œtcnl,'<FONT STYLE="font: 7pt Verdana, Helvetica, Arial, sans-serif;">'
[28]  R„R,Œtcnl,'(click on the Internet Explorer Refresh button to run the Web Service again)'
[29]  R„R,Œtcnl,'</FONT>'
[30]  R„R,Œtcnl,'</BODY>'
[31]  R„R,Œtcnl,'</HTML>'
[32]  response„R
[33]
    ’
		

Line 4 is all it takes to APL to compute the 10 by 10 matrix of random numbers.

Lines 6 to 32 are just there to create some HTML code to render the random matrix in an HTML table with some ecplanations.


The RandomTable2 APL Web Services

Here is the second APL Web Service RandomTable2 APL function:


    ’ response„RandomTable2;R;I;J;file;tie;table
[1]   ©’ RandomTable2 APL+Win Web Service
[2]   ©’ (c) Eric Lescasse 14jan04
[3]
[4]   table„?10 10½1000
[5]
[6]   R„'<HTML><HEAD></HEAD>'
[7]   R„R,Œtcnl,'<BODY>'
[8]   R„R,Œtcnl,'<DIV ALIGN="center">'
[9]   R„R,Œtcnl,'<H1>APL+Win Web Service</H1>'
[10]  R„R,Œtcnl,'<H2>RandomTable2</H2>'
[11]  R„R,Œtcnl,'<FONT STYLE="font: 8pt Verdana, Helvetica, Arial, sans-serif;">'
[12]  R„R,Œtcnl,'This APL+Win Web Service draws a 10 by 10 matrix of Random Numbers<BR>'
[13]  R„R,Œtcnl,'and then generates an HTML response stream with a VB Script using the Microsoft OWC<BR>'
[14]  R„R,Œtcnl,'(Office Web Component) spreadsheet to display the Random Numbers table<BR><BR>'
[15]  R„R,Œtcnl,'</FONT>'
[16]  R„R,Œtcnl,''
[17]  R„R,Œtcnl,'<OBJECT classid="clsid:0002E551-0000-0000-C000-000000000046" id="oSS" width=400 height=250 border="1"></OBJECT>'
[18]  R„R,Œtcnl,'<BR><BR>'
[19]  R„R,Œtcnl,''
[20]  R„R,Œtcnl,'<FONT STYLE="font: 7pt Verdana, Helvetica, Arial, sans-serif;">'
[21]  R„R,Œtcnl,'(click on the Internet Explorer Refresh button to run the Web Service again)'
[22]  R„R,Œtcnl,'</FONT>'
[23]  R„R,Œtcnl,''
[24]  R„R,Œtcnl,'<SCRIPT LANGUAGE="VBScript">'
[25]  R„R,Œtcnl,'<!--'
[26]  R„R,Œtcnl,'Sub window_OnLoad()'
[27]  R„R,Œtcnl,'    Dim oSheet'
[28]  R„R,Œtcnl,'    Dim iNumCols'
[29]  R„R,Œtcnl,'    Dim iNumRows'
[30]  R„R,Œtcnl,'    Dim oTbarButton'
[31]  R„R,Œtcnl,'    Dim c'
[32]  R„R,Œtcnl,'    Set c = oSS.Constants'
[33]  R„R,Œtcnl,'    oSS.ScreenUpdating = False'
[34]  R„R,Œtcnl,'    ''Add a new worksheet.'
[35]  R„R,Œtcnl,'    Set oSheet = oSS.Worksheets.Add(1)'
[36]  R„R,Œtcnl,'    ''Delete all other worksheets.'
[37]  R„R,Œtcnl,'    Do While oSS.Worksheets.Count > 1'
[38]  R„R,Œtcnl,'        oSS.Worksheets(2).Delete'
[39]  R„R,Œtcnl,'    Loop'
[40]  R„R,Œtcnl,'    ''Name the new worksheet.'
[41]  R„R,Œtcnl,'    oSheet.Name = "RandomTable2"'
[42]  R„R,Œtcnl,'    ''Determine the number of rows and columns.'
[43]  R„R,Œtcnl,'    iNumRows = ',•1œ½table
[44]  R„R,Œtcnl,'    iNumCols = ',•2œ½table
[45]  R„R,Œtcnl,'    ''Format columns.'
[46]  R„R,Œtcnl,'    oSheet.Range(oSheet.Cells(1,1),oSheet.Cells(iNumRows,iNumCols)).HorizontalAlignment = c.xlHAlignRight'
[47]  R„R,Œtcnl,'    oSheet.Range(oSheet.Cells(1,1),oSheet.Cells(iNumRows,iNumCols)).NumberFormat = "#"'
[48]  R„R,Œtcnl,'    ''Show the title bar.'
[49]  R„R,Œtcnl,'    oSS.DisplayTitleBar = False'
[50]  R„R,Œtcnl,'    ''Hide the Microsoft Office logo on the toolbar.'
[51]  R„R,Œtcnl,'    oSS.DisplayOfficeLogo = False'
[52]  R„R,Œtcnl,'    ''Display the Toolbar.'
[53]  R„R,Œtcnl,'    oSS.DisplayToolbar = True'
[54]  :for I :in ¼10
[55]      :for J :in ¼10
[56]          R„R,Œtcnl,'    oSheet.Cells(',(•I),',',(•J),').Value = "',(•table[I;J]),'"'
[57]      :end
[58]  :end
[59]  R„R,Œtcnl,'    ''Remove the "Refresh All" and "Help" button from the toolbar.'
[60]  R„R,Œtcnl,'    On Error Resume Next'
[61]  R„R,Œtcnl,'    Set oTbarButton = oSS.Toolbar.Buttons("owc10061") ''Refresh All button'
[62]  R„R,Œtcnl,'    If Not Err.Number Then'
[63]  R„R,Œtcnl,'        oSS.Toolbar.Buttons.Remove oTbarButton.Index - 1'
[64]  R„R,Œtcnl,'        oSS.Toolbar.Buttons.Remove oTbarButton.Index'
[65]  R„R,Œtcnl,'    End If'
[66]  R„R,Œtcnl,'    Err.Clear'
[67]  R„R,Œtcnl,'    Set oTbarButton = oSS.Toolbar.Buttons("owc1006") ''Help button'
[68]  R„R,Œtcnl,'    If Not Err.Number Then'
[69]  R„R,Œtcnl,'        oSS.Toolbar.Buttons.Remove oTbarButton.Index - 1'
[70]  R„R,Œtcnl,'        oSS.Toolbar.Buttons.Remove oTbarButton.Index'
[71]  R„R,Œtcnl,'    End If'
[72]  R„R,Œtcnl,'    On Error GoTo 0'
[73]  R„R,Œtcnl,'    ''Apply window settings.'
[74]  R„R,Œtcnl,'    oSS.Windows(1).ViewableRange = oSheet.UsedRange.Address'
[75]  R„R,Œtcnl,'    oSS.Windows(1).DisplayRowHeadings = False'
[76]  R„R,Œtcnl,'    oSS.Windows(1).DisplayColumnHeadings = False'
[77]  R„R,Œtcnl,'    oSS.Windows(1).DisplayVerticalScrollBar = True'
[78]  R„R,Œtcnl,'    oSS.Windows(1).DisplayHorizontalScrollBar = True'
[79]  R„R,Œtcnl,'    ''Autofit the component on the Web page.'
[80]  R„R,Œtcnl,'    oSS.AutoFit = True'
[81]  R„R,Œtcnl,'    oSS.ScreenUpdating = True'
[82]  R„R,Œtcnl,'End Sub'
[83]  R„R,Œtcnl,'</script>'
[84]  R„R,Œtcnl,'</HTML>'
[85]  response„R
[86]
    ’

The chore of the Web Service is still the very simple line 4 which computes the 10 by 10 random table.

But the rendering is more sophisticated this time: the code from line 6 to 86 uses an Microsoft OWC (Office Web Components) spreadsheet object, instantiated on line 17, to display the random matrix.

From line 24 to 82 we use a VB Script routine to fill the spreadhsheet cells with values from our APL variable (lines 55 to 57) and to setup various spreadsheet properties for a nicer display (lines 61 to 81).

Conclusion

Of course we have used extremely simple APL Web Services here (as a matter of fact, a single APL instruction) but you could as well write Web services spanning hundreds of lines of APL code, using APL or native files, etc.

APL+Win 5.0 and the APL+Web Services bring the extraordinary power of APL to the Web and to Internet!

 This entire Web site has been dynamically generated by APL+Win Objects™ 6.0
 For all questions contact:  info@lescasse.com
 Copyright © 2003-2005 Lescasse Consulting. All rights reserved.