473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to access the sequence in Client file of Corba?

Expand|Select|Wrap|Line Numbers
  1.  
  2. IDL FILE
  3. module DirApp
  4. {
  5. typedef sequence<string> CompName;
  6. typedef sequence<string> CompNumber;
  7. typedef sequence<string> CompDetails;
  8. typedef sequence<string> rate;
  9.  
  10. interface DirInterface{
  11. string getContact(in string name1,in CompName conam,in CompNumber conumb);
  12.  
  13. string getDetails(in string name2,in CompName conam,in CompNumber conumb,in CompDetails cod,in rate r);
  14.  
  15. void Rate(in rate r);
  16.  
  17.     oneway void shutdown();
  18. };
  19. };
  20.  
  21.  
  22. CLIENT FILE
  23. public class DirClient 
  24. {
  25.   static DirInterface DirImpl;
  26.   static int flag=1;
  27.   static int k=0;
  28.  
  29.   public static void main(String args[])
  30.    {
  31.  
  32.  
  33.  
  34.  
  35. CompName conam;
  36. conam.length(5);
  37.  
  38.     try{
  39.                  System.out.println("\n----------------------------------------------");
  40. System.out.println("DirClient: Looking up DirServer...");
  41.  
  42.                 // create and initialize the ORB
  43.                 ORB orb = ORB.init(args, null);
  44.  
  45.                 // get the root naming context
  46.                 org.omg.CORBA.Object objRef = 
  47.                 orb.resolve_initial_references("NameService");
  48.  
  49.                 // Use NamingContextExt instead of NamingContext. 
  50.                 // This is part of the Interoperable naming Service.  
  51.                 NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
  52.  
  53.                 // resolve the Object Reference in Naming
  54.                 String name = "DirOperations";
  55.                 DirImpl = DirInterfaceHelper.narrow(ncRef.resolve_str(name));
  56.  
  57. System.out.print("DirClient: Obtained a handle on server object: \n\n");
  58. System.out.println(DirImpl);
  59.  
  60.                 Scanner sc=new Scanner(System.in);
  61.  
  62.                 flag=1;
  63.  
  64.                 do
  65.                 {
  66.  
  67.  
  68. System.out.println("1.add details and rate 2. get details 3.Get phone number  0.exit");
  69.     int ch=sc.nextInt();
  70.  
  71.     switch(ch){
  72. case 1:
  73. System.out.println("Input  company name to add");
  74. conam[k]=sc.nextLine();
  75.  
  76. System.out.println("Input  company details");
  77. cod[k]=sc.nextLine();
  78.  
  79. System.out.println("input contact number of company");
  80. conumb[k]=sc.next();
  81.  
  82. k++;
  83.  
  84.    break;
  85.  
  86.  
  87. case 2:
  88.  
  89.     System.out.println("Input company name to get its details");
  90. String name2=sc.next();
  91.  
  92. String det=DirImp1.getDetails(name2,conam,conumb,cod,r);
  93.     System.out.println(det);
  94.     break;
  95.  
  96.  
  97.  
  98. case 3:
  99.     System.out.println("Enter name of the company to get contact number");
  100. String name1=sc.next();
  101.  
  102.     String xx=DirImp1.getContact(name1,conam,conumb);
  103.     System.out.println(xx);break;
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  case 0:System.exit(0);
  110.  
  111.  
  112.     }
  113.  
  114.           }while (ch!=0);
  115.  
  116.  
  117.  DirImpl.shutdown();
  118.          }
  119.             catch (Exception e) 
  120.             {   
  121.                  //System.err.println("ERROR: " + e);   
  122.                  //e.printStackTrace(System.out);   
  123.                  System.out.println("\n----------------------------------------------");
  124. System.out.println("DirClient: Some Error Has Occurred !");
  125.                  System.out.println("\n----------------------------------------------");
  126.             }
  127.  
  128. System.out.println("\n DirServer: Exiting...");
  129. System.out.println("\n----------------------------------------------");
  130.         }
  131. }
  132.  
Why won't the client file compile when i try to access the typedef that i created in idl file?
what changes should I make in syntax


Error:
expected';'
cannot find symbol connam
Feb 13 '15 #1
0 1227

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: k j | last post by:
Hello Is it or how is it possible to access fx. a local file or Access database on a client computers from a browser? Regards Karina
3
by: RC | last post by:
Is it possible to response file from an aspx page to a particular path of client PC without any prompt dialog? Thanks
4
by: ABC | last post by:
I don't how to handle the case as: There is a webgrid which lists a table. When user select a row (not immediate call back to server), then Click a button to call a server request. I know the...
1
by: Evan Kontos | last post by:
I have the need to test for the value of a client variable from a server control in a VB Web form. How can I do this in VB. Net? Evan Kontos | EKontos@comtekcadd.com 27 Whitehall St. | ...
1
by: RashmiKulki | last post by:
hi all, please let me know how access a .aspx file from a remote system,when the client system does not have .NET framework & at the server side the website is running on the ASP.NET web...
3
by: Jiro Hidaka | last post by:
Hello my manager has a question in regards to being able to give access to a file to a computer only. This file will be either sent to or downloaded from the client computer. For example we are a...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I access the client-side filesystem?...
1
by: Corey | last post by:
Hello everyone. The company I’m working for is looking to convert my MS database into a Oracle database. Can anyone tell me the advantages and disadvantages of a Oracle back-end with a MS-Access...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How can I access the client-side filesystem?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.