Package org.frankframework.http
Class HttpSender
java.lang.Object
org.frankframework.http.AbstractHttpSession
org.frankframework.http.AbstractHttpSender
org.frankframework.http.HttpSender
- All Implemented Interfaces:
CanUseSharedResource<HttpSession>,FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IScopeProvider,ISender,ISenderWithParameters,IWithParameters,NameAware,HasKeystore,HasTruststore,ConfigurableLifecycle,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
- Direct Known Subclasses:
WebServiceSender
- Since:
- 7.0
- Version:
- 2.0
- Author:
- Niels Meijer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.frankframework.http.AbstractHttpSender
AbstractHttpSender.HttpMethodNested classes/interfaces inherited from class org.frankframework.http.AbstractHttpSession
AbstractHttpSession.OauthAuthenticationMethod -
Field Summary
Fields inherited from class org.frankframework.http.AbstractHttpSender
CORRELATION_ID_HEADER, headerParamsSet, MESSAGE_ID_HEADER, parametersToSkipWhenEmptySet, paramList, requestOrBodyParamsSet, staticUri, urlParameterFields inherited from class org.frankframework.http.AbstractHttpSession
AUTHENTICATION_METHOD_KEY, logFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this component.protected org.apache.http.client.methods.HttpRequestBasecreateRequestMethod(URI uri, Message message, ParameterValueList parameters, PipeLineSession session) Returns HttpRequestBase, with (optional) RAW or as BINARY contentprotected MessageextractResult(HttpResponseHandler responseHandler, PipeLineSession session) Custom implementation to extract the response and format it to a String result.protected org.apache.http.client.methods.HttpRequestBasegetMethod(URI url, Message message, ParameterValueList parameters, PipeLineSession session) Custom implementation to create aHttpRequestobject.getResponseBody(HttpResponseHandler responseHandler) voidsetEncodeMessages(boolean b) Specifies whether messages will encoded, e.g. spaces will be replaced by '+' etc.voidsetFirstBodyPartName(String firstBodyPartName) (Only used whenmethodType=POSTandpostType=URLENCODED,FORM-DATAorMTOM) Prepends a new BodyPart using the specified name and uses the input of the Sender as contentvoidsetMtomContentTransferEncoding(String mtomContentTransferEncoding) voidsetMultipartXmlSessionKey(String multipartXmlSessionKey) If set andmethodType=POSTandparamsInUrl=false, a multipart/form-data entity is created instead of a request body.voidsetPostType(HttpEntityType type) IfmethodType=POST,PUTorPATCH, the type of post requestvoidIftrue, the input will be added to the URL formethodType=GET, or formethodType=POST,PUTorPATCHifpostType=RAW.Methods inherited from class org.frankframework.http.AbstractHttpSender
addParameter, appendParameters, getCredentials, getLogPrefix, getOauthAuthenticationMethod, getObjectType, getParameterList, getPhysicalDestinationName, getTokenEndpoint, sendMessage, setCharSet, setContentType, setHeadersParams, setMethodType, setParametersToSkipWhenEmpty, setResultStatusCodeSessionKey, setStyleSheetName, setUrl, setUrlParam, setXhtml, start, stop, validateResponseCodeMethods inherited from class org.frankframework.http.AbstractHttpSession
areCookiesDisabled, execute, getDomainAwareCredentials, getSSLConnectionSocketFactory, getURI, isRunning, setAllowSelfSignedCertificates, setAuthAlias, setAuthDomain, setAuthenticatedTokenRequest, setClientAlias, setClientId, setClientSecret, setConnectionIdleTimeout, setConnectionTimeToLive, setDisableCookies, setFollowRedirects, setHttpClient, setHttpContext, setIgnoreCertificateExpiredException, setIgnoreRedirects, setKeyManagerAlgorithm, setKeystore, setKeystoreAlias, setKeystoreAliasAuthAlias, setKeystoreAliasPassword, setKeystoreAuthAlias, setKeystorePassword, setKeystoreType, setMaxConnections, setMaxExecuteRetries, setOauthAuthenticationMethod, setPassword, setPrefillProxyAuthCache, setProtocol, setProxyAuthAlias, setProxyHost, setProxyPassword, setProxyPort, setProxyRealm, setProxyUsername, setSamlAssertionExpiry, setSamlAudience, setSamlIssuer, setSamlNameId, setScope, setStaleChecking, setStaleTimeout, setSupportedCipherSuites, setTimeout, setTokenEndpoint, setTokenExpiry, setTrustManagerAlgorithm, setTruststore, setTruststoreAuthAlias, setTruststorePassword, setTruststoreType, setUsername, setVerifyHostnameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.CanUseSharedResource
getSharedResource, setSharedResourceRefMethods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle
getPhase, isAutoStartup, isConfiguredMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.encryption.HasKeystore
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreTypeMethods inherited from interface org.frankframework.encryption.HasTruststore
getTrustManagerAlgorithm, getTruststore, getTruststoreAuthAlias, getTruststorePassword, getTruststoreType, isAllowSelfSignedCertificates, isIgnoreCertificateExpiredException, isVerifyHostnameMethods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrowMethods inherited from interface org.frankframework.core.ISenderWithParameters
consumesSessionVariableMethods inherited from interface org.springframework.context.Lifecycle
isRunningMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
HttpSender
public HttpSender()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractHttpSender- Throws:
ConfigurationException- in case it was not able to configure the component.
-
getMethod
protected org.apache.http.client.methods.HttpRequestBase getMethod(URI url, Message message, @Nonnull ParameterValueList parameters, PipeLineSession session) throws SenderException Description copied from class:AbstractHttpSenderCustom implementation to create aHttpRequestobject.- Specified by:
getMethodin classAbstractHttpSender- Parameters:
url- endpoint to send the message tomessage- to be sentparameters- ParameterValueList that contains all the senders parameterssession- PipeLineSession to retrieve or store data from, or NULL when not set- Returns:
- a
HttpRequestobject - Throws:
SenderException
-
createRequestMethod
protected org.apache.http.client.methods.HttpRequestBase createRequestMethod(URI uri, Message message, @Nonnull ParameterValueList parameters, PipeLineSession session) throws SenderException Returns HttpRequestBase, with (optional) RAW or as BINARY content- Throws:
SenderException
-
extractResult
protected Message extractResult(HttpResponseHandler responseHandler, PipeLineSession session) throws SenderException, IOException Description copied from class:AbstractHttpSenderCustom implementation to extract the response and format it to a String result.
It is important that theresponsewill be read or will beclosed.- Specified by:
extractResultin classAbstractHttpSender- Parameters:
responseHandler-HttpResponseHandlerthat contains the response informationsession-PipeLineSessionwhich may be null- Returns:
- a string that will be passed to the pipeline
- Throws:
SenderExceptionIOException
-
getResponseBody
-
setPostType
IfmethodType=POST,PUTorPATCH, the type of post request- Default value
- RAW
-
setFirstBodyPartName
(Only used whenmethodType=POSTandpostType=URLENCODED,FORM-DATAorMTOM) Prepends a new BodyPart using the specified name and uses the input of the Sender as content -
setMultipartXmlSessionKey
If set andmethodType=POSTandparamsInUrl=false, a multipart/form-data entity is created instead of a request body. For each part element in the session key a part in the multipart entity is created. Part elements can contain the following attributes:- name: optional, used as 'filename' in Content-Disposition
- sessionKey: mandatory, refers to contents of part
- value: optional, the contents of the part if the sessionKey specified contains no data
- mimeType: optional MIME type
-
setMtomContentTransferEncoding
-
setEncodeMessages
public void setEncodeMessages(boolean b) Specifies whether messages will encoded, e.g. spaces will be replaced by '+' etc.- Default value
- false
-
setTreatInputMessageAsParameters
Iftrue, the input will be added to the URL formethodType=GET, or formethodType=POST,PUTorPATCHifpostType=RAW. This used to be the default behaviour in framework version 7.7 and earlier- Default value
- for methodType=
GET:false,
for methodTypesPOST,PUT,PATCH:true
-