Progress AppServer Setup
Configuring the AppServer
For details on configuring the AppServer see Configuring the AppServer.Defining the Service Interface Code
To call the Query Service using the Progress appserver, you must define the Service Interface code in the PROPATH, as shown here:Example:
/* Query Service AppServer Connection Example */
define variable hResponse as handle no-undo.
define variable hServer as handle no-undo.
define variable lConnected as logical no-undo.
{com/qad/qxtend/qxo/dsQueryServiceRequest.i}
{dscontxt.i}
{dsexcptn.i}
{com/qad/qra/si/dsNull.i}
create server hServer.
lConnected = hServer:connect("-AppService qxosi_AS -H nately -S 5162","","").
if not lConnected then do:
message "Error connecting to AppServer" view-as alert-box.
return.
end.
run createContext(input "QAD",
input "programName",
input "com/qad/qxtend/si/QueryService.p").
run createContext(input "QAD",
input "domain",
input "QP").
run createContext(input "QAD",
input "methodName",
input "querySourceApplication").
create QueryServiceRequest.
assign
QueryServiceRequest.SourceApplication = "qad2007"
QueryServiceRequest.Profile = "Customer"
QueryServiceRequest.Filter = "cm_addr >= '0100' and cm_addr <= '100'"
QueryServiceRequest.MaxRows = 2.
run com/qad/qra/si/RPCRequestService.p on server hServer
(input-output dataset dsSessionContext,
output dataset dsExceptions,
input dataset dsQueryServiceRequest by-reference,
input-output dataset dsNullInOut,
output dataset-handle hResponse).
if can-find(first temp_err_msg) then do:
for each temp_err_msg:
message temp_err_msg.tt_msg_desc view-as alert-box.
end.
end.
else do:
hResponse:write-xml("file","qs.xml",true).
end.
hServer:disconnect().
delete object hServer.
procedure createContext:
define input parameter propQual as character no-undo.
define input parameter propName as character no-undo.
define input parameter propVal as character no-undo.
create ttContext.
assign ttContext.propertyQualifier = propQual
ttContext.propertyName = propName
ttContext.propertyValue = propVal.
end procedure.
The system populates the Context temporary table with the values required for the Service Interface.