Interface WebServiceConnection

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
EndpointAwareWebServiceConnection, FaultAwareWebServiceConnection
All Known Implementing Classes:
AbstractHttpSenderConnection, AbstractReceiverConnection, AbstractSenderConnection, AbstractWebServiceConnection, ClientHttpRequestConnection, CommonsHttpConnection, HttpComponents5Connection, HttpComponentsConnection, HttpExchangeConnection, HttpServletConnection, HttpUrlConnection, JdkHttpClientConnection, JmsReceiverConnection, JmsSenderConnection, MailReceiverConnection, MailSenderConnection, XmppReceiverConnection, XmppSenderConnection

public interface WebServiceConnection extends AutoCloseable
Represents a point-to-point connection that a client can use for sending WebServiceMessage objects directly to a remote party.

A WebServiceConnection can be obtained using a WebServiceMessageSender.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
  • Method Details

    • send

      void send(WebServiceMessage message) throws IOException
      Sends the given message using this connection.
      Parameters:
      message - the message to be sent
      Throws:
      IOException - in case of I/O errors
    • receive

      WebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException
      Receives a message using the given WebServiceMessageFactory. This method blocks until it receives, or returns null when no message is received.
      Parameters:
      messageFactory - the message factory used for reading messages
      Returns:
      the read message, or null if no message received
      Throws:
      IOException - in case of I/O errors
    • getUri

      URI getUri() throws URISyntaxException
      Returns the URI for this connection.
      Throws:
      URISyntaxException
    • hasError

      boolean hasError() throws IOException
      Indicates whether this connection has an error. Typically, error detection is done by inspecting connection error codes, etc.
      Returns:
      true if this connection has an error; false otherwise.
      Throws:
      IOException
    • getErrorMessage

      String getErrorMessage() throws IOException
      Returns the error message.
      Returns:
      the connection error message, if any; returns null when no error is present
      Throws:
      IOException
      See Also:
    • close

      void close() throws IOException
      Closes this connection.

      Once a connection has been closed, it is not available for further use. A new connection needs to be created.

      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - if an I/O error occurs when closing this connection