By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

how can i call my method the web service

P: 132

i want to test my service web i write this class to call my method appel:
Expand|Select|Wrap|Line Numbers
  1. import  projetd.MagasinServicesStub.ListeMagasinProcheDeResponse;
  2. import java.rmi.RemoteException;
  3. public class ServiceTest {
  4.         public static void main(String[] args) {
  5.         // TODO Auto-generated method stub
  6. MagasinServicesStub stub=new MagasinServicesStub();
  7. ListeMagasinProcheDeResponse res=stub.ListeMagasinProcheDe(49.894593,2.298256);
  8. System.out.println("Counter: "+res.get_return());
  9.     }
  11. }
but he signe error :Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method ListeMagasinProcheDe(MagasinServicesStub.ListeMaga sinProcheDe) in the type MagasinServicesStub is not applicable for the arguments (double, double)

at projetd.ServiceTest.main(
why i test with eclipse

Nov 26 '09 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 785
in an old post a week ago you defined "public static String getMagasinProche(double lat,double lon)"
and then somehow it seems you changed it to "public static String ListeMagasinProcheDe(double lat,double lon)" according to the last listing inside the same post. This is bad naming and worse than before, the method should start with "l" (lowercase "L" of "(L)iste"). Class names start with capital letters, but not method names! Just stick to the coding standards and most errors go away.

Anyway, the compiler complains that you pass two double numbers into the method, but the method defined doesn't support them, which is strange because you defined them correctly. There should be no error. The only way this error is caused I can think of are 3 ways:
1.) You did not compile your source code after the change
2.) you did not save it after the change, so the name reverted back to the old one.
3.) You changed this method again and deleted or replaced the "double lat,double lon" arguments.
So just double-check your method, or better, post it here again.

By the way, still using French names in your program everywhere? You did not take my advice I gave before in the old post, to use English only? Well, it took me a long time to explain to you why you should. If you don't want to take the advice, then you should not be surprised that nobody answers your questions.
Even repeatingly posting "please answer my question" would not help. If you want more people answer your questions, then just describe the problem more precisely and make it easier for others to understand the code! (Sorry for being so rude, but it's the truth. I just want to prevent you from learning it the hard way later on). In all companies I worked for the Quality-Assurance team would never accept source code written in French or Chinese or Arabic or whatever other language. If you just develop source code for yourself for learning purposes, that means source code that will never go to production and will never be seen by other programmers, it's ok to use only French and make no comments inside. Otherwise not.
Dec 2 '09 #2

Post your reply

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