SWS-134
This commit is contained in:
@@ -31,6 +31,66 @@ import org.springframework.ws.client.WebServiceClientException;
|
||||
*/
|
||||
public interface WebServiceOperations {
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
* <p/>
|
||||
* This will only work with a default uri specified!
|
||||
*
|
||||
* @param requestCallback the requestCallback to be used for manipulating the request message
|
||||
* @param responseExtractor object that will extract results
|
||||
* @return an arbitrary result object, as returned by the <code>WebServiceMessageExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
*
|
||||
* @param uri the URI to send the message to
|
||||
* @param requestCallback the requestCallback to be used for manipulating the request message
|
||||
* @param responseExtractor object that will extract results
|
||||
* @return an arbitrary result object, as returned by the <code>WebServiceMessageExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(String uri,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
WebServiceMessageExtractor responseExtractor) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given request callback, handling the response with a
|
||||
* response callback.
|
||||
* <p/>
|
||||
* This will only work with a default uri specified!
|
||||
*
|
||||
* @param requestCallback the callback to be used for manipulating the request message
|
||||
* @param responseCallback the callback to be used for manipulating the response message
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given request callback, handling the response with a
|
||||
* response callback.
|
||||
*
|
||||
* @param uri the URI to send the message to
|
||||
* @param requestCallback the callback to be used for manipulating the request message
|
||||
* @param responseCallback the callback to be used for manipulating the response message
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(String uri,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
WebServiceMessageCallback responseCallback) throws WebServiceClientException;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Convenience methods for sending and receiving marshalled messages
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload, marshalled by the configured
|
||||
* <code>Marshaller</code>. Returns the unmarshalled payload of the response message, if any.
|
||||
@@ -96,6 +156,10 @@ public interface WebServiceOperations {
|
||||
Object marshalSendAndReceive(String uri, Object requestPayload, WebServiceMessageCallback requestCallback)
|
||||
throws XmlMappingException, WebServiceClientException;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Convenience methods for sending Sources
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload, reading the result with a
|
||||
* <code>SourceExtractor</code>.
|
||||
@@ -107,7 +171,8 @@ public interface WebServiceOperations {
|
||||
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(Source requestPayload, SourceExtractor responseExtractor) throws WebServiceClientException;
|
||||
Object sendSourceAndReceive(Source requestPayload, SourceExtractor responseExtractor)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload, reading the result with a
|
||||
@@ -119,7 +184,7 @@ public interface WebServiceOperations {
|
||||
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(String uri, Source requestPayload, SourceExtractor responseExtractor)
|
||||
Object sendSourceAndReceive(String uri, Source requestPayload, SourceExtractor responseExtractor)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
@@ -136,9 +201,9 @@ public interface WebServiceOperations {
|
||||
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
SourceExtractor responseExtractor) throws WebServiceClientException;
|
||||
Object sendSourceAndReceive(Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
SourceExtractor responseExtractor) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload, reading the result with a
|
||||
@@ -153,10 +218,14 @@ public interface WebServiceOperations {
|
||||
* @return an arbitrary result object, as returned by the <code>SourceExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(String uri,
|
||||
Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
SourceExtractor responseExtractor) throws WebServiceClientException;
|
||||
Object sendSourceAndReceive(String uri,
|
||||
Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
SourceExtractor responseExtractor) throws WebServiceClientException;
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// Convenience methods for sending Sources and receiving to Results
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
|
||||
@@ -169,7 +238,7 @@ public interface WebServiceOperations {
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(Source requestPayload, Result responseResult) throws WebServiceClientException;
|
||||
boolean sendSourceAndReceiveToResult(Source requestPayload, Result responseResult) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
|
||||
@@ -181,7 +250,8 @@ public interface WebServiceOperations {
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(String uri, Source requestPayload, Result responseResult) throws WebServiceClientException;
|
||||
boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, Result responseResult)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
|
||||
@@ -197,8 +267,9 @@ public interface WebServiceOperations {
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(Source requestPayload, WebServiceMessageCallback requestCallback, Result responseResult)
|
||||
throws WebServiceClientException;
|
||||
boolean sendSourceAndReceiveToResult(Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
Result responseResult) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that contains the given payload. Writes the response, if any, to the given
|
||||
@@ -213,64 +284,9 @@ public interface WebServiceOperations {
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(String uri,
|
||||
Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
Result responseResult) throws WebServiceClientException;
|
||||
boolean sendSourceAndReceiveToResult(String uri,
|
||||
Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
Result responseResult) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
* <p/>
|
||||
* This will only work with a default uri specified!
|
||||
*
|
||||
* @param requestCallback the requestCallback to be used for manipulating the request message
|
||||
* @param responseExtractor object that will extract results
|
||||
* @return an arbitrary result object, as returned by the <code>WebServiceMessageExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageExtractor responseExtractor)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
*
|
||||
* @param uri the URI to send the message to
|
||||
* @param requestCallback the requestCallback to be used for manipulating the request message
|
||||
* @param responseExtractor object that will extract results
|
||||
* @return an arbitrary result object, as returned by the <code>WebServiceMessageExtractor</code>
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
Object sendAndReceive(String uri,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
WebServiceMessageExtractor responseExtractor) throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
* <p/>
|
||||
* This will only work with a default uri specified!
|
||||
*
|
||||
* @param requestCallback the callback to be used for manipulating the request message
|
||||
* @param responseCallback the callback to be used for manipulating the response message
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageCallback responseCallback)
|
||||
throws WebServiceClientException;
|
||||
|
||||
/**
|
||||
* Sends a web service message that can be manipulated with the given callback, reading the result with a
|
||||
* <code>WebServiceMessageExtractor</code>.
|
||||
*
|
||||
* @param uri the URI to send the message to
|
||||
* @param requestCallback the callback to be used for manipulating the request message
|
||||
* @param responseCallback the callback to be used for manipulating the response message
|
||||
* @return <code>true</code> if a response was received; <code>false</code> otherwise
|
||||
* @throws WebServiceClientException if there is a problem sending or receiving the message
|
||||
*/
|
||||
boolean sendAndReceive(String uri,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
WebServiceMessageCallback responseCallback) throws WebServiceClientException;
|
||||
}
|
||||
|
||||
@@ -64,24 +64,35 @@ import org.springframework.ws.transport.support.DefaultStrategiesHelper;
|
||||
* FaultMessageResolver} can be defined with with {@link #setFaultMessageResolver(FaultMessageResolver)
|
||||
* faultMessageResolver} property. If this property is set to <code>null</code>, no fault resolving is performed.
|
||||
* <p/>
|
||||
* This template uses the following algorithm for sending and receiving. <ol> <li>Call to {@link
|
||||
* #createConnection(String) createConnection()}.</li> <li>Call to {@link WebServiceMessageFactory#createWebServiceMessage()
|
||||
* createWebServiceMessage()} on the registered message factory to create a request message.</li> <li>Invoke {@link
|
||||
* WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage()} on the request callback, if any. This
|
||||
* step stores content in the request message, based on <code>Source</code>, marshalling, etc.</li> <li>Call {@link
|
||||
* WebServiceConnection#send(WebServiceMessage) send()} on the connection.</li> <li>Call {@link
|
||||
* #hasError(WebServiceConnection,WebServiceMessage) hasError()} to check if the connection has an error. For an HTTP
|
||||
* transport, a status code other than <code>2xx</code> indicates an error. However, since a status code of 500 can also
|
||||
* indicate a SOAP fault, the template verifies whether the error is not a fault.</li> <ul> <li>If the connection has an
|
||||
* error, call the {@link #handleError handleError()} method, which by default throws a {@link
|
||||
* WebServiceTransportException}.</li> <li>If the connection has no error, continue with the next step. </ul> <li>Invoke
|
||||
* {@link WebServiceConnection#receive(WebServiceMessageFactory) receive} on the connection to read the response
|
||||
* message, if any.</li> <ul> <li>If no response was received, return <code>null</code> or <code>false</code></li>
|
||||
* <li>Call {@link #hasFault(WebServiceConnection,WebServiceMessage) hasFault()} to determine whether the response has a
|
||||
* fault. If it has, call the {@link #handleFault handleFault()} method.</li> <li>Otherwise, invoke {@link
|
||||
* WebServiceMessageExtractor#extractData(WebServiceMessage) extractData()} on the response extractor, or {@link
|
||||
* WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage} on the response callback.</li> </ul>
|
||||
* <li>Call to {@link WebServiceConnection#close() close} on the connection.</li> </ol>
|
||||
* This template uses the following algorithm for sending and receiving.
|
||||
* <ol>
|
||||
* <li>Call to {@link #createConnection(String) createConnection()}.</li>
|
||||
* <li>Call to {@link WebServiceMessageFactory#createWebServiceMessage() createWebServiceMessage()} on the registered
|
||||
* message factory to create a request message.</li>
|
||||
* <li>Invoke {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage()} on the request
|
||||
* callback, if any. This step stores content in the request message, based on <code>Source</code>, marshalling,
|
||||
* etc.</li>
|
||||
* <li>Call {@link WebServiceConnection#send(WebServiceMessage) send()} on the connection.</li>
|
||||
* <li>Call {@link #hasError(WebServiceConnection, WebServiceMessage) hasError()} to check if the connection has an
|
||||
* error. For an HTTP transport, a status code other than <code>2xx</code> indicates an error. However, since a
|
||||
* status code of 500 can also indicate a SOAP fault, the template verifies whether the error is not a fault.</li>
|
||||
* <ul>
|
||||
* <li>If the connection has an error, call the {@link #handleError handleError()} method, which by default throws a
|
||||
* {@link WebServiceTransportException}.</li>
|
||||
* <li>If the connection has no error, continue with the next step.
|
||||
* </ul>
|
||||
* <li>Invoke {@link WebServiceConnection#receive(WebServiceMessageFactory) receive} on the connection to read the
|
||||
* response message, if any.</li>
|
||||
* <ul>
|
||||
* <li>If no response was received, return <code>null</code> or <code>false</code></li>
|
||||
* <li>Call {@link #hasFault(WebServiceConnection, WebServiceMessage) hasFault()} to determine whether the response
|
||||
* has a fault. If it has, call the {@link #handleFault handleFault()} method.</li>
|
||||
* <li>Otherwise, invoke {@link WebServiceMessageExtractor#extractData(WebServiceMessage) extractData()} on the
|
||||
* response extractor, or {@link WebServiceMessageCallback#doWithMessage(WebServiceMessage) doWithMessage} on
|
||||
* the response callback.</li>
|
||||
* </ul>
|
||||
* <li>Call to {@link WebServiceConnection#close() close} on the connection.</li>
|
||||
* </ol>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
@@ -123,10 +134,10 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
*
|
||||
* @see #marshalSendAndReceive(Object)
|
||||
* @see #marshalSendAndReceive(Object,WebServiceMessageCallback)
|
||||
* @see #sendAndReceive(Source,Result)
|
||||
* @see #sendAndReceive(Source,WebServiceMessageCallback,Result)
|
||||
* @see #sendAndReceive(Source,SourceExtractor)
|
||||
* @see #sendAndReceive(Source,WebServiceMessageCallback,SourceExtractor)
|
||||
* @see #sendSourceAndReceiveToResult(Source,Result)
|
||||
* @see #sendSourceAndReceiveToResult(Source,WebServiceMessageCallback,Result)
|
||||
* @see #sendSourceAndReceive(Source,SourceExtractor)
|
||||
* @see #sendSourceAndReceive(Source,WebServiceMessageCallback,SourceExtractor)
|
||||
* @see #sendAndReceive(WebServiceMessageCallback,WebServiceMessageCallback)
|
||||
*/
|
||||
public void setDefaultUri(String uri) {
|
||||
@@ -271,21 +282,21 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* Result-handling methods
|
||||
*/
|
||||
|
||||
public boolean sendAndReceive(Source requestPayload, Result responseResult) {
|
||||
return sendAndReceive(requestPayload, null, responseResult);
|
||||
public boolean sendSourceAndReceiveToResult(Source requestPayload, Result responseResult) {
|
||||
return sendSourceAndReceiveToResult(requestPayload, null, responseResult);
|
||||
}
|
||||
|
||||
public boolean sendAndReceive(String uri, Source requestPayload, Result responseResult) {
|
||||
return sendAndReceive(uri, requestPayload, null, responseResult);
|
||||
public boolean sendSourceAndReceiveToResult(String uri, Source requestPayload, Result responseResult) {
|
||||
return sendSourceAndReceiveToResult(uri, requestPayload, null, responseResult);
|
||||
}
|
||||
|
||||
public boolean sendAndReceive(Source requestPayload,
|
||||
public boolean sendSourceAndReceiveToResult(Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
final Result responseResult) {
|
||||
return sendAndReceive(getDefaultUri(), requestPayload, requestCallback, responseResult);
|
||||
return sendSourceAndReceiveToResult(getDefaultUri(), requestPayload, requestCallback, responseResult);
|
||||
}
|
||||
|
||||
public boolean sendAndReceive(String uri,
|
||||
public boolean sendSourceAndReceiveToResult(String uri,
|
||||
Source requestPayload,
|
||||
WebServiceMessageCallback requestCallback,
|
||||
final Result responseResult) {
|
||||
@@ -310,21 +321,21 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
* Source-handling methods
|
||||
*/
|
||||
|
||||
public Object sendAndReceive(final Source requestPayload, final SourceExtractor responseExtractor) {
|
||||
return sendAndReceive(requestPayload, null, responseExtractor);
|
||||
public Object sendSourceAndReceive(final Source requestPayload, final SourceExtractor responseExtractor) {
|
||||
return sendSourceAndReceive(requestPayload, null, responseExtractor);
|
||||
}
|
||||
|
||||
public Object sendAndReceive(String uri, final Source requestPayload, final SourceExtractor responseExtractor) {
|
||||
return sendAndReceive(uri, requestPayload, null, responseExtractor);
|
||||
public Object sendSourceAndReceive(String uri, final Source requestPayload, final SourceExtractor responseExtractor) {
|
||||
return sendSourceAndReceive(uri, requestPayload, null, responseExtractor);
|
||||
}
|
||||
|
||||
public Object sendAndReceive(final Source requestPayload,
|
||||
public Object sendSourceAndReceive(final Source requestPayload,
|
||||
final WebServiceMessageCallback requestCallback,
|
||||
final SourceExtractor responseExtractor) {
|
||||
return sendAndReceive(getDefaultUri(), requestPayload, requestCallback, responseExtractor);
|
||||
return sendSourceAndReceive(getDefaultUri(), requestPayload, requestCallback, responseExtractor);
|
||||
}
|
||||
|
||||
public Object sendAndReceive(String uri,
|
||||
public Object sendSourceAndReceive(String uri,
|
||||
final Source requestPayload,
|
||||
final WebServiceMessageCallback requestCallback,
|
||||
final SourceExtractor responseExtractor) {
|
||||
@@ -354,8 +365,8 @@ public class WebServiceTemplate extends WebServiceAccessor implements WebService
|
||||
}
|
||||
|
||||
/*
|
||||
* WebServiceMessage-handling methods
|
||||
*/
|
||||
* WebServiceMessage-handling methods
|
||||
*/
|
||||
|
||||
public boolean sendAndReceive(WebServiceMessageCallback requestCallback,
|
||||
WebServiceMessageCallback responseCallback) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.ws.soap.SoapMessage;
|
||||
* <pre>
|
||||
* WebServiceTemplate template = new WebServiceTemplate(messageFactory);
|
||||
* Result result = new DOMResult();
|
||||
* template.sendAndReceive(
|
||||
* template.sendSourceAndReceiveToResult(
|
||||
* new StringSource("<content xmlns=\"http://tempuri.org\"/>"),
|
||||
* new SoapActionCallback("http://tempuri.org/SOAPAction"),
|
||||
* result);
|
||||
|
||||
@@ -88,10 +88,10 @@ public class WebServiceTemplateIntegrationTest extends XMLTestCase {
|
||||
template.setMessageSender(new CommonsHttpMessageSender());
|
||||
String content = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
|
||||
StringResult result = new StringResult();
|
||||
template.sendAndReceive("http://localhost:8888/pox", new StringSource(content), result);
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/pox", new StringSource(content), result);
|
||||
assertXMLEqual(content, result.toString());
|
||||
try {
|
||||
template.sendAndReceive("http://localhost:8888/errors/notfound", new StringSource(content),
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/errors/notfound", new StringSource(content),
|
||||
new StringResult());
|
||||
fail("WebServiceTransportException expected");
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class WebServiceTemplateIntegrationTest extends XMLTestCase {
|
||||
//expected
|
||||
}
|
||||
try {
|
||||
template.sendAndReceive("http://localhost:8888/errors/server", new StringSource(content), result);
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/errors/server", new StringSource(content), result);
|
||||
fail("WebServiceTransportException expected");
|
||||
}
|
||||
catch (WebServiceTransportException ex) {
|
||||
@@ -117,13 +117,13 @@ public class WebServiceTemplateIntegrationTest extends XMLTestCase {
|
||||
template.setMessageSender(new CommonsHttpMessageSender());
|
||||
String content = "<root xmlns='http://springframework.org/spring-ws'><child/></root>";
|
||||
StringResult result = new StringResult();
|
||||
template.sendAndReceive("http://localhost:8888/soap/echo", new StringSource(content), result);
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/soap/echo", new StringSource(content), result);
|
||||
assertXMLEqual(content, result.toString());
|
||||
boolean b = template.sendAndReceive("http://localhost:8888/soap/noResponse", new StringSource(content),
|
||||
boolean b = template.sendSourceAndReceiveToResult("http://localhost:8888/soap/noResponse", new StringSource(content),
|
||||
new StringResult());
|
||||
assertFalse("Invalid result", b);
|
||||
try {
|
||||
template.sendAndReceive("http://localhost:8888/errors/notfound", new StringSource(content),
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/errors/notfound", new StringSource(content),
|
||||
new StringResult());
|
||||
fail("WebServiceTransportException expected");
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class WebServiceTemplateIntegrationTest extends XMLTestCase {
|
||||
//expected
|
||||
}
|
||||
try {
|
||||
template.sendAndReceive("http://localhost:8888/soap/fault", new StringSource(content), result);
|
||||
template.sendSourceAndReceiveToResult("http://localhost:8888/soap/fault", new StringSource(content), result);
|
||||
fail("SoapFaultClientException expected");
|
||||
}
|
||||
catch (SoapFaultClientException ex) {
|
||||
|
||||
@@ -217,7 +217,7 @@ public class WebServiceTemplateTest extends XMLTestCase {
|
||||
connectionMock.close();
|
||||
connectionControl.replay();
|
||||
|
||||
Object result = template.sendAndReceive(new StringSource("<request />"), extractorMock);
|
||||
Object result = template.sendSourceAndReceive(new StringSource("<request />"), extractorMock);
|
||||
assertEquals("Invalid response", extracted, result);
|
||||
|
||||
extractorControl.verify();
|
||||
@@ -236,7 +236,7 @@ public class WebServiceTemplateTest extends XMLTestCase {
|
||||
connectionMock.close();
|
||||
connectionControl.replay();
|
||||
|
||||
Object result = template.sendAndReceive(new StringSource("<request />"), extractorMock);
|
||||
Object result = template.sendSourceAndReceive(new StringSource("<request />"), extractorMock);
|
||||
assertNull("Invalid response", result);
|
||||
|
||||
extractorControl.verify();
|
||||
@@ -254,7 +254,7 @@ public class WebServiceTemplateTest extends XMLTestCase {
|
||||
connectionControl.replay();
|
||||
|
||||
StringResult result = new StringResult();
|
||||
boolean b = template.sendAndReceive(new StringSource("<request />"), result);
|
||||
boolean b = template.sendSourceAndReceiveToResult(new StringSource("<request />"), result);
|
||||
assertTrue("Invalid result", b);
|
||||
|
||||
connectionControl.verify();
|
||||
@@ -270,7 +270,7 @@ public class WebServiceTemplateTest extends XMLTestCase {
|
||||
connectionControl.replay();
|
||||
|
||||
StringResult result = new StringResult();
|
||||
boolean b = template.sendAndReceive(new StringSource("<request />"), result);
|
||||
boolean b = template.sendSourceAndReceiveToResult(new StringSource("<request />"), result);
|
||||
assertFalse("Invalid result", b);
|
||||
|
||||
connectionControl.verify();
|
||||
@@ -381,8 +381,6 @@ public class WebServiceTemplateTest extends XMLTestCase {
|
||||
callbackControl.verify();
|
||||
extractorControl.verify();
|
||||
connectionControl.verify();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
12
pom.xml
12
pom.xml
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
@@ -256,7 +257,8 @@
|
||||
</fileset>
|
||||
</copy>
|
||||
<move file="target/site/reference/pdf/index.pdf"
|
||||
tofile="target/site/reference/pdf/spring-ws-reference.pdf" failonerror="false"/>
|
||||
tofile="target/site/reference/pdf/spring-ws-reference.pdf"
|
||||
failonerror="false"/>
|
||||
</postProcess>
|
||||
</configuration>
|
||||
</plugin>
|
||||
@@ -303,6 +305,7 @@
|
||||
<packages>org.springframework.xml*</packages>
|
||||
</group>
|
||||
</groups>
|
||||
<javadocDirectory>${basedir}/src/main/javadoc</javadocDirectory>
|
||||
<excludePackageNames>org.springframework.ws.samples</excludePackageNames>
|
||||
<links>
|
||||
<link>http://java.sun.com/j2se/1.4.2/docs/api</link>
|
||||
@@ -371,6 +374,11 @@
|
||||
<artifactId>spring-ws-security</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-ws-mock</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-ws-samples</artifactId>
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.0-rc2">
|
||||
<action dev="poutsma" type="update" issue="SWS-134">Reduce the number of overloaded methods on the
|
||||
WebServiceTemplate class to aid comprehension.</action>
|
||||
<action dev="poutsma" type="add" issue="SWS-124">Allow specifying names of message factory and message
|
||||
receiver in MessageDispatcherServlet
|
||||
</action>
|
||||
|
||||
Reference in New Issue
Block a user