Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3669502
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:15:05+00:00 2026-05-19T02:15:05+00:00

I currently have a web service which has a class to connect to a

  • 0

I currently have a web service which has a class to connect to a MySQL database to get customer information that is stored.

What I would like to do is get all the customer information as in username and add them into a new item in a combobox in the client side. I know to use a Vector but I can’t get my head around how I can get the web service to go through each entry, send it back and then update the combo box without a bunch of messy cod.

Can anyone help me out here?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:15:05+00:00Added an answer on May 19, 2026 at 2:15 am

    If you want to use a web service properly, you should use a List not a Vector. This will translate to multiple XML elements in your WSDL.

    So for example if you have your web method named getCustomerInfo() and you are expecting it to return a list of strings, it would be like this:

    @WebMethod
    List<String> getCustomerInfo()
    {
     //your normal Java code
    }
    

    Since you’re mentioning JDBC its unlikely that you actually need to return a String, but you’ll probably need a simple class which has 2 strings, the key and the value. For example ‘Username’ and ‘sandeep’.

    Alternatively (the right way), use JPA and create a proper entity which reflects the proper table structure, and return that to the client. Thats why JPA was designed for EJB3, and giving you’re using Glassfish you’ve already got everything out of the box.

    UPDATE (following comments discussion):

    So essentially what you need to have is your webservice do something like this:

    @WebMethod
    List<String> getCustomerUsernames()
    {
      List<String> usernames = new ArrayList<String>();
    
      //your query here to get the usernames from the DB and for each username:
      usernames.add(username);
    
      return usernames;
    }
    

    From the client side you will first need to generate the web service stubs, which will then give you the identical method getCustomerUsernames() to use.

    For more info about web services and JAX-WS refer to the tutorial here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the WSDL for a web service that I cannot currently connect to.
I have a Java web-service which currently runs on a local tomcat server. I
Currently I have a web service, which loads up any plugins located within its
I currently have a number of web applications which access a common service running
Currently, each web service for our application has a user parameter that is added
I have a currency converter application for iphone which uses web service. The web
This is how I have currently managed to consume a particular Microsoft web service.
I want to build a REST web service on app engine. Currently i have
I have an internal enterprise app that currently consumes 10 different web services. They're
I have a web application that stores a lot of user generated files. Currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.