Class WSConnection<C extends BrowseContext>

    • Field Detail

      • URL_PROPERTY

        public static final String URL_PROPERTY
        connection property which users can use to change/specify the base url
        See Also:
        Constant Field Values
      • USERNAME_PROPERTY

        public static final String USERNAME_PROPERTY
        connection property which users can use to set the username
        See Also:
        Constant Field Values
      • PASSWORD_PROPERTY

        public static final String PASSWORD_PROPERTY
        connection property which users can use to set the password
        See Also:
        Constant Field Values
      • AUTH_TYPE_PROPERTY

        public static final String AUTH_TYPE_PROPERTY
        connection property which users can use to set the authentication type
        See Also:
        Constant Field Values
      • WS_SECURITY_PROPERTY

        public static final String WS_SECURITY_PROPERTY
        connection property which users can use to set the WS-Security options
        See Also:
        Constant Field Values
      • DEFAULT_SUCCESS_CODE

        public static final String DEFAULT_SUCCESS_CODE
        default status code used for successful response documents
        See Also:
        Constant Field Values
    • Constructor Detail

      • WSConnection

        public WSConnection​(C context)
    • Method Detail

      • getUrl

        public String getUrl()
        Returns the currently configured url for the web service.

        The default implementation generates the value with a call to getUrlFromContext and caches this value for re-use on subsequent calls.

      • getUsername

        public String getUsername()
        Returns the username configured for this connection.

        The default implementation returns the connector property with the key USERNAME_PROPERTY.

      • getPassword

        public String getPassword()
        Returns the password configured for this connection.

        The default implementation returns the connector property with the key PASSWORD_PROPERTY.

      • getWSSecurityInfo

        public com.boomi.webservices.WSSecurityInfo getWSSecurityInfo()
      • getDefaultUrl

        public String getDefaultUrl()
        Returns the "default" url for this web service to be used if none has been configured.

        Default implementation returns null.

      • getUrlFromContext

        protected String getUrlFromContext()
        Returns the url configured for this connection.

        Default implementation returns the connection property with the key URL_PROPERTY if non-blank, otherwise returns the value given by getDefaultUrl().

        Throws:
        ConnectorException - if a valid url can not be found for the web service
      • configureCustomWSSecurity

        protected void configureCustomWSSecurity​(com.boomi.webservices.WebServiceExecutor executor)
      • configureBasicAuthSecurity

        protected void configureBasicAuthSecurity​(com.boomi.webservices.WebServiceExecutor executor)
        Configures the given WebServiceExecutor for "http basic auth" security support using the username and password retrieved from calls to getUsername() and getPassword().
      • configureBasicAuthNonPreemptiveSecurity

        protected void configureBasicAuthNonPreemptiveSecurity​(com.boomi.webservices.WebServiceExecutor executor)
        Configures the given WebServiceExecutor for "http basic auth" security support using the username and password retrieved from calls to getUsername() and getPassword().
      • configureUsernameWSSecurity

        protected void configureUsernameWSSecurity​(UserTokenPasswordType pwdType,
                                                   com.boomi.webservices.WebServiceExecutor executor)
        Configures the given WebServiceExecutor for "WSSecurity username" security support (for the given password type) using the username and password retrieved from calls to getUsername() and getPassword().
      • isFatalException

        public boolean isFatalException​(Throwable t)
        Called by operation implementations to determine if the given Throwable is "fatal". Fatal exceptions will cause the entire operation to be aborted, whereas non-fatal exceptions will only fail the current input data.

        Default implementation returns false.

      • isApplicationFault

        public boolean isApplicationFault​(com.boomi.webservices.WebServiceResponse wsResponse)
        Called by operation implementations to determine if the given WebServiceResponse (which is a "fault" response) is an OperationStatus.APPLICATION_ERROR or an OperationStatus.FAILURE. See the sdk documentation for more details on application errors.

        Default implementation returns true.

      • getSuccessCode

        public String getSuccessCode()
        Returns the status code to use for successful responses. Called by operation implementations when returning successful results.

        Default implementation returns DEFAULT_SUCCESS_CODE.

      • getSuccessMessage

        public String getSuccessMessage()
        Returns the status message to use for successful responses. Called by operation implementations when returning successful results.

        Default implementation returns null.

      • getErrorCode

        public String getErrorCode​(com.boomi.webservices.WebServiceResponse wsResponse)
        Returns the error status code for the given fault response. Called by operation implementations when returning error results.

        Detail implementation returns WebServiceResponse.getErrorCode().

      • getErrorMessage

        public String getErrorMessage​(com.boomi.webservices.WebServiceResponse wsResponse)
        Returns the error status message for the given fault response. Called by operation implementations when returning error results.

        Detail implementation returns WebServiceResponse.getRawErrorMessage() with any detail strings appended to it.

      • toPayload

        public Payload toPayload​(com.boomi.webservices.WebServiceResponse wsResponse)
                          throws com.boomi.webservices.WebServiceException
        Returns a Payload appropriate for the given WebServiceResponse. Called by operation implementations to convert a WebServiceResponse into a result document. May return null.

        Default implementation returns the response body converted to a Payload (using the most efficient conversion possible) if there is a body, null otherwise.

        Throws:
        com.boomi.webservices.WebServiceException
      • appendErrorDetail

        protected static void appendErrorDetail​(Element detail,
                                                StringBuilder sb,
                                                List<String> path)
        Appends any non-empty details to the given StringBuilder. Details will be appended using the format: "; <detailName>=<detailValue>". Detail names will be generated by joining the element names with a '.' character. For example, the detail element of "<error><code>1234</code></error>" will result in the appended string "; error.code=1234".