Announcement Announcement Module
Collapse
No announcement yet.
Difficulty calling method annotated @PayloadRoot with parameter @RequestPayload Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Difficulty calling method annotated @PayloadRoot with parameter @RequestPayload

    Hi,

    Could you please help me in this?

    I am trying to call the webservice with the below endpoint class... i am not able to call the annotated @PayloadRoot with the parameter begins with @RequestPayLoad but can call it without any parameter...

    package com.mycompany.hr.ws;

    import org.springframework.beans.factory.annotation.Autow ired;
    import org.springframework.ws.server.endpoint.annotation. Endpoint;
    import org.springframework.ws.server.endpoint.annotation. PayloadRoot;
    import org.springframework.ws.server.endpoint.annotation. RequestPayload;
    import org.springframework.ws.server.endpoint.annotation. ResponsePayload;
    import org.springframework.ws.soap.SoapHeader;
    import org.springframework.ws.soap.server.endpoint.annota tion.SoapAction;
    import org.w3c.dom.NodeList;

    import com.mycompany.hr.schemas.HolidayRequest;
    import com.mycompany.hr.service.HumanResourceService;
    import org.jdom.Element;
    import org.jdom.JDOMException;
    import org.jdom.Namespace;
    import org.jdom.xpath.XPath;

    @Endpoint
    public class HolidayEndpoint {

    private static final String NAMESPACE_URI = "http://mycompany.com/hr/schemas";

    private XPath startDateExpression;

    private XPath endDateExpression;

    private XPath nameExpression;

    private HumanResourceService humanResourceService;

    @Autowired
    public HolidayEndpoint(HumanResourceService humanResourceService)
    throws JDOMException {
    this.humanResourceService = humanResourceService;

    Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);

    // startDateExpression = XPath.newInstance("//hr:StartDate");
    // startDateExpression.addNamespace(namespace);
    //
    // endDateExpression = XPath.newInstance("//hr:EndDate");
    // endDateExpression.addNamespace(namespace);

    nameExpression = XPath.newInstance("//hr:name");
    nameExpression.addNamespace(namespace);
    }

    @PayloadRoot(localPart = "HolidayRequest", namespace = NAMESPACE_URI)
    //@ResponsePayload
    //public void handleHolidayRequest(@RequestPayload Element element)
    //public void handleHolidayRequest(@RequestPayload HolidayRequest holidayRequest)
    public void handleHolidayRequest()
    throws Exception {

    System.out.println();
    String name = "Testing";
    humanResourceService.bookHoliday(name);

    }

    }


    With paramater i am getting the below exception...

    Exception in thread "Main Thread" com.sun.xml.internal.ws.client.ClientTransportExce ption: The server sent HTTP status code 500: Internal Server Error
    at com.sun.xml.internal.ws.transport.http.client.Http TransportPipe.checkStatusCodeOneway(HttpTransportP ipe.java:207)
    at com.sun.xml.internal.ws.transport.http.client.Http TransportPipe.process(HttpTransportPipe.java:164)
    at com.sun.xml.internal.ws.transport.http.client.Http TransportPipe.processRequest(HttpTransportPipe.jav a:83)
    at com.sun.xml.internal.ws.transport.DeferredTranspor tPipe.processRequest(DeferredTransportPipe.java:10 5)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fib er.java:587)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fibe r.java:546)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber .java:531)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fib er.java:428)
    at com.sun.xml.internal.ws.client.Stub.process(Stub.j ava:211)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProce ss(SEIStub.java:124)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandl er.invoke(SyncMethodHandler.java:98)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandl er.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke( SEIStub.java:107)
    at $Proxy27.holiday(Unknown Source)
    at OplaServiceClient.main(OplaServiceClient.java:25)

  • #2
    Sorry for not getting to this sooner. We are in the process of moving to StackOverflow for our forums.

    This question is probably a better candidate for StackOverflow, perhaps against the #spring-ws tag. If you do post it there, please reply here with the link. Thanks!

    Comment

    Working...
    X