Spring Web Services Framework

org.springframework.ws.transport
Interface WebServiceConnection

All Known Subinterfaces:
EndpointAwareWebServiceConnection, FaultAwareWebServiceConnection
All Known Implementing Classes:
AbstractHttpSenderConnection, AbstractReceiverConnection, AbstractSenderConnection, AbstractWebServiceConnection, CommonsHttpConnection, HttpExchangeConnection, HttpServletConnection, HttpUrlConnection, JmsReceiverConnection, JmsSenderConnection, MailReceiverConnection, MailSenderConnection

public interface WebServiceConnection

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:
WebServiceMessageSender.createConnection(URI)

Method Summary
 void close()
          Closes this connection.
 String getErrorMessage()
          Returns the error message.
 URI getUri()
          Returns the URI for this connection.
 boolean hasError()
          Indicates whether this connection has an error.
 WebServiceMessage receive(WebServiceMessageFactory messageFactory)
          Receives a message using the given WebServiceMessageFactory.
 void send(WebServiceMessage message)
          Sends the given message using this connection.
 

Method Detail

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:
hasError()

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.

Throws:
IOException - if an I/O error occurs when closing this connection

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.