Package org.springframework.ws.transport
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
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 Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this connection.Returns the error message.getUri()
Returns the URI for this connection.boolean
hasError()
Indicates whether this connection has an error.receive
(WebServiceMessageFactory messageFactory) Receives a message using the givenWebServiceMessageFactory
.void
send
(WebServiceMessage message) Sends the given message using this connection.
-
Method Details
-
send
Sends the given message using this connection.- Parameters:
message
- the message to be sent- Throws:
IOException
- in case of I/O errors
-
receive
Receives a message using the givenWebServiceMessageFactory
. This method blocks until it receives, or returnsnull
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
Returns the URI for this connection.- Throws:
URISyntaxException
-
hasError
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
Returns the error message.- Returns:
- the connection error message, if any; returns
null
when no error is present - Throws:
IOException
- See Also:
-
close
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 interfaceAutoCloseable
- Throws:
IOException
- if an I/O error occurs when closing this connection
-