how can i call my method the web service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjava
    New Member
    • Sep 2009
    • 132

    how can i call my method the web service

    hello,

    i want to test my service web i write this class to call my method appel:
    Code:
    import  projetd.MagasinServicesStub.ListeMagasinProcheDeResponse;
    import java.rmi.RemoteException;
    public class ServiceTest {
    		public static void main(String[] args) {
    		// TODO Auto-generated method stub
    MagasinServicesStub stub=new MagasinServicesStub();
    ListeMagasinProcheDeResponse res=stub.ListeMagasinProcheDe(49.894593,2.298256);
    System.out.println("Counter: "+res.get_return());
    	}
    
    }
    but he signe error :Exception in thread "main" java.lang.Error : Unresolved compilation problem:
    The method ListeMagasinPro cheDe(MagasinSe rvicesStub.List eMagasinProcheD e) in the type MagasinServices Stub is not applicable for the arguments (double, double)

    at projetd.Service Test.main(Servi ceTest.java:8)
    why i test with eclipse

    thanks
  • chaarmann
    Recognized Expert Contributor
    • Nov 2007
    • 785

    #2
    in an old post a week ago you defined "public static String getMagasinProch e(double lat,double lon)"
    and then somehow it seems you changed it to "public static String ListeMagasinPro cheDe(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.

    Comment

    Working...