I'm trying to expand the example from:
http://static.springsource.org/sprin.../tutorial.html
The example assumes no response is returned. I want to return a simple response including a success flag and an additional error string. I've defined the response type element in the xsd file and now I'm trying to modify the code to return a response.
I modified the handleHolidayRequest changing the return type to "Element" and manually constructing the Element object as the return value.Code:@Endpoint public class HolidayEndpoint { ...................... @Autowired public HolidayEndpoint(HumanResourceService humanResourceService) throws JDOMException { ......... } @PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest") public void handleHolidayRequest(@RequestPayload Element holidayRequest) throws Exception { /*---- pare holidayRequest and invoke the service ----/* }
The code compiles fine. However, when trying to invoke the web service I get a Soap fault:Code:@PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest") public Element handleHolidayRequest(@RequestPayload Element holidayRequest) throws Exception { /*---- pare holidayRequest and invoke the service ----/* Element responseElement = null; responseElement = new Element("HolidayResponse"); responseElement.setAttribute("value", response.getValue().toString()); responseElement.setAttribute("responseString", response.getResponseMessage()); return responseElement; }
Any advice? Please note that I got the original example to work just fine.Code:<SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring xml:lang="en"> No adapter for endpoint [public org.jdom.Element com.mycompany.hr.ws.HolidayEndpoint.handleHolidayRequest(org.jdom.Element) throws java.lang.Exception]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring> </SOAP-ENV:Fault>


Reply With Quote
