Which method to call

I have a web service that I created.
In order to create webservice client, I used WSDL2JAVA utility - which in turn created the following classes -
ListServiceSoapBindingStub.java
ListServiceLocator.java
ListServiceService.java
ListService.java (originally created by me)
What class/method do I call now to test if it works.
I do not see the main method anywhere.
Please suggest.

You don't have any main method because these classes are thought to be used as interfaces to the Web Service. You have to create your own test class like (I guess):
public class Tester {
  public static void main(String [] args) throws Exception {
    // Make a service
    ListServiceService service = new ListServiceLocator();
    // Now use the service to get a stub which implements the SDI.
    ListService port = service.getListService();
    // Make the actual call
   port.callYourMethod(....)
}What method to call depends on what operations the service exports and which one you want to test!
Perhaps if you give us more information (WSDL for instance) we can help you more...
Look here: http://ws.apache.org/axis/java/user-guide.html#WSDL2JavaBuildingStubsSkeletonsAndDataTypesFromWSDL
Cheers.

Similar Messages

  • How come property attribute of jsp:getProperty  knows which method to call

    Hello friends,
    I could not understand How come property attribute of <jsp:getProperty knows which method to call
    <jsp:useBean id="test" class="BeanTest.testing" scope="page" />
    <jsp:getProperty name="test" property="name" />
    there is no method "name" in testing.class file
    if u see the existing examples "date" given in TOMCAT , it is using many <jsp:getProperty tag, but the property name is not equal to the method method name in the Bean file
    thanks,

    First do you know what a
    bean property sheet is?
    If not say so.
    Second, to your question
    The Java Runtime Environment (JRE) uses introspection to identify the appropriate get() or set() methods of that bean. What is introspection?
    Introspection is a process that allows the class to expose its accessable variables and methods and allows other classes to see what they can do with that class when requested. Eg:
    public class MyBean{
    private String someValue = null;
    public MyBean(){
    someValue = "Some String Value";
    //Introspection will reveal this method
    public String getSomeValue(){
    return someValue;
    } and
    <jsp:getProperty name="...." property="someValue" />
    will call the getSomeValue() method

  • Determining which method to call from an array of Objects

    Hi All,
    Lets suppose I have an interface, a string method name, and an array of Objects indicating the parameters which should be passed to the method.
    What Im trying to work out is a way to quickly determine which method should be invoked.
    I can see that Class has getDeclaredMethod(String, Class[]), but that wont help me as I dont know the formal class types (the method may take X, but I might get passed Y which extends X in the array of objects).
    Does anyone know of a quick way I can determine this?
    All I can think of at the moment is going thru each method of the class one by one, and seeing if the arg is assignable, then, after getting all my matched methods, determining if there are any more 'specific' matches.
    Any ideas?
    Much appreciated,
    Dave

    you might want to take a look at the dynamic proxy apiCheers for the suggestion, but Im actually already using the dynamic proxy API.
    What I have is a MockObjectValidator which allows mock objects to be configuered with expected calls, exceptions to throw etc etc.
    I thought developers on my project would get tired using an interface like this:
    myValidator.setExpectedCall("someMethod", new Class[] { typeA, typeB }, new Object[] { valueA, valueB} );
    I.e, I wanted to cut out having to pass the class array, so they could just use:
    myValidator.setExpectedCall("someMethod", new Object[] { valueA, valueB} );
    The problem there is that I then need to pick the best Method from the class given the object arguments.
    When the mock object is in use, its no problem as the InvocationHandler interface provides the Method. The problem I have is selecting what method a user is talking about from an array of Objects.
    Ive written a simple one now, it just does primitive type class -> wrapper substitution, and then finds ** A ** match. If there is more than one match (ie, all params are assignable to a class' method params), I dont let that method be used.
    Shortly I'll update it to actually make the correct selection in those cases.
    cheers
    Dave

  • Which method cals insertString()

    Hey I'm trying to understand this code and I just want to know which method is calling insertString() ? There's something in the background doing it but i don't know what it is. I'm using Eclipse, so if there's an easy way to find out this information please let me know :)
    http://www.codeguru.com/java/articles/444.shtml
    Thanks

    In Eclipse, which I don't use very much, there is a context-sensitive menu (right-click) that allows you to look at various aspects of a members (classes, variables, methods). In the source file editor, move the insertion point in the code to be in your method name. Right click, and select References. It should search for, and find, every class/method that calls your method. There can be more than one. Sometimes, there are too many to examine. Good luck.
    {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Session method and call transaction methos which one is the sap recomonded

    hi
    PLease give me the answer to these questions.
    session method and call transaction methos which one is the sap recomonded why .
    2) if we want to maintain BDC program in all the systems.wt to d0

    Hi Revethi,
    Here is the difference between the Session and Call Transaction method.
         Session
    Session method supports both small amount of data aswell as large amount of data
    2) data processing is asynchronus and data updation is synchronus.
    3) it process multiple apllication while perfomaning validations.
    4) in session method data will be updated in data base only after processing session only.
    5) system provide by default logfile for handling error records.
    6) it supports both foreground aswell as background process
    in bdc we use FM ... bdc_open_group " for creating Session
    bdc_insert " adding transaction and bdcdata table for updating database
    bdc_close_group " for closing Session
          Call Transaction
    Call transaction exclusively for small amout of data
    2) it supports only one apllication while perfoming validations
    3) there is no default logfile, We can explicitly provide logic for creating logfile for handling error records.
    we can create logfile by using structure....BDCMSGCOLL
    4) it doesn't support background processing.
    5) data processing is synchronous and Data updation is Synchronous( default), in
    this method also supports daya updation in asynchronus process also.
    Syntax:
    Call transaction <transaction-name> using BDCDATA
    mode <A/N/E> update <L/A/S>
    messages into BDCMSGCOLL.

  • How to find out which class/method is calling System.gc

    Hi
    I am seeing frequent FULL GC and not able to locate which particular class/method is calling the System.gc(). I have disabled it using -XX:DisableExplicitGC and performance issues have been resolved. Also, I noticed that it does not happen periodically, so it is not RMI GC. How to find out who exactly is doing this? Does any of of the profilers like Optimizeit/Jprobe help find out this.
    Thanks

    Hi
    I am seeing frequent FULL GC This is because you are creating and destroying objects VERY frequently. Try to look at your design and see where you can reuse objects (i.e. object pooling) if possible, that is if this is adversely affecting performance.
    and not able to locate
    which particular class/method is calling the
    System.gc(). Classes don't call GC. The VM handles that automagically.
    I have disabled it using
    -XX:DisableExplicitGC and performance issues have
    been resolved. Also, I noticed that it does not
    happen periodically, so it is not RMI GC. How to find
    out who exactly is doing this? Does any of of the
    profilers like Optimizeit/Jprobe help find out this.OptimizeIt will tell you everything you need to know. However, NetBeans offers a free profiler now!

  • Find out which is the calling method at runtime

    Hello.
    I have to write a very simple, custom logger. Don't tell me to use logging API, since I can not, unfortunately :-(
    In order to log informations I use a class calles FileLogger, which has some methods, like warn(String message), info(String message) which use a private method
    void write(String message, int logLevel){
    what I'd like to do is to make the method write(String message, int logLevel) log non only the message and the log level, but also the class and the method from which it was called.
    How can I do?
    Thanks

    There is a way to do it - if you only want it when an error occurs, it's fairly easy - and PIFFLE on performance - it only occurs when there's an error (which should be rare!) for pete's sake!
    Make it even better and have an if checking a public static final boolean in your error class and you get ZERO overhead if you have logging off - of course you have to change the kode.
    -G
    import java.io.*;
    import java.util.*;
    public class A
    public static String caller()
    ByteArrayOutputStream bs = new ByteArrayOutputStream();
    PrintWriter pw = null;
    try
    throw new Exception("Exc");
    catch (Exception e)
    e.printStackTrace(new PrintWriter(bs, true));
    StringTokenizer st = new StringTokenizer(bs.toString(),"\r\n");
    st.nextToken();
    st.nextToken();
    st.nextToken();
    if (!st.hasMoreElements())
    return "None";
    String theString = st.nextToken();
    theString = theString.substring(theString.indexOf(' ')+1);
    return theString;
    public static void doSomething()
    System.out.println("Caller is "+caller());
    public static void main(String[] args) throws Exception
    doSomething();
    System.out.println("Caller is "+caller());
    }

  • Display which method called the method (gives you a headache doesn't it)

    Hi,
    This question might sound a little weird, so maybe read it twice:
    I would like to see which method called the method.
    public void test1()
       test2();
    public void test2()
       System.out.println(....);
    The program output should be, test1 or classname.test1 or something like that. Is that possible?
    Thanx in advance, Yvo van Beek

    This should give you an idea:   public static void main (String args[]) {
          wereAreWe();
          caller2();
        public static void wereAreWe() {
          try {
            throw new RuntimeException("here we are");
          catch (Exception ex) {
            System.out.println("");       
            ex.printStackTrace(System.out);
        public static void caller1() {
          wereAreWe();
        public static void caller2() {
          caller1();
        }You can parse the result of printStackTrace() to get a more precise output.

  • Which method will be called, when invoking home.create() ?

    Hi,
    In a Stateless session Bean, I want initialize some variables, whenever a bean is created or retrieved from the pool. So I used the ejbCreate() method to initialize the variables, but it is called only first time when I call the home.create(). If I call the home.create() method next time it doesn't call the ejbCreate().
    Which method will be called, whenever I call home.create();.

    hi siva,
    first of all Ejbcontainers maintain a pool of stateless sessionbeans .when you call home.create() the ejbCreate () method is definitely called and you said you are initializing some variable and may be you are trying to retrive that value after home.create() method.. when you try to retrive the value thee value may be same as you have initialized or different depending upon the no of stateless session beans in the container. you have created a bean and there is no guarantee that the same bean will be called when you invoke retrieval method..
    i hope you understood.
    cheers

  • Which method should use? Call Transaction or Session Method?

    I need to upload 1,00,000 records then which method i need to use? Either session or call transaction?

    Hi.....
    A (asynchronous updating) The called transaction does not wait until the database has been
    updated, it simply forward the updates to the SAP update service. This usually speeds up the CT
    program. This processing mode is NOT recommended for large data sets as the called transaction
    does not receive a completion message from the update module.
    The calling CT program therefore cannot tell if the transaction has been successfully completed. You
    should use the updating administration function (transaction SM13) to determine whether updating
    was terminated early. The error analysis /correction functions for are less helpful than with
    synchronous updating.
    S (synchronous updating) With synchronous updating the called transaction waits until all the
    updates have been completed. So processing is slower than with synchronous updating. The called
    transaction can however report any updating errors to the program, which makes error
    analysis/correction easier.
    And
    Unlike the classical batch input processing with sessions CALL TRANSACTION does not offer any
    special processing procedures for transactions containing errors. There are no restart functions for
    transactions that contain errors or that cause updating terminations.
    Now you decide which one is best...
    For large amount of data Sessions method is the better.
    Thanks,
    Naveen.I

  • Which method is going to be called

    hi,
    In case we have a subclass over riding a method. Once we instantiate the superclass and call the method which method is going to be called?
    e.g
    class C2
         private int i = 2;
         public void meth1(){
              System.out.println("super class static method");
    class C22 extends C2{
         public void meth1(){
         super.meth1();
         System.out.println("sub class static method");
    public class C3 extends C2
    public static void main(String [] arg){     
         C2 c3 = new C2();     
         c3.meth1();
    It appears that the C2's method is being called but once overridden shouldnt C22's method be called?

    Yes, if you call the method on an object that is an instance of the C22 class, as in:
    C2 c3 = new C22();
    c3.meth1();Note the "new C22" instead of "new C2".

  • To print which class is calling a method??

    Hello people
    Is there any way it could be known which class is calling a particular method from the method itself?
    Thanks

    Try this:
    * @author Malcolm McMahon
    * @version $Revision: $
    public class TestTrace {
        static {
            printCall();
        private static void c() {
            printCall();
        private static void printCall() {
            String name = Thread.currentThread().getStackTrace()[3].getMethodName();
            System.out.println("Call: " + name);
        public static void main(String[] args) {
            printCall();
            c();
    }Only think is, I'm not confident that the index 3 will remain unchanged in different releases (there are two levels within getStackTrace() and there's no guarantee that will remain true).

  • Adding an updateProduct method which this method should call

    i would like to add an updateProduct method which this method should call the updateProduct method of the ProductDAO object to update the product.
    import java.util.Scanner;
    public class ProductMaintApp
    // declare two class variables
    private static ProductDAO productDAO = null;
    private static Scanner sc = null;
    public static void main(String args[])
    System.out.println("Welcome to the Product Maintenance application modified by Royce\n");
    // set the class variables
    productDAO = DAOFactory.getProductDAO();
    sc = new Scanner(System.in);
    // display the command menu
    displayMenu();
    // perform 1 or more actions
    String action = "";
    while (!action.equalsIgnoreCase("exit"))
    // get the input from the user
    action = Validator.getString(sc,
    "Enter a command: ");
    System.out.println();
    if (action.equalsIgnoreCase("list"))
    displayAllProducts();
    else if (action.equalsIgnoreCase("add"))
    addProduct();
    else if (action.equalsIgnoreCase("update"))
         updateProduct();
    else if (action.equalsIgnoreCase("del") ||
    action.equalsIgnoreCase("delete"))
    deleteProduct();
    else if (action.equalsIgnoreCase("help") ||
    action.equalsIgnoreCase("menu"))
    displayMenu();
    else if (action.equalsIgnoreCase("exit"))
    System.out.println("Bye.\n");
    else
    System.out.println("Error! Not a valid command.\n");
         public static void displayMenu()
    System.out.println("COMMAND MENU");
    System.out.println("list - List all products");
    System.out.println("add - Add a product");
    System.out.println("update - Update a product");
    System.out.println("del - Delete a product");
    System.out.println("help - Show this menu");
    System.out.println("exit - Exit this application\n");
    public static void displayAllProducts()
    System.out.println("PRODUCT LIST");
    System.out.println(productDAO.getProductsString());
    public static void addProduct()
    String code = Validator.getString(
    sc, "Enter product code: ");
    String description = Validator.getLine(
    sc, "Enter product description: ");
    double price = Validator.getDouble(
    sc, "Enter price: ");
    Product product = new Product();
    product.setCode(code);
    product.setDescription(description);
    product.setPrice(price);
    productDAO.addProduct(product);
    System.out.println();
    System.out.println(description
    + " has been added.\n");
    public static void deleteProduct()
    String code = Validator.getString(sc,
    "Enter product code to delete: ");
    Product p = productDAO.getProduct(code);
    System.out.println();
    if (p != null)
    productDAO.deleteProduct(p);
    System.out.println(p.getDescription()
    + " has been deleted.\n");
    else
    System.out.println("No product matches that product code.\n");

    i would like to add an updateProduct method which this method should call the updateProduct method of the ProductDAO object to update the product. Permission granted.

  • Which method is being called?

    Hi,
    I have the foll. setup:
    class A{
    func1();
    func2(){
    func1();
    class B extends A{
    func1(); // over-ridden
    super.func2();
    So, when super.func2() is called, and A.func2() is executed, within it does A.func1() get called or does B.func1() get called. If A's method gets called how can I change it to call B's method instead?
    Thanks.

    Write up a quick test case. You can easily find this out for yourself.

  • How do I keep track of how many times a method is called inside anthr clas?

    I am writing code for a program that solves a Knight's Tour. A Knight's Tour is a path a Knight Chess piece can take around the board starting at any spot, touching every square once, and only once. I have to write 2 classes and one is provided. The provided class is encrypted and written by our professor. All I know that it does is simulates the game using the two classes I write and provides a print out and prompts to ask the user which square they want to move to next.
    The square class I have to write consists of a constructor that makes a square object that keeps track of its color (white/black) and its status (whether it has been visited, is occupied by the knight, or is free and has not be visited).
    The GameBoard class I have to write is what I am having problems with. I am writing a method that determines how many squares have been visited. The previous mentioned class that my professor wrote for me contains a method moveKnight();. The way the program works is that every time moveKnight() is called a square's status is changed to occupied and therefore visited later. moveKnight() will only work if the move requested by the user is a valid move.
    SO! My main problem (sorry for all the explaining, just trying to give you all the information) is that I don't know how to keep track of how many times moveKnight() is called by the program. If i can figure this out it should be simple. I'm new to java but i believe...
    if(moveKnight() is called)
    {count++;} //count is a member variable already initialized
    return count;
    the moveKnight() is called section within the if() statement is what I am unclear how to do. Please help.
    Thanks, Veritas

    in your case you want 'count' to be a class attribute rather than a local variable. But yes, incrementing it each time that the method is called will serve your purpose.

Maybe you are looking for

  • Mute button is not working on my iPhone 4 after updating to IOS7

    Hi, Mute/Silent button is not working on my iPhone 4 after updating to IOS7. When I make my phone silent using that sliding button on the side, the phone toggles between mute/unmute position automatically and settles in unmue position. Then it will c

  • M:N Data relationships

    Hi, We have a data relationship which is causing headaches so any ideas how to solve this would be greatly appreciated. Customer Dimension Cust Code Cust Desc Account Dimension Acc Code Acc Desc Balance Facts Cust Code Acc Code Balance Data : Balance

  • Serial upgrade not working

    I just day's ago bought Final Cut Studio 2 to upgrade my Final Cut editor as I primerilly use a G5 as my main machine and a Mac Book Pro for on-the-go editing. So I decided to get a Legal Copy of Final Cut Studio 2 Upgrade.   However now as I go thro

  • Warning message after permission check, repair

    When I repaired permissions, I got this message; Warning:SUID File "system/library/CoreServices/RemoteManagement/ARDAgent" has been modified. Do I need to do something about this?

  • Launch Wily Introscope Workstation from SM?

    Friends: The way I launch the Wily Introscope Workstation is: a. via the Start Menu: ´CA Wily-> Introscope 8.2.2.0-> Introscope Workstation, OR b. by directly starting the file Introscope Workstation.exe in the installation directory Is there a trans