Announcement Announcement Module
Collapse
No announcement yet.
how return ArrayList from web Service.?????? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how return ArrayList from web Service.??????

    Hello

    i having a prob in Spring Web service i have no idea how i can get the List from the web service.......... like i want that when i call One particular method from my WS it response me the list of user name

    public interface Data
    {

    public List user();
    }

    ////////////////// imp class//////////

    public class SendUser implements Data{

    public List user()
    {

    List list=new ArrayList();

    list.add("jhon");
    list.add("Mac");
    list.add("Tom");

    return list;

    }
    }

    /////////////// my end point class//////////

    public endpoint extends AbstractDomPayloadEndpoint{

    .....
    .......
    ......

    protected Element invokeInternal(Element requestElement, Document document)
    {

    ///getting list from class

    List list = Data.user() ; // return list of user there



    Element responseElement = document.createElementNS(NAMESPACE_URI, "echoResponse");


    // send directly the list from reponse ????? or what i can do there
    Text responseText = document.createTextNode(list);

    responseElement.appendChild(responseText);
    return responseElement;

    }

    /////////// my xsd file //////////////

    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified"
    xmlns:hr="http://www.springframework.org/spring-ws/samples/echo"
    targetNamespace="http://www.springframework.org/spring-ws/samples/echo">

    <element name="UserRequest">
    </element>


    ///// what is the response type of my user method i define there

    <element name="UserResponse" type=""/>

    </schema>
    ///////////////////////////////////////////




    please guide me on that sample code how i send the Java List of user from a web service..............

    hope any body guide me.........
Working...
X