Skip to content

Commit 0762502

Browse files
committed
Implemented #SWS-98: Changing URL in CommonsHttpMessageSender
1 parent 7976778 commit 0762502

32 files changed

+905
-574
lines changed

core/src/main/java/org/springframework/ws/client/core/WebServiceOperations.java

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public interface WebServiceOperations {
3434
/**
3535
* Sends a web service message that contains the given payload, marshalled by the configured
3636
* <code>Marshaller</code>. Returns the unmarshalled payload of the response message, if any.
37+
* <p/>
38+
* This will only work with a default specified!
3739
*
3840
* @param requestPayload the object to marshal into the request message payload
3941
* @return the unmarshalled payload of the response message, or <code>null</code> if no response is given
@@ -44,10 +46,27 @@ public interface WebServiceOperations {
4446
*/
4547
Object marshalSendAndReceive(Object requestPayload) throws XmlMappingException, WebServiceClientException;
4648

49+
/**
50+
* Sends a web service message that contains the given payload, marshalled by the configured
51+
* <code>Marshaller</code>. Returns the unmarshalled payload of the response message, if any.
52+
*
53+
* @param uri the URI to send the message to
54+
* @param requestPayload the object to marshal into the request message payload
55+
* @return the unmarshalled payload of the response message, or <code>null</code> if no response is given
56+
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
57+
* @throws WebServiceClientException if there is a problem sending or receiving the message
58+
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
59+
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
60+
*/
61+
Object marshalSendAndReceive(String uri, Object requestPayload)
62+
throws XmlMappingException, WebServiceClientException;
63+
4764
/**
4865
* Sends a web service message that contains the given payload, marshalled by the configured
4966
* <code>Marshaller</code>. Returns the unmarshalled payload of the response message, if any. The given callback
5067
* allows changing of the request message after the payload has been marshalled to it.
68+
* <p/>
69+
* This will only work with a default specified!
5170
*
5271
* @param requestPayload the object to marshal into the request message payload
5372
* @param requestCallback callback to change message, can be <code>null</code>
@@ -60,9 +79,28 @@ public interface WebServiceOperations {
6079
Object marshalSendAndReceive(Object requestPayload, WebServiceMessageCallback requestCallback)
6180
throws XmlMappingException, WebServiceClientException;
6281

82+
/**
83+
* Sends a web service message that contains the given payload, marshalled by the configured
84+
* <code>Marshaller</code>. Returns the unmarshalled payload of the response message, if any. The given callback
85+
* allows changing of the request message after the payload has been marshalled to it.
86+
*
87+
* @param uri the URI to send the message to
88+
* @param requestPayload the object to marshal into the request message payload
89+
* @param requestCallback callback to change message, can be <code>null</code>
90+
* @return the unmarshalled payload of the response message, or <code>null</code> if no response is given
91+
* @throws XmlMappingException if there is a problem marshalling or unmarshalling
92+
* @throws WebServiceClientException if there is a problem sending or receiving the message
93+
* @see WebServiceTemplate#setMarshaller(org.springframework.oxm.Marshaller)
94+
* @see WebServiceTemplate#setUnmarshaller(org.springframework.oxm.Unmarshaller)
95+
*/
96+
Object marshalSendAndReceive(String uri, Object requestPayload, WebServiceMessageCallback requestCallback)
97+
throws XmlMappingException, WebServiceClientException;
98+
6399
/**
64100
* Sends a web service message that contains the given payload, reading the result with a
65101
* <code>SourceExtractor</code>.
102+
* <p/>
103+
* This will only work with a default specified!
66104
*
67105
* @param requestPayload the payload of the request message
68106
* @param responseExtractor object that will extract results
@@ -71,11 +109,26 @@ Object marshalSendAndReceive(Object requestPayload, WebServiceMessageCallback re
71109
*/
72110
Object sendAndReceive(Source requestPayload, SourceExtractor responseExtractor) throws WebServiceClientException;
73111

112+
/**
113+
* Sends a web service message that contains the given payload, reading the result with a
114+
* <code>SourceExtractor</code>.
115+
*
116+
* @param uri the URI to send the message to
117+
* @param requestPayload the payload of the request message
118+
* @param responseExtractor object that will extract results
119+
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
120+
* @throws WebServiceClientException if there is a problem sending or receiving the message
121+
*/
122+
Object sendAndReceive(String uri, Source requestPayload, SourceExtractor responseExtractor)
123+
throws WebServiceClientException;
124+
74125
/**
75126
* Sends a web service message that contains the given payload, reading the result with a
76127
* <code>SourceExtractor</code>.
77128
* <p/>
78129
* The given callback allows changing of the request message after the payload has been written to it.
130+
* <p/>
131+
* This will only work with a default specified!
79132
*
80133
* @param requestPayload the payload of the request message
81134
* @param requestCallback callback to change message, can be <code>null</code>
@@ -87,21 +140,54 @@ Object sendAndReceive(Source requestPayload,
87140
WebServiceMessageCallback requestCallback,
88141
SourceExtractor responseExtractor) throws WebServiceClientException;
89142

143+
/**
144+
* Sends a web service message that contains the given payload, reading the result with a
145+
* <code>SourceExtractor</code>.
146+
* <p/>
147+
* The given callback allows changing of the request message after the payload has been written to it.
148+
*
149+
* @param uri the URI to send the message to
150+
* @param requestPayload the payload of the request message
151+
* @param requestCallback callback to change message, can be <code>null</code>
152+
* @param responseExtractor object that will extract results
153+
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
154+
* @throws WebServiceClientException if there is a problem sending or receiving the message
155+
*/
156+
Object sendAndReceive(String uri,
157+
Source requestPayload,
158+
WebServiceMessageCallback requestCallback,
159+
SourceExtractor responseExtractor) throws WebServiceClientException;
160+
90161
/**
91162
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
92163
* <code>Result</code>.
164+
* <p/>
165+
* This will only work with a default specified!
93166
*
94167
* @param requestPayload the payload of the request message
95168
* @param responseResult the result to write the response payload to
96169
* @throws WebServiceClientException if there is a problem sending or receiving the message
97170
*/
98171
void sendAndReceive(Source requestPayload, Result responseResult) throws WebServiceClientException;
99172

173+
/**
174+
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
175+
* <code>Result</code>.
176+
*
177+
* @param uri the URI to send the message to
178+
* @param requestPayload the payload of the request message
179+
* @param responseResult the result to write the response payload to
180+
* @throws WebServiceClientException if there is a problem sending or receiving the message
181+
*/
182+
void sendAndReceive(String uri, Source requestPayload, Result responseResult) throws WebServiceClientException;
183+
100184
/**
101185
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
102186
* <code>Result</code>.
103187
* <p/>
104188
* The given callback allows changing of the request message after the payload has been written to it.
189+
* <p/>
190+
* This will only work with a default specified!
105191
*
106192
* @param requestPayload the payload of the request message
107193
* @param requestCallback callback to change message, can be <code>null</code>
@@ -111,9 +197,28 @@ Object sendAndReceive(Source requestPayload,
111197
void sendAndReceive(Source requestPayload, WebServiceMessageCallback requestCallback, Result responseResult)
112198
throws WebServiceClientException;
113199

200+
/**
201+
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
202+
* <code>Result</code>.
203+
* <p/>
204+
* The given callback allows changing of the request message after the payload has been written to it.
205+
*
206+
* @param uri the URI to send the message to
207+
* @param requestPayload the payload of the request message
208+
* @param requestCallback callback to change message, can be <code>null</code>
209+
* @param responseResult the result to write the response payload to
210+
* @throws WebServiceClientException if there is a problem sending or receiving the message
211+
*/
212+
void sendAndReceive(String uri,
213+
Source requestPayload,
214+
WebServiceMessageCallback requestCallback,
215+
Result responseResult) throws WebServiceClientException;
216+
114217
/**
115218
* Sends a web service message that can be manipulated with the given callback, reading the result with a
116219
* <code>WebServiceMessageExtractor</code>.
220+
* <p/>
221+
* This will only work with a default specified!
117222
*
118223
* @param requestCallback the requestCallback to be used for manipulating the request message
119224
* @param responseExtractor object that will extract results
@@ -127,10 +232,39 @@ Object sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessa
127232
* Sends a web service message that can be manipulated with the given callback, reading the result with a
128233
* <code>WebServiceMessageExtractor</code>.
129234
*
235+
* @param uri the URI to send the message to
236+
* @param requestCallback the requestCallback to be used for manipulating the request message
237+
* @param responseExtractor object that will extract results
238+
* @return an arbitrary result object, as returned by the <code>WebServiceMessageExtractor</code>
239+
* @throws WebServiceClientException if there is a problem sending or receiving the message
240+
*/
241+
Object sendAndReceive(String uri,
242+
WebServiceMessageCallback requestCallback,
243+
WebServiceMessageExtractor responseExtractor) throws WebServiceClientException;
244+
245+
/**
246+
* Sends a web service message that can be manipulated with the given callback, reading the result with a
247+
* <code>WebServiceMessageExtractor</code>.
248+
* <p/>
249+
* This will only work with a default specified!
250+
*
130251
* @param requestCallback the callback to be used for manipulating the request message
131252
* @param responseCallback the callback to be used for manipulating the response message
132253
* @throws WebServiceClientException if there is a problem sending or receiving the message
133254
*/
134255
void sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback)
135256
throws WebServiceClientException;
257+
258+
/**
259+
* Sends a web service message that can be manipulated with the given callback, reading the result with a
260+
* <code>WebServiceMessageExtractor</code>.
261+
*
262+
* @param uri the URI to send the message to
263+
* @param requestCallback the callback to be used for manipulating the request message
264+
* @param responseCallback the callback to be used for manipulating the response message
265+
* @throws WebServiceClientException if there is a problem sending or receiving the message
266+
*/
267+
void sendAndReceive(String uri,
268+
WebServiceMessageCallback requestCallback,
269+
WebServiceMessageCallback responseCallback) throws WebServiceClientException;
136270
}

0 commit comments

Comments
 (0)