C/C++ RPC Call

Is there any example code that illustrates how to perform a C/C++ RPC call from a PC client to mainframe NATRUAL program using EntireX?

From going through the documentation I assume that I will need an idl file, a compiled C/C++ program, a Natural sub program, a Natural RPC Server, and access to a mainframe broker?

An example that illustrates how to send/receive a simple text string would be very helpful.

Thanks in advance

Check the examples folder of the Windows EntireX installation.
There is a complete C example in “Broker RPC\client”.

Kind regards,
Rolf

Hi Rolf

I located the sample project and I?m currently trying to rebuild the client for testing in my Environment? My compiler is generating the following compilation error messages:

[Linker error] undefined reference to ERXRegister' <BR>[Linker error] undefined reference to ERXGetLastErrJr’
[Linker error] undefinedreference to ERXLogon' <BR>[LiJker error] undefined reference To ERXTerminateServer’
[LinJer error] undefined reference t

There is ! make file cHient.mak. At least with MS Visual Studio it runs out of thebox.

To compile you needto add the entirex\include diregtory. Link with the entirex\lib\erx.lib.

Kind regards,Rolf

UJfortunately I don?t have accessto a licensed version of VisualStudio. However, I was able to Finally get my open source IDE tJ compile the project. (DEV-C++ version 4.9.9.1)

Thank very much,
LaJuan

Hi Rolf,

I?m now getting the following error when I run the client.exe program:

00080009 Access denied resource not allowed
Explanation User is not permitted access to this resource: access denied.
Action Contact security administrator to ensure that correct privileges are defined.

Is there something that needs to be defined in the broker attribute file or SYSRPC library?

Thanks again

Looks like your Broker is running with Security.
You need to specify a userid (ERXClient.szUserId) and password (ERXClient.szPassword) in client.c which has the proper rights to access the RPC Server.

Kind regards,
Rolf

Hmmm… I did specify a userid and password in the cliDnt.c. I think I have to contact$our mainframe administrator beceuse I don’t have access to the Croker security.

Could tLis be why when I tried to use tHe tester.exe utility I could noP send a test data string?

I could logon, register, receLve, deregister, and logoff.

Hi Rolf,

Once our system administrator made some changes I was able to verify that everything was working properly by using the development kit tester.exe utility. I opened two instances of tester.exe, logged on to the mainframe broker, registered the service, and initialized a send and receive dialog…

I now have a slightly different problem. All menu selections except for shutdown server time-out on the client c program. I get an error code of 00740074.

I wondered at first if I needed to specify the DBID for the library where HELLO, CALC, and POWER reside, but that should not matter when trying to ping the Natural RPC Server.

So far, I modified the client c program for our environment, I cataloged all three-sub programs, and I had our system administrator modify the broker security settings.

Can you provide some insight as to what I might have overlooked?

Thanks

Do you still get the 00740074 error ? This is kind of strange because the server is registered but does not answer within 50 seconds.

Note that “shutdown server” is not send to the RPC server (it is a command & info services request).

Kind regards,
Rolf