Return a user defined string to the client from the application server connection procedure
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Return a user defined string to the client from the application server connection procedure
When you establish a connection to the application server with the .NET Open Client, you instantiate an AppObject using one of the four constructors provided by ProxyGen. If the connection to the application server fails, the AppObject constructor throws a standard exception. This exception can also contain a user defined string, if you set up your application server to do so.
The Connection object communicates with a
remote ABL procedure stored on the application server known as the connection procedure. If that procedure contains the ABL RETURNstring statement, then that string will be
contained in the connection failure exception.
If the connection is successful, and the connection procedure
has a RETURNstring statement,
you can access the string using the existing AppObject public property ProcReturnString.
If the connect procedure does not return a value, then the ProcReturnString property will
be null.
The following sample .NET Open Client code illustrates this functionality:
|
If the connection is successful and the connect procedure returns a string, then the string value is displayed by the first message box. If the connect procedure failed and returns a string, then the string value is displayed by the second message box.