Results 1 to 2 of 2
  1. #1
    Nela is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Return custom object in Java Webservice


    I have simple Java Web Service but I need return a some serializable object (some members of the class) as XML but I don't know how... In .NET it was so easy, in response Class you should add

    [System.Xml.Serialization.XmlRoot(Namespace="someth ing")]
    class responseClass.... {
    public returnMember = 'Hello, world';

    was in XML

    <returnMember>Hello, world</returnMember>

    How I can do this in Jave Web Services?? It's possible without AXIS2 or something like this? Thanks. No idea

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Return custom object in Java Webservice

    You would need something to do that for you (JAXB probably).
    Also I expect it would be CDATA?
    If you're sending a class over I would argue that you define the class as part of your service.

Similar Threads

  1. Replies: 0
    Last Post: 10-03-2011, 08:27 AM
  2. Listen for changes in a custom Object?
    By ozzyman in forum New To Java
    Replies: 12
    Last Post: 05-16-2011, 11:25 PM
  3. Replies: 5
    Last Post: 12-15-2010, 02:22 AM
  4. Replies: 0
    Last Post: 03-02-2010, 08:07 AM
  5. Consuming web service with return custom object
    By dream_ in forum Networking
    Replies: 1
    Last Post: 04-16-2009, 06:56 AM

Tags for this Thread

Posting Permissions

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