Christian Oestreich

   two guys in design - software.development.professional

Grails Cxf Client 1.2.5 Changes

| Comments

Based on a user request, I have added the ability to pass the wsdl2java script a wsdlArgs param in which you can use to pass custom args into the client creation process. I have also modified the name of the bindingFile parameter as the name binding was in conflict with groovy reserved keywords.

PropertyDescriptionRequired
wsdlLocation of the wsdl either locally relative to project home dir or a url. (default: “”)No
wsdlArgsA custom list of args to pass in seperated by space such as [“-autoNameResolution”,”-validate”]. This can also be a single string value such as “-autoNameResolution”, but when using multiple custom params you must specify each in a list [“-one val”,”-two”,”-three val”] due to limitations with ant. (default: “”)No
namespaceSpecifies package names to use for the generated code. (default: “use wsdl provided schema”)No
clientUsed to tell wsdl2java to output sample clients, usually not needed. (default: false)No
bindingFilePath of binding file to pass to wsdl2java. (default: “”)No
outputDirPassword to pass along with request in wss4j interceptor when secured is true. (default: “src/java”)No

Here is an example cxf client configuration block using the new wsdlArgs param.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cxf {
    installDir = "C:/apps/apache-cxf-2.4.2" //only used for wsdl2java script target
    client {
        simpleServiceClient {
            //used in wsdl2java
            wsdl = "docs/SimpleService.wsdl" //only used for wsdl2java script target
            wsdlArgs = ['-autoNameResolution', '-validate']
            //wsdlArgs = '-autoNameResolution' //single param style
            namespace = "cxf.client.demo.simple"
            client = false //defaults to false
            bindingFile = "grails-app/conf/bindings.xml"
            outputDir = "src/java"

            //used for invoking service
            clientInterface = cxf.client.demo.simple.SimpleServicePortType
            serviceEndpointAddress = "${service.simple.url}"
        }
    }
}

Comments