How to Debug LANSA Webserver Errors

So the LANSA webserver is down, Model A or Model B, no difference for now.  Here are the steps to work you through the issues.

  1. Can you connect to root url?  http://172.17.0.64/
  2. Can you connect to http://172.17.0.64/cgi-bin/about
  3. Can you connect to http://172.17.0.64/cgi-bin/lansaweb?about
    If Not, look at tp jobs and look at job log, usually something as simple as a bad jobd.

How to Send / Receive JSON to LANSA WAMS

This is some cool stuff.  I need to refresh some files on our application server from some presentation servers on AWS.  Here is my example so I don’t forget how to do this.  I hope this helps.

The easiest way to approach this is to build a wam *json that just dumps the file out.

  • JSONINPT WAM Below

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet(‘std_blank_layout’)

Webroutine Name(ShowWork) Response(*JSON)
Web_Map For(*OUTPUT) Fields(#outlist)

Def_List Name(#outlist) Fields(#EDIV #ESTAT #EPACH #EDNAM #EIMAG002 #EIMAG2001 #EIMAG3 #EHOMB #EHOMS #ETHEM #EDESG #ERETL #ERESD #ECOMD #EPR #EEXTR1 #EEXTR2 #ECRUSR) Type(*Working) Entrys(*MAX)

#std_num := 0

*
Select Fields(#EDIV #ESTAT #EPACH #EDNAM #EIMAG002 #EIMAG2001 #EIMAG3 #EHOMB #EHOMS #ETHEM #EDESG #ERETL #ERESD #ECOMD #EPR #EEXTR1 #EEXTR2 #ECRUSR) From_File(M55E100)
Add_Entry To_List(#outlist)
#std_num := #std_num + 1
*
Leave If(#STD_NUM *GT 9)
Endselect

Endroutine

YOURLANSASERVER/CGI-BIN/lansaweb?wam=JSONINPT&webrtn=ShowWork&ml=LANSA:XHTML&part=YWD&lang=ENG

 

THIS IS the OUTPUT WHEN FILE IS EMPTY

{“webroutine”:{“context”:{“action-request”:”/CGI-BIN/lansaweb”,”dec-separator”:”.”,”images-path”:”/IMAGES”,”iso-lang”:”en”,”language”:”ENG”,”partition”:”YWD”,”service-name”:”JSONINPT_ShowWork”,”session-key”:””,”session-key-method”:”hidden”,”session-key-name”:”_SESSIONKEY”,”technology-service”:”LANSA:XHTML”,”user-id”:”LANDEVPGM”,”webapplication”:”JSONINPT”,”webapplication-title”:”Test JSON input”,”webroutine”:”ShowWork”,”webroutine-title”:””},”lists”:{“OUTLIST”:{“header”:[{“name”:”EDIV”},{“name”:”ESTAT”},{“name”:”EPACH”},{“name”:”EDNAM”},{“name”:”EIMAG002″},{“name”:”EIMAG2001″},{“name”:”EIMAG3″},{“name”:”EHOMB”},{“name”:”EHOMS”},{“name”:”ETHEM”},{“name”:”EDESG”},{“name”:”ERETL”},{“name”:”ERESD”},{“name”:”ECOMD”},{“name”:”EPR”},{“name”:”EEXTR1″},{“name”:”EEXTR2″},{“name”:”ECRUSR”}],”entries”:[]}}}}

This is input with one entry in list

{“webroutine”:{“fields”:{“STD_NUM”:{“value”:1}},”lists”:{“MYLIST”:{“header”:[{“name”:”EDIV”},{“name”:”ESTAT”},{“name”:”EPACH”},{“name”:”EDNAM”},{“name”:”EIMAG002″},{“name”:”EIMAG2001″},{“name”:”EIMAG3″},{“name”:”EHOMB”},{“name”:”EHOMS”},{“name”:”ETHEM”},{“name”:”EDESG”},{“name”:”ERETL”},{“name”:”ERESD”},{“name”:”ECOMD”},{“name”:”EPR”},{“name”:”EEXTR1″},{“name”:”EEXTR2″},{“name”:”ECRUSR”}],”entries”:[[“ALL”,”P”,”P”,”Studio Source”,”/IMG/PRODUCTS/BRANDS/MASTHEAD/MAGNUMSOURCEMASTHEAD”,””,”/IMG/PRODUCTS/BRANDS/LOGOS/MAGNUMSOURCELOGO”,”N”,”N”,”N”,”N”,”N”,”Y”,”Y”,”Y”,””,””,””]]}}}}

 

This is WAM ROUTINE TO DIGEST JSON

Webroutine Name(TEST) Response(*JSON)

Web_Map For(*both) Fields(#STD_NUM)
Web_Map For(*input) Fields(#mylist)
Web_Map For(*output) Fields(#mylist2)
Def_List Name(#mylist) Fields(#EDIV #ESTAT #EPACH #EDNAM #EIMAG002 #EIMAG2001 #EIMAG3 #EHOMB #EHOMS #ETHEM #EDESG #ERETL #ERESD #ECOMD #EPR #EEXTR1 #EEXTR2 #ECRUSR) Type(*Working) Entrys(*MAX)
Def_List Name(#mylist2) Fields(#EDIV #ESTAT #EPACH #EDNAM #EIMAG002 #EIMAG2001 #EIMAG3 #EHOMB #EHOMS #ETHEM #EDESG #ERETL #ERESD #ECOMD #EPR #EEXTR1 #EEXTR2 #ECRUSR) Type(*Working) Entrys(*MAX)
#std_num := #std_num + 1

 

Clr_List Named(#mylist2)

Selectlist Named(#mylist)
Insert Fields(#EDIV #ESTAT #EPACH #EDNAM #EIMAG002 #EIMAG2001 #EIMAG3 #EHOMB #EHOMS #ETHEM #EDESG #ERETL #ERESD #ECOMD #EPR #EEXTR1 #EEXTR2 #ECRUSR) To_File(M55E100) Issue_Msg(*YES)
Add_Entry To_List(#mylist2)
Endselect

 

Endroutine

 

OK Now the FUN PART.  You will download fiddler to send the JSON Data.  Look at picture.   Also, I am available for projects..

Click on the Composer tab

COPY your URLand Select POST http/1.1
and use

Host: YOURURL
Content-Length: 0
Content-Type: application/json; charset=UTF-8

PUT YOUR JSON in THE REQUEST BODY

 

WAM JSON
LANSA WAM JSON EXAMPLE

 

SEDAN DRIVERS FOR MAJOR EVENTS NEEDED!

WHYUBER

Is looking for new drivers in your area.
You can set your own hours and make up to $150 a day if

You are…
At least 21 years old, with a driver’s license and auto insurance.

Your Vehicle Is. . .
Any mid-size or full-size 4-door vehicle 2005 or newer in excellent condition.
Earn a $100 bonus if after completing number of rides (usually 10-20)

You have a smart phone, and can work late nights.

http://WhyUBER.com

SQL – INNER vs Left

Select sah.*,ari.*
From prddtalib.slsah sah
Inner join prddtalib.arari ari on ari.UCIHACTID = sah.actid
left join prddtalib.slsad sad on sad.actid=ari.UCITACTID
Where sad.sahnum is null

vs

SELECT * FROM devdtalib/slsah, devdtalib/arari WHERE SLSAH.ACTID =
ARARI.UCIHACTID and NOT EXISTs( SELECT SLSAD.ACTID FROM
DEVDTALIB/SLSAD where ARARI.UCITACTID = SLSAD.ACTID)

LANSA Template Programming

Here is some template variables to use

@@CLR_LST
Clear a work list

@@CMP_IDX
Compare an index value

@@COMMENT
Add a comment line to the generated RDML code

@@DEC_IDX
Decrement an index value

@@GET_FILS
Get the files to be used in this template

@@GOTO
Pass control to a label

@@IF
Test a condition and pass control to a label

@@INC_IDX
Increment an index value

@@LABEL
A label which is the subject of another command

@@MAK_LSTS
Make a list of selected fields from another list(s)

@@MRG_LSTS
Merge a list(s) with another list(s)

@@QUESTION
Ask a question and receive a reply

@@RTV_FLDS
Retrieve the fields in a file

@@RTV_KEYS
Retrieve the keys of a file

@@RTV_RELN
Retrieve the relationship between two files

@@SET_IDX
Set an index value

FILES:

@@FNAMEnn
File name
A
10

@@FLIBRnn
File library
A
10

@@FVERSnn
File version number
N
15
5

@@FTYPEnn
File type (P=PF, L=LF)
A
1

@@FDESCnn
File description
A
40

@@FBASPnn
Based in physical file name
A
10

@@FRELFnn
Related file name
A
10

@@FRELLnn
Related file library
A
10

@@FRELVnn
Related file version number
N
15
5

@@FRELRnn
Related file relationship (O=1:1, M=1:n)
A
1

@@FRELAnn
Related file access route name
A
10

@@FRELCnn
Related file connection type. The connection types are:

BASE = Base file
DIRBASE = Directly connected to the base file
INDBASE = Indirectly connected to the base file
DETAIL = Detail file
(i.e. 1 : Many related file)
DIRDETL = Directly connected to detail file
INDDETL = Indirectly connected to detail file
A
70

@@FAREAnn
Header or browse area (H=HDR,B=BRW)
A
1

@@TFMX
Maximum file number selected
N
15
5

@@TFMN
Minimum file number selected
N
15
5

FIELDS:

Variable
Description
Type
Len
Dec

1
@@LSTnn
List name – all elements of list
A
Variable

1
@@LSUnn
List name – all elements of list
A
Variable

2
@@LSXnn/yy
List name – first yy elements of list
A
Variable

1
@@LNEnn
Number of elements in list nn
N
2
0

3
@@LELnnxx
Element xx of list nn
A
10

3
@@LATnnxx
Attributes of element xx of list nn
A(7)
10

3
@@LDSnnxx
Description of element xx of list nn
A
40

3
@@LTPnnxx
Type of element xx of list nn (A,P,S)
A
40

Adding New User to LANSA SQL Database LANSADB

Because we have migrated to a new network profile, our access to our LANSA SQL database will now be denied.  These instructions can also be used if inheriting someone’s LANSA install and would like to continue using their existing environment.

 

You need SQL Management studio to add a new login user to SQL, if  not installed you can down load it from Microsoft’s Download center.

 

http://www.microsoft.com/en-us/download/details.aspx?id=7593

 

To add a new user to your SQL database

SQL SERVER 2008

Number 3 Microsoft® SQL Server® 2008 Management Studio Express
ugly2

Install using your pc name/ SQLSERVER as server name
ugly3

Right Click LOGINS and select New
ugly4

This is the ADD screen, use my credentials as a guide.
ugly5

ugly6

ugly7

ugly8

SQL SERVER 2008