dear all,
I am trying to connect to a CORBA server using java.
The IDL file is
***********************IDL
FILE**********************
**********
*******
module SA
{
struct outLSMSResp
{
string TN;
string LRN;
string LSMS_STATUS;
string SERVICE_PROVIDER_ID;
string ACTIVATION_DATE;
string PORT_TYPE;
string OLD_NPA;
string NPAC_ID;
string DOWNLOAD_REASON;
string POOL_INDICATOR;
string DONOR_SPID;
string POOL_ALLOCATION_SPID;
string POOL_ACTIVATION_TIME;
string POOL_LRN;
};
struct inTNQuery
{
string USERID;
string SYSTEM_NAME;
string TN;
};
struct NameValuePair
{
string name;
string value;
};
typedef outLSMSResp LSMSResp;
typedef inTNQuery TNQuery;
typedef sequence<NameValuePair> GenericParam;
interface LSMS
{
long getLSMSData(in TNQuery TNInfo, out LSMSResp LSMSInfo);
long SyncServiceRequest(in GenericParam Request,
out GenericParam Response);
};
};
**************************
**********
**********
**********
****
client java file is
**********************JAVA
CLIENT FILE**********************
**********
*********
//This will import the files you generated from the IDL.
import SA.*;
//Import the Java classes for file I/O.
import java.io.*;
public class ClientSA {
public static void main(String[] args) {
//A variable to hold the IOR in.
String ior = null;
//First, we need to read in the IOR from a file (this is probably the
//hardest part of the program!!). Reading in ANY file in Java is
//ALWAYS a bitch...
try {
//Open the file for reading:
BufferedReader reader =
new BufferedReader(new FileReader("ns.ior"));
//Read the first line which is the IOR and save it to the 'ior' variable.
//variable:
ior = reader.readLine();
//Be nice and close the file:
reader.close();
//We need to create our own ORB that will then connect to the CORBA
//server at the EBI:
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(arg
s, null);
//Use the IOR to connect to the EBI CORBA server and return a CORBA
//object:
org.omg.CORBA.Object object = orb.string_to_object(ior);
//Convert this CORBA object to the SecretMessage object that it actually is on the
//CORBA server at the EBI:
LSMS bioSequenceServer = LSMSHelper.narrow(object);
} catch (Exception ex) {
//There was a problem with reading the file - Bomb out.
ex.printStackTrace();
System.exit(0);
}
}
}
//End of program
**********************JAVA
CLIENT FILE**********************
**********
*********
I am getting the following error when i run the client
org.omg.CORBA.BAD_PARAM: vmcid: 0x0 minor code: 0 completed: No
at SA.LSMSHelper.narrow(LSMSH
elper.java
:60)
at ClientSA.main(ClientSA.jav
a:38)
has anybody come across this . i Googled but didnt get much info.
thanks in advance
Kiran
Start Free Trial