Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Delphi 4 and CORBA..

We have a CORBA server object written in PERL. The IDL has been generated using IDL2PAS.  That is a whole other story.  I can't even connect to the CORBA server.  I am using the TCorbaConnect object.  I put the hostname and repositoryid and switch connected to TRUE and it says "NO_IMPLEMENT"  What am I missing?  The guys who wrote it conenct to it with no trouble from PERL.  They pass all kinds of other variables such as ORBServices=CosNaming and SVCnameroot=CorbaJava.  What am I doing wrong?  The object exists.  Why can't I connect to it.  I am not trying to do anything else.

I need a full explanation as well as source code.

Thank you..
0
lorenkoss
Asked:
lorenkoss
  • 3
  • 2
1 Solution
 
EpsylonCommented:
Are the ObjectName and RepositoryID Correct?
Can you connect to the Corba server? Try to ping the ip address.
Run Visibroker's Smart Agent and Smart Finder to look for Corba Objects on the network. If the wanted object is listed, check the NAME and IDL. You should now be able to connect to it.
0
 
lorenkossAuthor Commented:
Epsylon,
Thanks, I didn't know about those apps.. I don't know what smart agent does, but smart finder did find the corba server and listed the objects. I now typed it in the TCorbaConnection object and it now says "BAD_OPERATION" instead of "NO_IMPLEMENT" which is what it was saying yesterday.

What am I doing wrong?
0
 
EpsylonCommented:
If you are writing a client for a CORBA server that was not written using Delphi, you must write your own descendant of TCorbaStub to provide marshaling support for your client. You must then register this stub class with the global CORBAStubManager. Finally, to instantiate the stub class and get the server interface, you can call the global BindStub procedure to obtain an interface which you then pass to the CORBA stub manager’s CreateStub method.
0
 
lorenkossAuthor Commented:
Thanks, I still am having trouble.  I have 3 files created using the IDL2PAS program by Kevin Smith.  The CORBA objects are TickerServer and Ticker.  IDL2PAS created a ITickerServerStub object, ITickerStub, TTickerServer, and TTicker objects..  I tried TTickerServer.Create, but that requires some variables.  I also read about CreateStub, but am still confused.  For all your help, I'm adding 10 more points (sorry, its all I have)..
0
 
EpsylonCommented:
You can use Dii. You don't have to use stubs this way.
First the server interface must be registered with an Interface Repository. You have already done this.
In the client app, obtain the server interface and assign it to a TAny vaiable:

var
  IntToCall: TAny;
begin
  IntToCall := CorbaBind('IDL:MyServer/MyServerObject:1.0');
  ...

Then you can call the interface's methods. This example is copied from the Delphi help files:

var

  HR, Emp, Payroll, Salary: TAny;
begin
  HR := CorbaBind('IDL:CompanyInfo/HR:1.0');
  Emp := HR.LookupEmployee(Edit1.Text);
  Payroll := CorbaBind('IDL:CompanyInfo/Payroll:1.0');
  Salary := Payroll.GetEmployeeSalary(Emp);
  Payroll.SetEmployeeSalary(Emp, Salary + (Salary * StrToInt(Edit2.Text) / 100));
end;



0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now