Interface WebServiceOperations

All Known Implementing Classes:
WebServiceTemplate

public interface WebServiceOperations
Specifies a basic set of Web service operations. Implemented by WebServiceTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.
Since:
1.0.0
Author:
Arjen Poutsma
See Also:
  • Method Details

    • sendAndReceive

      <T> T sendAndReceive(WebServiceMessageCallback requestCallback, WebServiceMessageExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that can be manipulated with the given callback, reading the result with a WebServiceMessageExtractor.

      This will only work with a default uri specified!

      Parameters:
      requestCallback - the requestCallback to be used for manipulating the request message
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the WebServiceMessageExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendAndReceive

      <T> T sendAndReceive(String uri, WebServiceMessageCallback requestCallback, WebServiceMessageExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that can be manipulated with the given callback, reading the result with a WebServiceMessageExtractor.
      Parameters:
      uri - the URI to send the message to
      requestCallback - the requestCallback to be used for manipulating the request message
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the WebServiceMessageExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendAndReceive

      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.

      This will only work with a default uri specified!

      Parameters:
      requestCallback - the callback to be used for manipulating the request message
      responseCallback - the callback to be used for manipulating the response message
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendAndReceive

      boolean sendAndReceive(String uri, 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.
      Parameters:
      uri - the URI to send the message to
      requestCallback - the callback to be used for manipulating the request message
      responseCallback - the callback to be used for manipulating the response message
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • marshalSendAndReceive

      Object marshalSendAndReceive(Object requestPayload) throws org.springframework.oxm.XmlMappingException, WebServiceClientException
      Sends a web service message that contains the given payload, marshalled by the configured Marshaller. Returns the unmarshalled payload of the response message, if any.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the object to marshal into the request message payload
      Returns:
      the unmarshalled payload of the response message, or null if no response is given
      Throws:
      org.springframework.oxm.XmlMappingException - if there is a problem marshalling or unmarshalling
      WebServiceClientException - if there is a problem sending or receiving the message
      See Also:
    • marshalSendAndReceive

      Object marshalSendAndReceive(String uri, Object requestPayload) throws org.springframework.oxm.XmlMappingException, WebServiceClientException
      Sends a web service message that contains the given payload, marshalled by the configured Marshaller. Returns the unmarshalled payload of the response message, if any.
      Parameters:
      uri - the URI to send the message to
      requestPayload - the object to marshal into the request message payload
      Returns:
      the unmarshalled payload of the response message, or null if no response is given
      Throws:
      org.springframework.oxm.XmlMappingException - if there is a problem marshalling or unmarshalling
      WebServiceClientException - if there is a problem sending or receiving the message
      See Also:
    • marshalSendAndReceive

      Object marshalSendAndReceive(Object requestPayload, WebServiceMessageCallback requestCallback) throws org.springframework.oxm.XmlMappingException, WebServiceClientException
      Sends a web service message that contains the given payload, marshalled by the configured Marshaller. Returns the unmarshalled payload of the response message, if any. The given callback allows changing of the request message after the payload has been marshalled to it.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the object to marshal into the request message payload
      requestCallback - callback to change message, can be null
      Returns:
      the unmarshalled payload of the response message, or null if no response is given
      Throws:
      org.springframework.oxm.XmlMappingException - if there is a problem marshalling or unmarshalling
      WebServiceClientException - if there is a problem sending or receiving the message
      See Also:
    • marshalSendAndReceive

      Object marshalSendAndReceive(String uri, Object requestPayload, WebServiceMessageCallback requestCallback) throws org.springframework.oxm.XmlMappingException, WebServiceClientException
      Sends a web service message that contains the given payload, marshalled by the configured Marshaller. Returns the unmarshalled payload of the response message, if any. The given callback allows changing of the request message after the payload has been marshalled to it.
      Parameters:
      uri - the URI to send the message to
      requestPayload - the object to marshal into the request message payload
      requestCallback - callback to change message, can be null
      Returns:
      the unmarshalled payload of the response message, or null if no response is given
      Throws:
      org.springframework.oxm.XmlMappingException - if there is a problem marshalling or unmarshalling
      WebServiceClientException - if there is a problem sending or receiving the message
      See Also:
    • sendSourceAndReceive

      <T> T sendSourceAndReceive(Source requestPayload, SourceExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that contains the given payload, reading the result with a SourceExtractor.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the payload of the request message
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the SourceExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceive

      <T> T sendSourceAndReceive(String uri, Source requestPayload, SourceExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that contains the given payload, reading the result with a SourceExtractor.
      Parameters:
      uri - the URI to send the message to
      requestPayload - the payload of the request message
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the SourceExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceive

      <T> T sendSourceAndReceive(Source requestPayload, WebServiceMessageCallback requestCallback, SourceExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that contains the given payload, reading the result with a SourceExtractor.

      The given callback allows changing of the request message after the payload has been written to it.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the payload of the request message
      requestCallback - callback to change message, can be null
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the SourceExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceive

      <T> T sendSourceAndReceive(String uri, Source requestPayload, WebServiceMessageCallback requestCallback, SourceExtractor<T> responseExtractor) throws WebServiceClientException
      Sends a web service message that contains the given payload, reading the result with a SourceExtractor.

      The given callback allows changing of the request message after the payload has been written to it.

      Parameters:
      uri - the URI to send the message to
      requestPayload - the payload of the request message
      requestCallback - callback to change message, can be null
      responseExtractor - object that will extract results
      Returns:
      an arbitrary result object, as returned by the SourceExtractor
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceiveToResult

      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 Result.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the payload of the request message
      responseResult - the result to write the response payload to
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceiveToResult

      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 Result.
      Parameters:
      uri - the URI to send the message to
      requestPayload - the payload of the request message
      responseResult - the result to write the response payload to
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceiveToResult

      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 Result.

      The given callback allows changing of the request message after the payload has been written to it.

      This will only work with a default uri specified!

      Parameters:
      requestPayload - the payload of the request message
      requestCallback - callback to change message, can be null
      responseResult - the result to write the response payload to
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message
    • sendSourceAndReceiveToResult

      boolean sendSourceAndReceiveToResult(String uri, 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 Result.

      The given callback allows changing of the request message after the payload has been written to it.

      Parameters:
      uri - the URI to send the message to
      requestPayload - the payload of the request message
      requestCallback - callback to change message, can be null
      responseResult - the result to write the response payload to
      Returns:
      true if a response was received; false otherwise
      Throws:
      WebServiceClientException - if there is a problem sending or receiving the message