Kbase P113461: Is it possible to use the 10.1A Open Client .NET OpenAPI to directly access a 10.0B AppServer
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  27/11/2007 |
|
Status: Unverified
GOAL:
Is it possible to use the 10.1A Open Client .NET OpenAPI to directly access a 10.0B AppServer
GOAL:
Can a 10.1A .NET Open Client connect to a 10.0B AppServer using the 10.1A .NET OpenAPI
FACT(s) (Environment):
OpenEdge 10.x
FIX:
Yes, a .NET client can connect to a 10.0B AppServer using the 10.1A Open Client .NET OpenAPI.
Here after is a sample code:
Progress 4GL code:
/*--------------------------------------------------------------------
File : AddCustomer.p
Purpose : Adds a new customer record to the database
Syntax : AddCustomer(INPUT name, INPUT phone, INPUT email,
OUTPUT custnumber)
------------------------------------------------------------------*/
DEFINE INPUT PARAMETER NAME AS CHARACTER.
DEFINE INPUT PARAMETER phone AS CHARACTER.
DEFINE INPUT PARAMETER email AS CHARACTER.
DEFINE OUTPUT PARAMETER CustomerNumber AS INTEGER.
CREATE Customer.
ASSIGN
Customer.NAME = NAME
Customer.Phone = phone
Customer.emailaddress = email.
CustomerNumber = Customer.CustNum.
C# code:
using Progress.Open4GL;
using Progress.Open4GL.Proxy;
Connection con = new Connection("AppServer://HostName:5162/asbroker1","","","");
con.SessionModel = 1; // Session Free AppServer
OpenAppObject ao= new OpenAppObject(con,"mySvc");
ParamArray parms = new ParamArray(4);
parms.AddCharacter(0,"Progress Software",ParamArrayMode.INPUT );
parms.AddCharacter(1,"123456789",ParamArrayMode.INPUT);
parms.AddCharacter(2,"support@progress.com",ParamArrayMode.INPUT);
parms.AddInteger(3,null,ParamArrayMode.OUTPUT);
ao.RunProc("AddCustomer.p",parms);
// Display the Customer number of the new Customer created
MessageBox.Show(parms.GetOutputParameter(3).ToString());
ao.Dispose();