Class HttpSoapConnection

  • All Implemented Interfaces:
    IConnection, ISoapConnection

    public class HttpSoapConnection
    extends AbstractSoapClient
    implements ISoapConnection
    Class providing a simple implementation to interact with http SOAP interfaces. Soap 1.1 with basic http authentication is supported.

    In version 9.0 this class has been renamed from SoapClient to HttpSoapConnection.

    Since:
    5.1
    Author:
    Jon van Leuven
    • Constructor Detail

      • HttpSoapConnection

        public HttpSoapConnection​(IHttpConnection connection)
        Create a http soap connection with a specified http connection.
        Parameters:
        connection - The http connection (required).
      • HttpSoapConnection

        public HttpSoapConnection​(String name,
                                  String url)
        Create a http soap connection for a specific Url.
        Parameters:
        name - The name of this connection (required).
        url - The url of the webservice (required).
      • HttpSoapConnection

        public HttpSoapConnection​(String name,
                                  String url,
                                  String username,
                                  String password)
        Create a http soap connection for a specific Url with basic http authorization. With http authorization the username and password will be send in the http request header using base64 encoding.
        Parameters:
        name - The name of this connection (required).
        url - The url of the webservice (required).
        username - The username used for authorization when connecting to the url.
        password - The password used for authorization when connecting to the url.
    • Method Detail

      • getUrl

        public String getUrl()
        Description copied from interface: ISoapConnection
        This method returns the url used for connecting to the endpoint.
        Specified by:
        getUrl in interface ISoapConnection
        Returns:
        The url
      • invoke

        public void invoke​(ISoapRequest request,
                           ISoapResponseHandler responseHandler)
                    throws IOException
        Description copied from interface: ISoapConnection
        Send an xml request to a SOAP endpoint by providing the header and body elements. This method will create a soap 1.1 envelope with the provided elements and sends it to the soap endpoint.
        Specified by:
        invoke in interface ISoapConnection
        Specified by:
        invoke in class AbstractSoapClient
        Parameters:
        request - The soap request responsible for creating the request, may not be null.
        responseHandler - The handler that is used when the connection handles the response.
        Throws:
        IOException - When an error occurs connecting to SOAP endpoint.