Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md

This commit is contained in:
2026-08-18 20:59:52 -04:00
commit 454973e269
5978 changed files with 2664094 additions and 0 deletions
File diff suppressed because one or more lines are too long
+26
View File
@@ -0,0 +1,26 @@
@rem
@rem FOURJS_START_COPYRIGHT(U,2000)
@rem Property of Four Js*
@rem (c) Copyright Four Js 2000, 2021. All Rights Reserved.
@rem * Trademark of Four Js Development Tools Europe Ltd
@rem in the United States and elsewhere
@rem
@rem Four Js and its suppliers do not warrant or guarantee that these samples
@rem are accurate and suitable for your purposes. Their inclusion is purely for
@rem information purposes only.
@rem FOURJS_END_COPYRIGHT
@rem
fglform calculatorClient.per
fglform enterURL.per
fglwsdl -soap11 -o ws_calculator http://localhost:8090/Calculator?WSDL
fglcomp ws_calculator.4gl
fglcomp calculatorClient.4gl
call fgllink -o CalculatorClient.42r calculatorClient.42m ws_calculator.42m
fglwsdl -soap12 -o ws_calculatorSoap12 http://localhost:8090/Calculator?WSDL
fglcomp ws_calculatorSoap12.4gl
fglcomp calculatorClientSoap12.4gl
call fgllink -o CalculatorClientSoap12.42r calculatorClientSoap12.42m ws_calculatorSoap12.42m
@@ -0,0 +1,120 @@
#
# FOURJS_START_COPYRIGHT(U,2000)
# Property of Four Js*
# (c) Copyright Four Js 2000, 2021. All Rights Reserved.
# * Trademark of Four Js Development Tools Europe Ltd
# in the United States and elsewhere
#
# Four Js and its suppliers do not warrant or guarantee that these samples
# are accurate and suitable for your purposes. Their inclusion is purely for
# information purposes only.
# FOURJS_END_COPYRIGHT
#
GLOBALS "ws_calculator.inc"
MAIN
DEFINE op1 INTEGER
DEFINE op2 INTEGER
DEFINE result INTEGER
DEFINE remaind INTEGER
DEFINE terminate INTEGER
DEFINE wsstatus INTEGER
CLOSE WINDOW SCREEN
IF num_args()==1 THEN
LET Calculator_CalculatorPortTypeEndpoint.Address.URI = Retrieve_URL()
END IF
OPEN WINDOW w1 WITH FORM "calculatorClient" ATTRIBUTE (TEXT="Soap 1.1 Web Services calculator demo",STYLE="naked")
LET terminate=false
WHILE NOT terminate
INPUT BY NAME op1,op2 ATTRIBUTE (UNBUFFERED)
ON ACTION plus
CALL Add(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION minus
CALL Subtract(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION multiply
CALL Multiply(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION divide
CALL Divide(op1, op2) RETURNING wsstatus, result, remaind
CASE wsstatus
WHEN 0
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
WHEN FaultID_DividedByZero
DISPLAY DividedByZero TO msg
OTHERWISE
DISPLAY wsError.description TO msg
END CASE
ON ACTION close
LET terminate=true
EXIT INPUT
END INPUT
END WHILE
CLOSE WINDOW w1
END MAIN
FUNCTION Retrieve_URL()
DEFINE url STRING
DEFINE custo STRING
OPEN WINDOW w2 WITH FORM "enterURL" ATTRIBUTE (TEXT="Web Services URL",STYLE="naked")
LET url = arg_val(1)
INPUT BY NAME url WITHOUT DEFAULTS ATTRIBUTE (UNBUFFERED)
ON ACTION ACCEPT
EXIT INPUT
ON CHANGE url
IF url=="Customize" THEN
LET url="http://host:port/Calculator"
PROMPT "Enter your URL" FOR url ATTRIBUTES (WITHOUT DEFAULTS)
IF NOT INT_FLAG THEN
LET INT_FLAG = false
EXIT INPUT
ELSE
LET url = arg_val(1)
END IF
END IF
ON ACTION CANCEL
EXIT PROGRAM
END INPUT
LET INT_FLAG = false
CLOSE WINDOW w2
RETURN url
END FUNCTION
FUNCTION fillcombourls(cb)
DEFINE cb ui.ComboBox
IF cb.getTag()=="COMBO" THEN
CALL cb.addItem(arg_val(1),"(Standalone) "||arg_val(1))
CALL cb.addItem("http://localhost:6394/ws/r/demo/Calculator","(Httpdispatch) http://localhost:6394/ws/r/demo/Calculator")
CALL cb.addItem("http://localhost/gas/ws/r/demo/Calculator","(FastCGI) http://localhost/gas/ws/r/demo/Calculator")
CALL cb.addItem("http://localhost/gas/ws/r/demo/Calculator","(ISAPI) http://localhost/gas/ws/r/demo/Calculator")
CALL cb.addItem("Customize","(Customize) Click here to add your own URL")
END IF
END FUNCTION
@@ -0,0 +1,70 @@
--
-- FOURJS_START_COPYRIGHT(U,2000)
-- Property of Four Js*
-- (c) Copyright Four Js 2000, 2021. All Rights Reserved.
-- * Trademark of Four Js Development Tools Europe Ltd
-- in the United States and elsewhere
--
-- Four Js and its suppliers do not warrant or guarantee that these samples
-- are accurate and suitable for your purposes. Their inclusion is purely for
-- information purposes only.
-- FOURJS_END_COPYRIGHT
--
SCHEMA FORMONLY
ACTION DEFAULTS
ACTION plus ( ACCELERATOR=F1 )
ACTION minus ( ACCELERATOR=F2 )
ACTION multiply ( ACCELERATOR=F3 )
ACTION divide ( ACCELERATOR=F4 )
END
LAYOUT
GROUP (TEXT="Calculator DEMO")
VBOX
HBOX
VBOX
GRID
{
Operand: [op1 ]
Operand: [op2 ]
Result: [result ]
Remainder: [remaind]
}
END
END -- vbox
VBOX
GRID
{
[bt1 ] [bt2 ]
[bt3 ] [bt4 ]
}
END
END -- vbox
END -- hbox
HBOX
GRID
{
[msg ]
}
END -- group
END --hbox
END --vbox
END -- group
END -- layout
ATTRIBUTES
EDIT op1=formonly.op1;
EDIT op2=formonly.op2;
EDIT result=formonly.result;
EDIT remaind=formonly.remaind, COLOR = RED;
BUTTON bt1 : plus, TEXT="Plus",COMMENT="Add the first operand to the second one";
BUTTON bt2 : minus, TEXT="Minus",COMMENT="Substract the first operand to the second one";
BUTTON bt3 : multiply, TEXT="Multiply",COMMENT="Multiply the first operand with the second one";
BUTTON bt4 : divide, TEXT="Divide",COMMENT="Divide the first operand by the second one";
TEXTEDIT msg=formonly.msg, NOENTRY, STRETCH=BOTH,SCROLLBARS=NONE,TITLE="Error description";
END
@@ -0,0 +1,117 @@
#
# FOURJS_START_COPYRIGHT(U,2000)
# Property of Four Js*
# (c) Copyright Four Js 2000, 2021. All Rights Reserved.
# * Trademark of Four Js Development Tools Europe Ltd
# in the United States and elsewhere
#
# Four Js and its suppliers do not warrant or guarantee that these samples
# are accurate and suitable for your purposes. Their inclusion is purely for
# information purposes only.
# FOURJS_END_COPYRIGHT
#
GLOBALS "ws_calculatorSoap12.inc"
MAIN
DEFINE op1 INTEGER
DEFINE op2 INTEGER
DEFINE result INTEGER
DEFINE remaind INTEGER
DEFINE terminate INTEGER
DEFINE wsstatus INTEGER
CLOSE WINDOW SCREEN
IF num_args()==1 THEN
LET Calculator_CalculatorPortTypeSoap12Endpoint.Address.URI = Retrieve_URL()
END IF
OPEN WINDOW w1 WITH FORM "calculatorClient" ATTRIBUTE (TEXT="Soap 1.2 Web Services calculator demo",STYLE="naked")
LET terminate=false
WHILE NOT terminate
INPUT BY NAME op1,op2 ATTRIBUTE (UNBUFFERED)
ON ACTION plus
CALL Add(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION minus
CALL Subtract(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION multiply
CALL Multiply(op1, op2) RETURNING wsstatus, result
IF wsstatus = 0 THEN
LET remaind=NULL
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
ELSE
DISPLAY wsError.description TO msg
END IF
ON ACTION divide
CALL Divide(op1, op2) RETURNING wsstatus, result, remaind
CASE wsstatus
WHEN 0
DISPLAY BY NAME result,remaind
DISPLAY "OK" TO msg
WHEN FaultID_DividedByZero
DISPLAY DividedByZero TO msg
OTHERWISE
DISPLAY wsError.description TO msg
END CASE
ON ACTION close
LET terminate=true
EXIT INPUT
END INPUT
END WHILE
CLOSE WINDOW w1
END MAIN
FUNCTION Retrieve_URL()
DEFINE url STRING
DEFINE custo STRING
OPEN WINDOW w2 WITH FORM "enterURL" ATTRIBUTE (TEXT="Web Services URL",STYLE="naked")
LET url = arg_val(1)
INPUT BY NAME url WITHOUT DEFAULTS ATTRIBUTE (UNBUFFERED)
ON ACTION ACCEPT
EXIT INPUT
ON CHANGE url
IF url=="Customize" THEN
LET url="http://host:port/Calculator"
PROMPT "Enter your URL" FOR url ATTRIBUTES (WITHOUT DEFAULTS)
IF NOT INT_FLAG THEN
LET INT_FLAG = false
EXIT INPUT
ELSE
LET url = arg_val(1)
END IF
END IF
ON ACTION CANCEL
EXIT PROGRAM
END INPUT
LET INT_FLAG = false
CLOSE WINDOW w2
RETURN url
END FUNCTION
FUNCTION fillcombourls(cb)
DEFINE cb ui.ComboBox
IF cb.getTag()=="COMBO" THEN
CALL cb.addItem(arg_val(1),"(Standalone) "||arg_val(1))
CALL cb.addItem("http://localhost:6394/ws/r/demo/Calculator","(Httpdispatch) http://localhost:6394/ws/r/demo/Calculator")
CALL cb.addItem("http://localhost/gas/ws/r/demo/Calculator","(FastCGI) http://localhost/gas/ws/r/demo/Calculator")
CALL cb.addItem("http://localhost/gas/ws/r/demo/Calculator","(ISAPI) http://localhost/gas/ws/r/demo/Calculator")
CALL cb.addItem("Customize","(Customize) Click here to add your own URL")
END IF
END FUNCTION
@@ -0,0 +1,35 @@
--
-- FOURJS_START_COPYRIGHT(U,2011)
-- Property of Four Js*
-- (c) Copyright Four Js 2011, 2021. All Rights Reserved.
-- * Trademark of Four Js Development Tools Europe Ltd
-- in the United States and elsewhere
--
-- Four Js and its suppliers do not warrant or guarantee that these samples
-- are accurate and suitable for your purposes. Their inclusion is purely for
-- information purposes only.
-- FOURJS_END_COPYRIGHT
--
SCHEMA FORMONLY
LAYOUT
GROUP (TEXT="Enter Service URL")
HBOX
GRID
{
URL: [url ] [bt1]
}
END
END -- hbox
END -- group
END -- layout
ATTRIBUTES
COMBOBOX url=formonly.url TYPE CHAR, NOT NULL, TAG="COMBO", INITIALIZER=fillcombourls;
BUTTON bt1 : accept, TEXT="OK", IMAGE="ok";
END
+14
View File
@@ -0,0 +1,14 @@
@rem
@rem FOURJS_START_COPYRIGHT(U,2000)
@rem Property of Four Js*
@rem (c) Copyright Four Js 2000, 2021. All Rights Reserved.
@rem * Trademark of Four Js Development Tools Europe Ltd
@rem in the United States and elsewhere
@rem
@rem Four Js and its suppliers do not warrant or guarantee that these samples
@rem are accurate and suitable for your purposes. Their inclusion is purely for
@rem information purposes only.
@rem FOURJS_END_COPYRIGHT
@rem
fglrun CalculatorClient.42r
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,230 @@
#-------------------------------------------------------------------------------
# File: ws_calculator.inc
# GENERATED BY fglwsdl 202111081619
#-------------------------------------------------------------------------------
# THIS FILE WAS GENERATED. DO NOT MODIFY.
#-------------------------------------------------------------------------------
GLOBALS
#
# Global WebService error structure
# Check the contents of this structure for a detailed error description
# when a WebService function returns with a non-zero status.
#
DEFINE wsError RECORD
code STRING,
codeNS STRING,
description STRING,
action STRING
END RECORD
#
# List of Soap fault identifiers
#
CONSTANT FaultID_DividedByZero = 1
#
# Global Endpoint user-defined type definition
#
TYPE tGlobalEndpointType RECORD # End point
Address RECORD # Address
Uri STRING # URI
END RECORD,
Binding RECORD # Binding
Version STRING, # HTTP Version (1.0 or 1.1)
Cookie STRING, # Cookie to be set
Request RECORD # HTTP request
Headers DYNAMIC ARRAY OF RECORD # HTTP Headers
Name STRING,
Value STRING
END RECORD
END RECORD,
Response RECORD # HTTP response
Headers DYNAMIC ARRAY OF RECORD # HTTP Headers
Name STRING,
Value STRING
END RECORD
END RECORD,
ConnectionTimeout INTEGER,# Connection timeout
ReadWriteTimeout INTEGER,# Read write timeout
CompressRequest STRING # HTTP request compression mode (gzip or deflate)
END RECORD
END RECORD
#-------------------------------------------------------------------------------
# Service: Calculator
# Port: CalculatorPortType
# Server: http://localhost:8090
#-------------------------------------------------------------------------------
#
# Location of the SOAP endpoint.
# You can reassign this value at run-time.
#
DEFINE Calculator_CalculatorPortTypeEndpoint tGlobalEndpointType
#-------------------------------------------------------------------------------
# VARIABLE : DividedByZero
DEFINE DividedByZero STRING ATTRIBUTE(XMLName="DividedByZero",XMLNamespace="http://tempuri.org/")
#-------------------------------------------------------------------------------
#
# Operation: Add
#
# FUNCTION: Add_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Add
# OUTPUT: GLOBAL AddResponse
#
# FUNCTION: Add(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: AddRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Add
#
# FUNCTION: AddResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL AddResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Add
DEFINE Add RECORD ATTRIBUTE(XMLSequence,XMLName="Add",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : AddResponse
DEFINE AddResponse RECORD ATTRIBUTE(XMLSequence,XMLName="AddResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Subtract
#
# FUNCTION: Subtract_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Subtract
# OUTPUT: GLOBAL SubtractResponse
#
# FUNCTION: Subtract(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: SubtractRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Subtract
#
# FUNCTION: SubtractResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL SubtractResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Subtract
DEFINE Subtract RECORD ATTRIBUTE(XMLSequence,XMLName="Subtract",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : SubtractResponse
DEFINE SubtractResponse RECORD ATTRIBUTE(XMLSequence,XMLName="SubtractResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Multiply
#
# FUNCTION: Multiply_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Multiply
# OUTPUT: GLOBAL MultiplyResponse
#
# FUNCTION: Multiply(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: MultiplyRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Multiply
#
# FUNCTION: MultiplyResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL MultiplyResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Multiply
DEFINE Multiply RECORD ATTRIBUTE(XMLSequence,XMLName="Multiply",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : MultiplyResponse
DEFINE MultiplyResponse RECORD ATTRIBUTE(XMLSequence,XMLName="MultiplyResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Divide
# FAULT #1: GLOBALS DividedByZero
#
# FUNCTION: Divide_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Divide
# OUTPUT: GLOBAL DivideResponse
#
# FUNCTION: Divide(p_a, p_b)
# RETURNING: soapStatus ,p_quotient ,p_remainder
#
# FUNCTION: DivideRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Divide
#
# FUNCTION: DivideResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL DivideResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Divide
DEFINE Divide RECORD ATTRIBUTE(XMLSequence,XMLName="Divide",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : DivideResponse
DEFINE DivideResponse RECORD ATTRIBUTE(XMLSequence,XMLName="DivideResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
quotient INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
remainder INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
END GLOBALS
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,230 @@
#-------------------------------------------------------------------------------
# File: ws_calculatorSoap12.inc
# GENERATED BY fglwsdl 202111081619
#-------------------------------------------------------------------------------
# THIS FILE WAS GENERATED. DO NOT MODIFY.
#-------------------------------------------------------------------------------
GLOBALS
#
# Global WebService error structure
# Check the contents of this structure for a detailed error description
# when a WebService function returns with a non-zero status.
#
DEFINE wsError RECORD
code STRING,
codeNS STRING,
description STRING,
action STRING
END RECORD
#
# List of Soap fault identifiers
#
CONSTANT FaultID_DividedByZero = 1
#
# Global Endpoint user-defined type definition
#
TYPE tGlobalEndpointType RECORD # End point
Address RECORD # Address
Uri STRING # URI
END RECORD,
Binding RECORD # Binding
Version STRING, # HTTP Version (1.0 or 1.1)
Cookie STRING, # Cookie to be set
Request RECORD # HTTP request
Headers DYNAMIC ARRAY OF RECORD # HTTP Headers
Name STRING,
Value STRING
END RECORD
END RECORD,
Response RECORD # HTTP response
Headers DYNAMIC ARRAY OF RECORD # HTTP Headers
Name STRING,
Value STRING
END RECORD
END RECORD,
ConnectionTimeout INTEGER,# Connection timeout
ReadWriteTimeout INTEGER,# Read write timeout
CompressRequest STRING # HTTP request compression mode (gzip or deflate)
END RECORD
END RECORD
#-------------------------------------------------------------------------------
# Service: Calculator
# Port: CalculatorPortTypeSoap12
# Server: http://localhost:8090
#-------------------------------------------------------------------------------
#
# Location of the SOAP endpoint.
# You can reassign this value at run-time.
#
DEFINE Calculator_CalculatorPortTypeSoap12Endpoint tGlobalEndpointType
#-------------------------------------------------------------------------------
# VARIABLE : DividedByZero
DEFINE DividedByZero STRING ATTRIBUTE(XMLName="DividedByZero",XMLNamespace="http://tempuri.org/")
#-------------------------------------------------------------------------------
#
# Operation: Add
#
# FUNCTION: Add_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Add
# OUTPUT: GLOBAL AddResponse
#
# FUNCTION: Add(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: AddRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Add
#
# FUNCTION: AddResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL AddResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Add
DEFINE Add RECORD ATTRIBUTE(XMLSequence,XMLName="Add",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : AddResponse
DEFINE AddResponse RECORD ATTRIBUTE(XMLSequence,XMLName="AddResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Subtract
#
# FUNCTION: Subtract_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Subtract
# OUTPUT: GLOBAL SubtractResponse
#
# FUNCTION: Subtract(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: SubtractRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Subtract
#
# FUNCTION: SubtractResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL SubtractResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Subtract
DEFINE Subtract RECORD ATTRIBUTE(XMLSequence,XMLName="Subtract",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : SubtractResponse
DEFINE SubtractResponse RECORD ATTRIBUTE(XMLSequence,XMLName="SubtractResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Multiply
#
# FUNCTION: Multiply_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Multiply
# OUTPUT: GLOBAL MultiplyResponse
#
# FUNCTION: Multiply(p_a, p_b)
# RETURNING: soapStatus ,p_r
#
# FUNCTION: MultiplyRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Multiply
#
# FUNCTION: MultiplyResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL MultiplyResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Multiply
DEFINE Multiply RECORD ATTRIBUTE(XMLSequence,XMLName="Multiply",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : MultiplyResponse
DEFINE MultiplyResponse RECORD ATTRIBUTE(XMLSequence,XMLName="MultiplyResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
r INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
#
# Operation: Divide
# FAULT #1: GLOBALS DividedByZero
#
# FUNCTION: Divide_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Divide
# OUTPUT: GLOBAL DivideResponse
#
# FUNCTION: Divide(p_a, p_b)
# RETURNING: soapStatus ,p_quotient ,p_remainder
#
# FUNCTION: DivideRequest_g()
# RETURNING: soapStatus
# INPUT: GLOBAL Divide
#
# FUNCTION: DivideResponse_g()
# RETURNING: soapStatus
# OUTPUT: GLOBAL DivideResponse
#
#-------------------------------------------------------------------------------
# VARIABLE : Divide
DEFINE Divide RECORD ATTRIBUTE(XMLSequence,XMLName="Divide",XMLNamespace="http://tempuri.org/",XMLNillable)
a INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
b INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
#-------------------------------------------------------------------------------
# VARIABLE : DivideResponse
DEFINE DivideResponse RECORD ATTRIBUTE(XMLSequence,XMLName="DivideResponse",XMLNamespace="http://tempuri.org/",XMLNillable)
quotient INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable),
remainder INTEGER ATTRIBUTE(XMLNamespace="",XMLNillable)
END RECORD
END GLOBALS
File diff suppressed because one or more lines are too long
+55
View File
@@ -0,0 +1,55 @@
FOURJS_START_COPYRIGHT(U,2000)
Property of Four Js*
(c) Copyright Four Js 2000, 2021. All Rights Reserved.
* Trademark of Four Js Development Tools Europe Ltd
in the United States and elsewhere
Four Js and its suppliers do not warrant or guarantee that these samples
are accurate and suitable for your purposes. Their inclusion is purely for
information purposes only.
FOURJS_END_COPYRIGHT
SIMPLE CALCULATOR RPC Style Web service demonstration
NOTE: This service is WS-I compliant
For this Calculator RPC Literal Web service demonstration, the
client sends a value to the Web service server. The server
returns the same value.
The purpose of this service is to show the currently supported
datatypes.
==============
Prerequisites:
==============
Before starting, make sure that the environment variables
PATH, FGLDIR, and FGLSERVER are properly set. See the
Genero Business Development Language documentation for more
information on setting environment variables.
By default, these examples use the TCP port number 8090.
If the port number 8090 is used by another application on
your machine, choose another port number.
===============
How to execute:
===============
On Windows:
- Modify the server and client build.bat files to change the port
number (if required)
- Run first 'build.bat' and then 'run.bat' in the server directory
- In a second DOS session, run 'build.bat' and then 'run.bat' in
the client directory
On Unix:
- Modify the server and client makefile to change the port
number (if required)
- Execute 'make' and then 'make run' in the server directory
- In a new shell session, execute 'make' and then
'make run' in the client directory
NOTE: You can run as many clients as you wish for the same server.
+15
View File
@@ -0,0 +1,15 @@
@rem
@rem FOURJS_START_COPYRIGHT(U,2000)
@rem Property of Four Js*
@rem (c) Copyright Four Js 2000, 2017. All Rights Reserved.
@rem * Trademark of Four Js Development Tools Europe Ltd
@rem in the United States and elsewhere
@rem
@rem Four Js and its suppliers do not warrant or guarantee that these samples
@rem are accurate and suitable for your purposes. Their inclusion is purely for
@rem information purposes only.
@rem FOURJS_END_COPYRIGHT
@rem
SET FGLAPPSERVER=8090
fglrun CalculatorServer.42r
File diff suppressed because one or more lines are too long
+16
View File
@@ -0,0 +1,16 @@
@rem
@rem FOURJS_START_COPYRIGHT(U,2000)
@rem Property of Four Js*
@rem (c) Copyright Four Js 2000, 2021. All Rights Reserved.
@rem * Trademark of Four Js Development Tools Europe Ltd
@rem in the United States and elsewhere
@rem
@rem Four Js and its suppliers do not warrant or guarantee that these samples
@rem are accurate and suitable for your purposes. Their inclusion is purely for
@rem information purposes only.
@rem FOURJS_END_COPYRIGHT
@rem
fglcomp calculatorServer.4gl
fglform server.per
call fgllink -o CalculatorServer.42r calculatorServer.42m
@@ -0,0 +1,290 @@
#
# FOURJS_START_COPYRIGHT(U,2000)
# Property of Four Js*
# (c) Copyright Four Js 2000, 2021. All Rights Reserved.
# * Trademark of Four Js Development Tools Europe Ltd
# in the United States and elsewhere
#
# Four Js and its suppliers do not warrant or guarantee that these samples
# are accurate and suitable for your purposes. Their inclusion is purely for
# information purposes only.
# FOURJS_END_COPYRIGHT
#
IMPORT com
#
# USER GLOBALS VARIABLES
#
GLOBALS
DEFINE
add_in RECORD
a INTEGER,
b INTEGER
END RECORD,
add_out RECORD
r INTEGER
END RECORD
DEFINE
subtract_in RECORD
a INTEGER,
b INTEGER
END RECORD,
subtract_out RECORD
r INTEGER
END RECORD
DEFINE
multiply_in RECORD
a INTEGER,
b INTEGER
END RECORD,
multiply_out RECORD
r INTEGER
END RECORD
DEFINE
divide_in RECORD
a INTEGER,
b INTEGER
END RECORD,
divide_out RECORD
quotient INTEGER,
remainder INTEGER
END RECORD
DEFINE
divide_by_zero String ATTRIBUTES (XMLName="DividedByZero")
END GLOBALS
DEFINE serverURL STRING
DEFINE screen BOOLEAN
&define display_status(status) \
IF NOT screen THEN \
DISPLAY status \
ELSE \
DISPLAY status TO MSG \
MENU ON idle 1 EXIT MENU ON ACTION close EXIT PROGRAM END MENU \
END IF
#
# MAIN
#
MAIN
DEFINE ret INTEGER
DEFER INTERRUPT
LET screen = false
#
# Check arguments
#
IF num_args() = 2 and arg_val(1) = "-W" THEN
LET serverURL = arg_val(2)
CALL CreateCalculatorService(true)
EXIT PROGRAM
ELSE
IF num_args() = 2 and arg_val(1) = "-S" THEN
LET screen = true
CALL fgl_setenv("FGLAPPSERVER",arg_val(2))
CLOSE WINDOW SCREEN
OPEN WINDOW w WITH FORM "server" ATTRIBUTES(TEXT = "Calculator service", STYLE="naked")
display_status("Calculator service startup")
ELSE
IF num_args() <> 0 THEN
CALL exitHelp()
EXIT PROGRAM
END IF
END IF
END IF
#
# Create Calculator service
#
CALL CreateCalculatorService(false)
#
# Start the server
#
display_status("Starting server...")
#
# Starts the server on the port number specified by the FGLAPPSERVER environment variable
# (EX: FGLAPPSERVER=8090)
#
CALL com.WebServiceEngine.Start()
display_status("The server is listening.")
IF screen THEN
MENU
ON idle 1
LET ret = com.WebServiceEngine.ProcessServices(1)
CASE ret
WHEN 0
DISPLAY "Request processed." TO msg
WHEN -1
DISPLAY "No request..." TO msg
WHEN -2
DISPLAY "Disconnected from application server." TO msg
EXIT PROGRAM # The Application server has closed the connection
WHEN -3
DISPLAY "Client Connection lost." TO msg
WHEN -4
DISPLAY "Server interrupted with Ctrl-C." TO msg
WHEN -9
DISPLAY "Unsupported operation." TO msg
WHEN -10
DISPLAY "Internal server error." TO msg
OTHERWISE
DISPLAY "Unexpected server error " || status || "." TO msg
EXIT MENU
END CASE
ON ACTION close
EXIT program
END MENU
ELSE
WHILE TRUE
LET ret = com.WebServiceEngine.ProcessServices(-1)
CASE ret
WHEN 0
DISPLAY "Request processed."
WHEN -1
DISPLAY "Timeout reached."
WHEN -2
DISPLAY "Disconnected from application server."
EXIT PROGRAM # The Application server has closed the connection
WHEN -3
DISPLAY "Client Connection lost."
WHEN -4
DISPLAY "Server interrupted with Ctrl-C."
WHEN -9
DISPLAY "Unsupported operation."
WHEN -10
DISPLAY "Internal server error."
OTHERWISE
DISPLAY "Unexpected server error " || status || "."
EXIT WHILE
END CASE
IF int_flag<>0 THEN
LET int_flag=0
EXIT WHILE
END IF
END WHILE
DISPLAY "Server stopped"
END IF
END MAIN
#
# Create Calculator RPC/Literal service
#
FUNCTION CreateCalculatorService(generateWSDL)
DEFINE serv com.WebService # WebService
DEFINE op com.WebOperation # Operation of a WebService
DEFINE serviceNS STRING
DEFINE generateWSDL SMALLINT
DEFINE ret INTEGER
LET serviceNS = "http://tempuri.org/"
TRY
#
# Create Calculator Web Service
#
LET serv = com.WebService.CreateWebService("Calculator",serviceNS)
CALL serv.setFeature("Soap1.1",TRUE)
CALL serv.setFeature("Soap1.2",TRUE)
#
# Create a Soap Fault
#
CALL serv.createFault(divide_by_zero,FALSE)
#
# Publish the functions
#
# Add
LET op = com.WebOperation.CreateRPCStyle("add","Add",add_in,add_out)
CALL serv.publishOperation(op,NULL)
# Subtract
LET op = com.WebOperation.CreateRPCStyle("subtract","Subtract",subtract_in,subtract_out)
CALL serv.publishOperation(op,NULL)
# Multiply
LET op = com.WebOperation.CreateRPCStyle("multiply","Multiply",multiply_in,multiply_out)
CALL serv.publishOperation(op,NULL)
# Divide
LET op = com.WebOperation.CreateRPCStyle("divide","Divide",divide_in,divide_out)
CALL op.addFault(divide_by_zero, NULL)
CALL serv.publishOperation(op,NULL)
IF generateWSDL THEN
#
# Generate WSDL
#
LET ret = serv.saveWSDL(serverURL)
IF ret=0 THEN
DISPLAY "WSDL saved"
ELSE
DISPLAY "ERROR: Unable to save WSDL"
END IF
ELSE
#
# Register service
#
CALL com.WebServiceEngine.RegisterService(serv)
display_status("Calculator Service registered")
END IF
CATCH
display_status("Unable to create 'Calculator' Web Service :"||STATUS)
EXIT PROGRAM
END TRY
END FUNCTION
FUNCTION exitHelp()
DISPLAY "Usage: "
DISPLAY " ", arg_val(0)
DISPLAY " Start the server on port defined by FGLAPPSERVER"
DISPLAY " ", arg_val(0), " -W serverurl"
DISPLAY " Generate the WSDL file for the given url"
DISPLAY " ", arg_val(0), " -S port"
DISPLAY " Start service in graphical mode and on given port"
EXIT PROGRAM
END FUNCTION
#
# USER PUBLIC FUNCTIONS
#
FUNCTION add()
LET add_out.r = add_in.a + add_in.b
END FUNCTION
FUNCTION subtract()
LET subtract_out.r = subtract_in.a - subtract_in.b
END FUNCTION
FUNCTION multiply()
LET multiply_out.r = multiply_in.a * multiply_in.b
END FUNCTION
FUNCTION divide()
IF divide_in.b != 0 THEN
LET divide_out.quotient = divide_in.a / divide_in.b
LET divide_out.remainder = divide_in.a MOD divide_in.b
ELSE # Handle divided by zero
LET divide_by_zero = "Cannot divide "||divide_in.a||" by zero"
CALL com.WebServiceEngine.SetFaultDetail(divide_by_zero) # Throw error
END IF
END FUNCTION
+15
View File
@@ -0,0 +1,15 @@
@rem
@rem FOURJS_START_COPYRIGHT(U,2000)
@rem Property of Four Js*
@rem (c) Copyright Four Js 2000, 2021. All Rights Reserved.
@rem * Trademark of Four Js Development Tools Europe Ltd
@rem in the United States and elsewhere
@rem
@rem Four Js and its suppliers do not warrant or guarantee that these samples
@rem are accurate and suitable for your purposes. Their inclusion is purely for
@rem information purposes only.
@rem FOURJS_END_COPYRIGHT
@rem
SET FGLAPPSERVER=8090
fglrun CalculatorServer.42r
+36
View File
@@ -0,0 +1,36 @@
--
-- FOURJS_START_COPYRIGHT(U,2000)
-- Property of Four Js*
-- (c) Copyright Four Js 2000, 2021. All Rights Reserved.
-- * Trademark of Four Js Development Tools Europe Ltd
-- in the United States and elsewhere
--
-- Four Js and its suppliers do not warrant or guarantee that these samples
-- are accurate and suitable for your purposes. Their inclusion is purely for
-- information purposes only.
-- FOURJS_END_COPYRIGHT
--
SCHEMA FORMONLY
LAYOUT
GROUP ( TEXT = "Status")
GRID
{
[msg ]
[ ]
[ ]
}
END
END
END -- layout
ATTRIBUTES
TEXTEDIT msg=formonly.msg, NOENTRY, STRETCH=X,SCROLLBARS=NONE,TITLE="Message",COLOR=RED;
END