Class SoapConnection
java.lang.Object
com.oracle.bedrock.runtime.remote.windows.winrm.SoapConnection
This class encapsulate the sending of a SOAP message and
the processing of the response. This encapsulation is
primarily to allow mocks and stubs to be used for testing.
Copyright (c) 2015. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
- Author:
- Jonathan Knight
-
Constructor Summary
ConstructorsConstructorDescriptionSoapConnection(String hostName, int port, String servicePath, String userName, Authentication authentication, com.oracle.bedrock.Option... options) Create aSoapConnectionthat uses the specified connection details. -
Method Summary
Modifier and TypeMethodDescriptionObtain the user name used by thisSoapConnectionto connect to the SOAP service.getSOAPBodyContents(InputStream stream) Un-marshall the SOAP response from the specifiedInputStream.getUrl()Obtain theURLod the SOAP service.Obtain the user name used by thisSoapConnectionto connect to the SOAP service.send(org.w3c.soap.envelope.Envelope envelope) Send the specified SOAPEnvelopeto the SOAP service listening on the specifiedURL.send(org.w3c.soap.envelope.Envelope envelope, HttpURLConnection httpConnection) Send the specified SOAPEnvelopeto the SOAP service listening on the specifiedHttpURLConnection.
-
Constructor Details
-
SoapConnection
public SoapConnection(String hostName, int port, String servicePath, String userName, Authentication authentication, com.oracle.bedrock.Option... options) Create aSoapConnectionthat uses the specified connection details.- Parameters:
hostName- the host name of the host running the SOAP serviceport- the port that the SOAP service is listening onservicePath- the service pathuserName- the name of the user to use to connect to the WinRM serviceauthentication- the authentication to use to connect to the WinRMoptions- theOptions controlling the session
-
-
Method Details
-
getUrl
Obtain theURLod the SOAP service.- Returns:
- the
URLod the SOAP service
-
getUserName
Obtain the user name used by thisSoapConnectionto connect to the SOAP service.- Returns:
- the user name used by this
SoapConnectionto connect to the SOAP service
-
getAuthentication
Obtain the user name used by thisSoapConnectionto connect to the SOAP service.- Returns:
- the user name used by this
SoapConnectionto connect to the SOAP service
-
send
Send the specified SOAPEnvelopeto the SOAP service listening on the specifiedURL.- Parameters:
envelope- theEnvelopeto send- Returns:
- the un-marshaled result returned from the SOAP service
- Throws:
IOException- if an error occurs
-
send
protected List<Object> send(org.w3c.soap.envelope.Envelope envelope, HttpURLConnection httpConnection) throws IOException Send the specified SOAPEnvelopeto the SOAP service listening on the specifiedHttpURLConnection.- Parameters:
envelope- the SOAPEnvelopeto sendhttpConnection- theHttpURLConnectionto send the message to- Returns:
- the response from the SOAP service
- Throws:
IOException- if an error occurs
-
getSOAPBodyContents
protected List<Object> getSOAPBodyContents(InputStream stream) throws javax.xml.bind.JAXBException, IOException, SoapFaultException Un-marshall the SOAP response from the specifiedInputStream.- Parameters:
stream- theInputStreamcontaining the XML to un-marshall- Returns:
- the un-marshaled JAXB objects
- Throws:
javax.xml.bind.JAXBException- when the contents can't be parsedIOException- when the IO stream failsSoapFaultException- when SOAP connection fails
-