×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    10

    (Uncaught exception) get String[] data from wsdl in netbeans

    Hi all,

    First time, i used ksaop. But, for now, i want to learn how to develop j2me network connection with wsdl in network.
    In .net, i made simple webservice (it was invoked helloworld). And, from netbeans, i called it (project > right click > new > "java me web service client" > i write my localserver is http://localhost:1000?wsdl). I successed that helloworld string returned from asp.net in my middlet. Samely, i want to write string array in web services. Then, i called it from middlet. It returns this error;
    Uncaught exception java/lang/ArrayStoreException.

    For example,
    in my asp.net web service, there is this function.

    PHP Code:
    [WebMethod(EnableSession trueDescription "Get Info")]
    public 
    string[] GetMyData(string customerid)
    {
       
    string[] customerAccounts = new string[3];
       
    customerAccounts[0] = "one";
       
    customerAccounts[1] = "two";
       
    customerAccounts[2] = "three";
       return 
    customerAccounts;

    Then, i called it from my middlet source,
    PHP Code:
     public void GetCustomerData(String custno) {
            
    System.out.println("1");
            new 
    Thread(new Runnable() {
                
    String string "";
                public 
    void run() {
                    try {
                        
    System.out.println("debug");
                        
    BankingService_Stub bank = new BankingService_Stub();
                        
    System.out.println(bank.getMyData("").length);
                        
    //bank._setProperty(BankingService_Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
                        
    System.out.println(bank.getMyData("").length);
                    } catch (
    RemoteException ex) {
                        
    ex.printStackTrace();
                    }

                }
            }).
    start();
        } 
    //////////////
    OUTPUT:

    PHP Code:
    1
    2
    Uncaught exception java
    /lang/ArrayStoreException.
    Execution completed
    ////////

    Why?

    Thanks alot.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: (Uncaught exception) get String[] data from wsdl in netbeans

    Where does the "2" come from? Can you add something to the println's, so we can see which line of output comes from which println?

    Also, change the exception handler to catch any exception. Usually, this is bad, but for the sake of seeing where this exception is coming from, it would be useful.

    PHP Code:
    try { 
        
    System.out.println("debug"); 
        
    BankingService_Stub bank = new BankingService_Stub(); 
        
    System.out.println("A: " bank.getMyData("").length); 
        
    //bank._setProperty(BankingService_Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true)); 
        
    System.out.println("B: " bank.getMyData("").length); 
    } catch (
    Throwable ex) { 
        
    ex.printStackTrace(); 

    Have you tried this successfully with a simpler data type? You can try this example.

    Graham.

Similar Threads

  1. Replies: 3
    Last Post: 2011-03-25, 20:22
  2. VS.Net 2003 Carbide 2.01 and epoc32.exe
    By ValentinK in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2007-01-12, 12:31
  3. Replies: 2
    Last Post: 2006-08-11, 20:51
  4. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  5. Using protocol file:// with object connector
    By afinistr in forum Mobile Java General
    Replies: 2
    Last Post: 2002-06-24, 07:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×