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

    Default Return custom object in Java Webservice

    Hello,

    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

    [Serializable]
    [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
    Posts
    12,185
    Rep Power
    20

    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, 09:27 AM
  2. Listen for changes in a custom Object?
    By ozzyman in forum New To Java
    Replies: 12
    Last Post: 05-17-2011, 12:25 AM
  3. Replies: 5
    Last Post: 12-15-2010, 03:22 AM
  4. Replies: 0
    Last Post: 03-02-2010, 09:07 AM
  5. Consuming web service with return custom object
    By dream_ in forum Networking
    Replies: 1
    Last Post: 04-16-2009, 07: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
  •