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 341769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:44:23+00:00 2026-05-12T10:44:23+00:00

Im pretty new to Java Web Services, but I cant find a good explanation

  • 0

Im pretty new to Java Web Services, but I cant find a good explanation anywhere.

I have 2 Java web projects within NetBeans.
One as a web service and one as a client for that web service.
I have also created my own class called “Person”, which has what you’d expect: name, dob, etc.

I would like to have a web service method called “ListPeople()” that would return an array of “Person” objects.

Do I need to have that class in both projects?
Should I be serializing the object first?
Should I be using JAXB, if so, where do I start?

Sorry for the n00b questions, but im confused.
What is the normal way of accomplishing this?

Thanks in advance

  • 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-12T10:44:23+00:00Added an answer on May 12, 2026 at 10:44 am
    1. Do I need to have that class in both projects? Yes.
    2. Should I be serializing the object first? No.
    3. Should I be using JAXB, if so, where do I start? I would not. I prefer the javax.oxm interfaces, because I don’t care for JAXB, but that’s a personal opinion.

    My personal preference is to use Spring web services. If you happen to be a Spring user, I think that’s the best way to go. If not, perhaps the docs will still help to clarify.

    You’re experiencing the reason why I don’t like your approach: both the service and client and dependent on the class and OXM code. You have to have it in both places, in perfect synchronization. Change one and you have to change both.

    I try to minimize dependencies if I can.

    And in this case you can if you send XML back and forth. Start with an XSD schema. Let the client and service deal with that instead of Java objects. Your service will be usable for clients that aren’t Java that way.

    If you take this approach, you only have to worry about OXM on the server side. You take in the XML request and marshal it into the Java object of your choice and pass it to your service layer (note: NOT web service layer) for processing. Turn the response object into XML response stream and Bob’s your uncle. Let the client deal with that.

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

Sidebar

Ask A Question

Stats

  • Questions 224k
  • Answers 224k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer svn://123.123.12.12/ might work. Actually after the last / there may… May 13, 2026 at 12:45 am
  • Editorial Team
    Editorial Team added an answer Have you tried calling refresh? http://docs.jquery.com/UI/Sortable#method-refresh Otherwise, at first glance… May 13, 2026 at 12:45 am
  • Editorial Team
    Editorial Team added an answer According to this, you can't comment SQL code. To comment… May 13, 2026 at 12:45 am

Related Questions

I get a java.lang.NoClassDefFoundError: com/hp/hpl/jena/shared/BadURIException when running a very simple servlet. The error points
I joined a new company about a month ago. The company is rather small
So, I'm getting some compile errors on netbeans 6.5 generated web service code for
I'm a senior-ish C# developer used to ASP.NET & IIS, but a project's come

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.