The elements used to configure an HTTP provider endpoint are defined in the namespace http://cxf.apache.org/transports/http/configuration
. It is commonly referred to using the prefix http-conf
. In order to use the HTTP configuration elements you must add the lines shown in Example 8.9 to the beans
element of your endpoint's configuration file. In addition, you must add the configuration elements' namespace to the xsi:schemaLocation
attribute.
Example 8.9. HTTP Provider Configuration Namespace
<beans ... xmlns:http-conf="http://cxf.apache.org/transports/http/configuration ... xsi:schemaLocation="... http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd ...>
You configure an HTTP service provider endpoint using the http-conf:destination
element and its children. The http-conf:destination
element takes a single attribute, name
, that specifies the WSDL port
element that corresponds to the endpoint. The value for the name
attribute takes the form portQName
.http-destination
. Example 8.10 shows the http-conf:destination
element that is used to add configuration for an endpoint that is specified by the WSDL fragment <port binding="widgetSOAPBinding" name="widgetSOAPPort> when the endpoint's target namespace is http://widgets.widgetvendor.net
.
Example 8.10. http-conf:destination
Element
... <http-conf:destination name="{http://widgets/widgetvendor.net}widgetSOAPPort.http-destination> ... </http-conf:destination> ...
The http-conf:destination
element has a number of child elements that specify configuration information. They are described in Table 8.4.
Table 8.4. Elements Used to Configure an HTTP Service Provider Endpoint
Element | Description |
---|---|
http-conf:server
|
Specifies the HTTP connection properties. See The |
http-conf:contextMatchStrategy
|
Specifies the parameters that configure the context match strategy for processing HTTP requests. |
http-conf:fixedParameterOrder
|
Specifies whether the parameter order of an HTTP request handled by this destination is fixed. |
The http-conf:server
element is used to configure the properties of a service provider endpoint's HTTP connection. Its attributes, described in Table 8.5, specify the connection's properties.
Table 8.5. HTTP Service Provider Configuration Attributes
Attribute | Description |
---|---|
ReceiveTimeout
|
Sets the length of time, in milliseconds, the service provider attempts to receive a request before the connection times out. The default is
|
SuppressClientSendErrors
|
Specifies whether exceptions are to be thrown when an error is encountered on receiving a request. The default is |
SuppressClientReceiveErrors
|
Specifies whether exceptions are to be thrown when an error is encountered on sending a response to a consumer. The default is |
HonorKeepAlive
|
Specifies whether the service provider honors requests for a connection to remain open after a response has been sent. The default is |
RedirectURL
|
Specifies the URL to which the client request should be redirected if the URL specified in the client request is no longer appropriate for the requested resource. In this case, if a status code is not automatically set in the first line of the server response, the status code is set to |
CacheControl
|
Specifies directives about the behavior that must be adhered to by caches involved in the chain comprising a response from a service provider to a consumer. See Service Provider Cache Control Directives. |
ContentLocation
|
Sets the URL where the resource being sent in a response is located. |
ContentType
|
Specifies the media type of the information being sent in a response. Media types are specified using multipurpose internet mail extensions (MIME) types. The value is used as the value of the HTTP ContentType location. |
ContentEncoding
|
Specifies any additional content encodings that have been applied to the information being sent by the service provider. Content encoding labels are regulated by the Internet Assigned Numbers Authority (IANA). Possible content encoding values include The primary use of content encodings is to allow documents to be compressed using some encoding mechanism, such as zip or gzip. FUSE Services Framework performs no validation on content codings. It is the user’s responsibility to ensure that a specified content coding is supported at application level. |
ServerType
|
Specifies what type of server is sending the response. Values take the form |
Example 8.11 shows the configuration for an HTTP service provider endpoint that honors keep-alive requests and suppresses all communication errors.
Example 8.11. HTTP Service Provider Endpoint Configuration
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <http-conf:destination name="{http://apache.org/hello_world_soap_http}SoapPort.http-destination"> <http-conf:server SuppressClientSendErrors="true" SuppressClientReceiveErrors="true" HonorKeepAlive="true" /> </http-conf:destination> </beans>