1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.server.endpoint.adapter;
18
19 import java.lang.reflect.Method;
20 import javax.xml.transform.Source;
21
22 import org.springframework.ws.WebServiceMessage;
23 import org.springframework.ws.context.MessageContext;
24 import org.springframework.ws.server.MessageDispatcher;
25 import org.springframework.ws.server.endpoint.MethodEndpoint;
26 import org.springframework.ws.soap.server.SoapMessageDispatcher;
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48 @Deprecated
49 public class PayloadMethodEndpointAdapter extends AbstractMethodEndpointAdapter {
50
51 @Override
52 protected boolean supportsInternal(MethodEndpoint methodEndpoint) {
53 Method method = methodEndpoint.getMethod();
54 return (Void.TYPE.isAssignableFrom(method.getReturnType()) ||
55 Source.class.isAssignableFrom(method.getReturnType())) && method.getParameterTypes().length == 1 &&
56 Source.class.isAssignableFrom(method.getParameterTypes()[0]);
57
58 }
59
60 @Override
61 protected void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception {
62 Source requestSource = messageContext.getRequest().getPayloadSource();
63 Object result = methodEndpoint.invoke(requestSource);
64 if (result != null) {
65 Source responseSource = (Source) result;
66 WebServiceMessage response = messageContext.getResponse();
67 transform(responseSource, response.getPayloadResult());
68 }
69 }
70 }