public interface WebServiceConnection extends AutoCloseable
WebServiceMessage objects directly
to a remote party.
A WebServiceConnection can be obtained using a WebServiceMessageSender.
WebServiceMessageSender.createConnection(URI)| Modifier and Type | Method and Description |
|---|---|
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.
|
void send(WebServiceMessage message) throws IOException
message - the message to be sentIOException - in case of I/O errorsWebServiceMessage receive(WebServiceMessageFactory messageFactory) throws IOException
WebServiceMessageFactory. This method blocks until it receives, or
returns null when no message is received.messageFactory - the message factory used for reading messagesnull if no message receivedIOException - in case of I/O errorsURI getUri() throws URISyntaxException
URISyntaxExceptionboolean hasError()
throws IOException
true if this connection has an error; false otherwise.IOExceptionString getErrorMessage() throws IOException
null when no error is presentIOExceptionhasError()void close()
throws IOException
Once a connection has been closed, it is not available for further use. A new connection needs to be created.
close in interface AutoCloseableIOException - if an I/O error occurs when closing this connectionCopyright © 2023 VMware, Inc.. All rights reserved.