Announcement Announcement Module
Collapse
No announcement yet.
Return Bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Return Bean

    hi guys:

    I am a new Spring web service user. I have done the sample using echo. and it works well.

    i noticed that in the echo sample there was a method in the service.java

    Code:
           String echo(String s);
    I just wondering instead of return String, how can i return my custom bean.

    like Person.java
    Code:
    public class Person{
    
      private String   name;
      private Integer  age;
      private List       phone;
       
       get....
    
       set....
    Thanks
    Tony

  • #2
    Maybe I'm not understanding you correctly, but what about:

    Code:
    Person echo(Person p) {
      return p; //:p
    }
    I think you mean to ask something else?

    Comment


    • #3
      yeh, that's what i want.

      i want to return bean like:

      Code:
      public Person echo(Sting name );
      Thanks
      Tony

      Comment


      • #4
        Take a look at this tutorial

        Check out http://static.springframework.org/sp.../tutorial.html Arjen has added a detailed discription of how to set up a project and marshall a HolidayRequest. Since your Person contains only Strings the xsd should be even simpler.

        If and when I get to it I will post the code for a person service to this thread. However, it looks to me that from the tutorial you should be able to set it up yourself.

        You can skip the stuff about the wsdl's, but you should definitely not skip the mvn stuff.

        Good luck and let me know what you run into.

        Cheers,
        Iwein

        Comment

        Working...
        X