Christian Oestreich

   two guys in design - software.development.professional

Grails Cxf Client 1.2.7 Released

| Comments

The Grails cxf-client plugin has been updated to version 1.2.7. I have added the ability to specify timeouts (connection and receive) and allow chunking separately through params and also provided another parameter to pass the client name of an HTTPClientPolicy bean to use instead of setting the params seperately.

Updated Parameter Documentation

The following partial documentation is available in full at https://github.com/Grails-Plugin-Consortium/grails-cxf-client

Property Description Required
connectionTimeout Specifies the amount of time, in milliseconds, that the client will attempt to establish a connection before it times out. The default is 30000 (30 seconds). 0 specifies that the client will continue to attempt to open a connection indefinitely. (default: 30000) No
receiveTimeout Specifies the amount of time, in milliseconds, that the client will wait for a response before it times out. The default is 60000. 0 specifies that the client will wait indefinitely. (default: 60000) No
allowChunking If true will set the HTTPClientPolicy allowChunking for the clients proxy to true. (default: false) No
httpClientPolicy Instead of using the seperate timeout, chunking, etc values you can create your own HTTPClientPolicy bean in resources.groovy and pass the name of the bean here. This will override the connectionTimeout, receiveTimeout and allowChunking values. (default: null) No

Timeout And Chunking Parameters

Here is an example cxf client configuration block using the connectionTimeout, receiveTimeout and allowChunking parameters:

Config.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cxf {
    installDir = "C:/apps/apache-cxf-2.4.2" //only used for wsdl2java script target
    client {
        simpleServiceClient {
            wsdl = "docs/SimpleService.wsdl" //only used for wsdl2java script target
            wsdlArgs = "-autoNameResolution"
            clientInterface = cxf.client.demo.simple.SimpleServicePortType
            serviceEndpointAddress = "${service.simple.url}"
            namespace = "cxf.client.demo.simple"
            receiveTimeout = 0 //no timeout
            connectionTimeout = 0 //no timeout
            allowChunking = false
        }
    }
}

HTTPClientPolicy Parameter

Here is an example cxf client configuration block using the httpClientPolicy config parameter:

resources.groovy
1
2
3
4
5
6
7
8
beans = {
    customHttpClientPolicy(HTTPClientPolicy){
        connectionTimeout = 30000
        receiveTimeout = 60000
        allowChunking = false
        autoRedirect = false
    }
}
Config.groovy
1
2
3
4
5
6
7
8
9
cxf {
    installDir = "C:/apps/apache-cxf-2.4.2" //only used for wsdl2java script target
    client {
        simpleServiceClient {
            clientInterface = cxf.client.demo.simple.SimpleServicePortType
            serviceEndpointAddress = "${service.simple.url}"
            httpClientPolicy = 'customHttpClientPolicy'
        }
}

Comments