├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── settings.gradle.kts ├── src ├── test │ ├── resources │ │ ├── axis1 │ │ │ ├── wsrpservice │ │ │ │ ├── NStoPkg.properties │ │ │ │ ├── wsrp_service.wsdl │ │ │ │ └── xml.xsd │ │ │ ├── jaxrpc-sample │ │ │ │ ├── HelloWorld.wsdl │ │ │ │ └── Address.wsdl │ │ │ ├── jms-sample │ │ │ │ └── GetQuote.wsdl │ │ │ └── addressbook │ │ │ │ └── AddressBook.wsdl │ │ └── axis2 │ │ │ ├── mtom │ │ │ ├── xmime.xsd │ │ │ └── MTOMSample.wsdl │ │ │ ├── databinding │ │ │ ├── StockQuote.xsd │ │ │ └── StockQuoteService.wsdl │ │ │ ├── quickstartadb │ │ │ └── StockQuoteService.wsdl │ │ │ ├── quickstartjibx │ │ │ └── StockQuoteService.wsdl │ │ │ ├── quickstartxmlbeans │ │ │ └── StockQuoteService.wsdl │ │ │ ├── faulthandling │ │ │ └── bank.wsdl │ │ │ └── addnumberservice │ │ │ └── AddNumbersService.wsdl │ └── groovy │ │ └── com │ │ └── intershop │ │ └── gradle │ │ └── wsdl │ │ ├── WSDLPluginSpec.groovy │ │ ├── Axis1IntegrationSpec.groovy │ │ ├── Axis1IntegrationKtsSpec.groovy │ │ └── Axis2IntegrationSpec.groovy └── main │ └── kotlin │ └── com │ └── intershop │ └── gradle │ └── wsdl │ ├── utils │ ├── DeployScope.kt │ └── Databinding.kt │ ├── tasks │ ├── axis2 │ │ ├── WSDL2JavaParameters.kt │ │ └── WSDL2JavaRunner.kt │ └── AbstractWSDL2Java.kt │ ├── extension │ ├── data │ │ ├── WSDLProperty.kt │ │ └── NamespacePackageMapping.kt │ ├── WSDLExtension.kt │ ├── AbstractAxisConfig.kt │ ├── Axis2.kt │ └── Axis1.kt │ └── WSDLPlugin.kt ├── .gitignore ├── .github └── workflows │ ├── build.yml │ └── release.yml ├── gradlew.bat ├── gradlew ├── LICENSE.md └── license-2.0.txt /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freynder/wsdl-gradle-plugin/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-XX:+UseConcMarkSweepGC -XX:MaxMetaspaceSize=3G -XX:-UseGCOverheadLimit -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.gradle.enterprise").version("3.0") 3 | } 4 | 5 | gradleEnterprise { 6 | buildScan { 7 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 8 | termsOfServiceAgree = "yes" 9 | } 10 | } 11 | 12 | rootProject.name = "wsdl-gradle-plugin" -------------------------------------------------------------------------------- /src/test/resources/axis1/wsrpservice/NStoPkg.properties: -------------------------------------------------------------------------------- 1 | urn\:oasis\:names\:tc\:wsrp\:v1\:types=oasis.names.tc.wsrp.v1.types 2 | urn\:oasis\:names\:tc\:wsrp\:v1\:intf=oasis.names.tc.wsrp.v1.intf 3 | urn\:oasis\:names\:tc\:wsrp\:v1\:bind=oasis.names.tc.wsrp.v1.bind 4 | urn\:oasis\:names\:tc\:wsrp\:v1\:wsdl=oasis.names.tc.wsrp.v1.wsdl 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IntelliJ project files 2 | .idea 3 | *.iml 4 | out 5 | gen 6 | 7 | # Eclipse project files 8 | .classpath 9 | .project 10 | .settings 11 | 12 | # Gradle Files 13 | .gradle 14 | /build 15 | 16 | # Ignore Gradle GUI config 17 | gradle-app.setting 18 | 19 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 20 | !gradle-wrapper.jar 21 | /bin/ 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/utils/DeployScope.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.utils 17 | 18 | /** 19 | * Enumation for the deploy scope configuration. 20 | */ 21 | enum class DeployScope(val scope: String) { 22 | 23 | APPLICATION("Application"), 24 | REQUEST("Request"), 25 | SESSION("Session") 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/utils/Databinding.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.utils 17 | 18 | /** 19 | * Enumation for the data binding configuration. 20 | */ 21 | enum class Databinding(val binding: String) { 22 | ADB("adb"), 23 | XMLBEANS("xmlbeans"), 24 | JAXBRI("jaxbri"), 25 | JIBX("jibx"), 26 | NONE("none") 27 | } 28 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/tasks/axis2/WSDL2JavaParameters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.tasks.axis2 17 | 18 | import org.gradle.api.provider.ListProperty 19 | import org.gradle.workers.WorkParameters 20 | 21 | /** 22 | * Parameters container for task worker. 23 | */ 24 | interface WSDL2JavaParameters : WorkParameters { 25 | 26 | /** 27 | * List of all parameters of wsdl code 28 | * generation. 29 | */ 30 | val paramList: ListProperty 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/tasks/axis2/WSDL2JavaRunner.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.tasks.axis2 17 | 18 | import org.apache.axis2.wsdl.WSDL2Code 19 | import org.gradle.workers.WorkAction 20 | 21 | /** 22 | * This is the task runner for WSDL2Java. 23 | * 24 | * @constructor standard constructor of a runner. 25 | */ 26 | abstract class WSDL2JavaRunner : WorkAction { 27 | 28 | override fun execute() { 29 | WSDL2Code.main(parameters.paramList.get().toTypedArray()) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/data/WSDLProperty.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension.data 17 | 18 | import org.gradle.api.tasks.Input 19 | import org.gradle.api.tasks.Internal 20 | 21 | /** 22 | * Container for WSDL property configuration. 23 | * 24 | * @constructor default constructor with configuration name. 25 | */ 26 | open class WSDLProperty (@get:Internal val name: String) { 27 | 28 | /** 29 | * Value of the configured property. 30 | */ 31 | @get:Input 32 | var value: String = "" 33 | } 34 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/data/NamespacePackageMapping.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension.data 17 | 18 | /** 19 | * Container for namespace package mapping configuration. 20 | * 21 | * @constructor default constructor with configuration name. 22 | */ 23 | open class NamespacePackageMapping(val name: String) { 24 | 25 | /** 26 | * Name space configuration. 27 | */ 28 | var namespace: String = "" 29 | 30 | /** 31 | * Package name configuration. 32 | */ 33 | var packageName: String = "" 34 | } 35 | -------------------------------------------------------------------------------- /src/test/resources/axis1/wsrpservice/wsrp_service.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/test/resources/axis1/jaxrpc-sample/HelloWorld.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/test/resources/axis2/mtom/xmime.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/WSDLExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension 17 | 18 | import org.gradle.api.NamedDomainObjectContainer 19 | import org.gradle.api.model.ObjectFactory 20 | import javax.inject.Inject 21 | 22 | /** 23 | * Main extension of the WSDL plugin. 24 | */ 25 | open class WSDLExtension @Inject constructor(objectFactory: ObjectFactory) { 26 | 27 | companion object { 28 | /** 29 | * Extension name of plugin. 30 | */ 31 | const val WSDL_EXTENSION_NAME = "wsdl" 32 | 33 | /** 34 | * Task group name of WSDL code generation. 35 | */ 36 | const val WSDL_GROUP_NAME = "WSDL Code Generation" 37 | 38 | /** 39 | * Configuration name of Axis 1. 40 | */ 41 | const val WSDL_AXIS1_CONFIGURATION_NAME = "wsdlAxis1" 42 | 43 | /** 44 | * Configuration name of Axis 2. 45 | */ 46 | const val WSDL_AXIS2_CONFIGURATION_NAME = "wsdlAxis2" 47 | 48 | /** 49 | * Folder names for generated java files. 50 | **/ 51 | const val CODEGEN_OUTPUTPATH = "generated/wsdl2java" 52 | } 53 | 54 | /** 55 | * Container for axis1 generation configurations. 56 | */ 57 | val axis1: NamedDomainObjectContainer = objectFactory.domainObjectContainer(Axis1::class.java) 58 | 59 | /** 60 | * Container for axis2 generation configurations. 61 | */ 62 | val axis2: NamedDomainObjectContainer = objectFactory.domainObjectContainer(Axis2::class.java) 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/test/resources/axis2/databinding/StockQuote.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/test/resources/axis2/databinding/StockQuoteService.wsdl: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: Run build and tests 5 | 6 | on: 7 | push: 8 | branches: 9 | - '*' 10 | pull_request: 11 | branches: [ master ] 12 | 13 | jobs: 14 | build: 15 | environment: CIRelease 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Set up JDK 11 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: 11 23 | - uses: actions/checkout@v2 24 | with: 25 | fetch-depth: 0 26 | - run: git fetch --all --tags 27 | 28 | - name: Create .gradle dir 29 | run: mkdir -p $HOME/.gradle 30 | - name: Install gpg secret key 31 | env: 32 | SIGNINGFILE: ${{ secrets.SIGNINGFILE }} 33 | run: | 34 | cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import 35 | gpg --list-secret-keys --keyid-format LONG 36 | - name: Export gpg file 37 | env: 38 | SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} 39 | SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} 40 | run: | 41 | gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg 42 | - name: Create gradle sproperties 43 | env: 44 | APIKEY: ${{ secrets.APIKEY }} 45 | APISECRET: ${{ secrets.APISECRET }} 46 | SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} 47 | SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} 48 | SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} 49 | SONATYPEUSER: ${{ secrets.SONATYPEUSER }} 50 | run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties 51 | - name: Build and test with Gradle 52 | env: 53 | ISHUSERNAME: ${{ secrets.ISHUSERNAME }} 54 | ISHKEY: ${{ secrets.ISHKEY }} 55 | JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M" 56 | GRADLE_OPTS: "-Dorg.gradle.daemon=true" 57 | run: ./gradlew test build :publishIntershopMvnPublicationToMavenRepository -s --scan 58 | - name: Publish Unit Test Results 59 | uses: EnricoMi/publish-unit-test-result-action/composite@v1 60 | if: always() 61 | with: 62 | files: build/test-results/**/*.xml 63 | - name: Post Build 64 | run: rm -f $HOME/.gradle/gradle.properties && rm -f $HOME/.docker/config.json 65 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: Run release build from tag 5 | 6 | on: 7 | push: 8 | tags: 9 | - '*' 10 | 11 | jobs: 12 | release: 13 | environment: CIRelease 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Set up JDK 11 18 | uses: actions/setup-java@v1 19 | with: 20 | java-version: 11 21 | - uses: actions/checkout@v2 22 | with: 23 | fetch-depth: 0 24 | - run: git fetch --all --tag 25 | - name: Create .gradle dir 26 | run: mkdir -p $HOME/.gradle 27 | - id: install-secret-key 28 | name: Install gpg secret key 29 | env: 30 | SIGNINGFILE: ${{ secrets.SIGNINGFILE }} 31 | run: | 32 | cat <(echo -e "${{ secrets.SIGNINGFILE }}") | gpg --batch --import 33 | gpg --list-secret-keys --keyid-format LONG 34 | - id: export-gpg-file 35 | name: Export gpg file 36 | env: 37 | SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} 38 | SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} 39 | run: | 40 | gpg --batch --passphrase="$SIGNINGPASSWORD" --pinentry-mode loopback --export-secret-keys $SIGNINGKEYID > $HOME/.gradle/secrets.gpg 41 | - name: Create gradle sproperties 42 | env: 43 | APIKEY: ${{ secrets.APIKEY }} 44 | APISECRET: ${{ secrets.APISECRET }} 45 | SIGNINGKEYID: ${{ secrets.SIGNINGKEYID }} 46 | SIGNINGPASSWORD: ${{ secrets.SIGNINGPASSWORD }} 47 | SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }} 48 | SONATYPEUSER: ${{ secrets.SONATYPEUSER }} 49 | run: echo -e "gradle.publish.key=$APIKEY\ngradle.publish.secret=$APISECRET\nsigning.keyId=$SIGNINGKEYID\nsigning.password=$SIGNINGPASSWORD\nsigning.secretKeyRingFile=$HOME/.gradle/secrets.gpg\nsonatypeUsername=$SONATYPEUSER\nsonatypePassword=$SONATYPEPASSWORD" > $HOME/.gradle/gradle.properties 50 | - name: Run gradle release 51 | env: 52 | ISHUSERNAME: ${{ secrets.ISHUSERNAME }} 53 | ISHKEY: ${{ secrets.ISHKEY }} 54 | JAVA_OPTS: "-Xmx1024M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512M" 55 | GRADLE_OPTS: "-Dorg.gradle.daemon=true" 56 | run: ./gradlew -PrunOnCI=true test build :publishIntershopMvnPublicationToMavenRepository :publishPlugins -s --scan 57 | - name: Publish Unit Test Results 58 | uses: EnricoMi/publish-unit-test-result-action/composite@v1 59 | if: always() 60 | with: 61 | files: build/test-results/**/*.xml 62 | - name: Post Build 63 | run: rm -f $HOME/.gradle/gradle.properties 64 | -------------------------------------------------------------------------------- /src/test/resources/axis1/jms-sample/GetQuote.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 | 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if %ERRORLEVEL% equ 0 goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if %ERRORLEVEL% equ 0 goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | set EXIT_CODE=%ERRORLEVEL% 84 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 85 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 86 | exit /b %EXIT_CODE% 87 | 88 | :mainEnd 89 | if "%OS%"=="Windows_NT" endlocal 90 | 91 | :omega 92 | -------------------------------------------------------------------------------- /src/test/resources/axis1/jaxrpc-sample/Address.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/test/resources/axis2/quickstartadb/StockQuoteService.wsdl: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/test/resources/axis2/quickstartjibx/StockQuoteService.wsdl: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/test/resources/axis2/quickstartxmlbeans/StockQuoteService.wsdl: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/test/resources/axis1/addressbook/AddressBook.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 88 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/test/resources/axis2/mtom/MTOMSample.wsdl: -------------------------------------------------------------------------------- 1 | 19 | 20 | 31 | 32 | 35 | 37 | 38 | 39 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 61 | 62 | 63 | 65 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 94 | 96 | 97 | 99 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/test/resources/axis2/faulthandling/bank.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/test/resources/axis2/addnumberservice/AddNumbersService.wsdl: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | This service method creates the mathematical sum of two whole-number and 11 | positive summands. 12 | This service tests if the Axis2 REST support via HTTP-GET works correctly. 13 | The operation parameters of a HTTP-GET based REST request can only consist 14 | of simple types. For this reason the ComplexObjectEchoService cannot be used 15 | to test such kind of request types. 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /src/test/resources/axis1/wsrpservice/xml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | See http://www.w3.org/XML/1998/namespace.html and 7 | http://www.w3.org/TR/REC-xml for information about this namespace. 8 | 9 | This schema document describes the XML namespace, in a form 10 | suitable for import by other schema documents. 11 | 12 | Note that local names in this namespace are intended to be defined 13 | only by the World Wide Web Consortium or its subgroups. The 14 | following names are currently defined in this namespace and should 15 | not be used with conflicting semantics by any Working Group, 16 | specification, or document instance: 17 | 18 | base (as an attribute name): denotes an attribute whose value 19 | provides a URI to be used as the base for interpreting any 20 | relative URIs in the scope of the element on which it 21 | appears; its value is inherited. This name is reserved 22 | by virtue of its definition in the XML Base specification. 23 | 24 | id (as an attribute name): denotes an attribute whose value 25 | should be interpreted as if declared to be of type ID. 26 | The xml:id specification is not yet a W3C Recommendation, 27 | but this attribute is included here to facilitate experimentation 28 | with the mechanisms it proposes. Note that it is _not_ included 29 | in the specialAttrs attribute group. 30 | 31 | lang (as an attribute name): denotes an attribute whose value 32 | is a language code for the natural language of the content of 33 | any element; its value is inherited. This name is reserved 34 | by virtue of its definition in the XML specification. 35 | 36 | space (as an attribute name): denotes an attribute whose 37 | value is a keyword indicating what whitespace processing 38 | discipline is intended for the content of the element; its 39 | value is inherited. This name is reserved by virtue of its 40 | definition in the XML specification. 41 | 42 | Father (in any context at all): denotes Jon Bosak, the chair of 43 | the original XML Working Group. This name is reserved by 44 | the following decision of the W3C XML Plenary and 45 | XML Coordination groups: 46 | 47 | In appreciation for his vision, leadership and dedication 48 | the W3C XML Plenary on this 10th day of February, 2000 49 | reserves for Jon Bosak in perpetuity the XML name 50 | xml:Father 51 | 52 | 53 | 54 | 55 | This schema defines attributes and an attribute group 56 | suitable for use by 57 | schemas wishing to allow xml:base, xml:lang, xml:space or xml:id 58 | attributes on elements they define. 59 | 60 | To enable this, such a schema must import this schema 61 | for the XML namespace, e.g. as follows: 62 | <schema . . .> 63 | . . . 64 | <import namespace="http://www.w3.org/XML/1998/namespace" 65 | schemaLocation="http://www.w3.org/2001/xml.xsd"/> 66 | 67 | Subsequently, qualified reference to any of the attributes 68 | or the group defined below will have the desired effect, e.g. 69 | 70 | <type . . .> 71 | . . . 72 | <attributeGroup ref="xml:specialAttrs"/> 73 | 74 | will define a type which will schema-validate an instance 75 | element with any of those attributes 76 | 77 | 78 | 79 | In keeping with the XML Schema WG's standard versioning 80 | policy, this schema document will persist at 81 | http://www.w3.org/2005/08/xml.xsd. 82 | At the date of issue it can also be found at 83 | http://www.w3.org/2001/xml.xsd. 84 | The schema document at that URI may however change in the future, 85 | in order to remain compatible with the latest version of XML Schema 86 | itself, or with the XML namespace itself. In other words, if the XML 87 | Schema or XML namespaces change, the version of this document at 88 | http://www.w3.org/2001/xml.xsd will change 89 | accordingly; the version at 90 | http://www.w3.org/2005/08/xml.xsd will not change. 91 | 92 | 93 | 94 | 95 | 96 | Attempting to install the relevant ISO 2- and 3-letter 97 | codes as the enumerated possible values is probably never 98 | going to be a realistic possibility. See 99 | RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry 100 | at http://www.iana.org/assignments/lang-tag-apps.htm for 101 | further information. 102 | 103 | The union allows for the 'un-declaration' of xml:lang with 104 | the empty string. 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | See http://www.w3.org/TR/xmlbase/ for 129 | information about this attribute. 130 | 131 | 132 | 133 | 134 | 135 | See http://www.w3.org/TR/xml-id/ for 136 | information about this attribute. 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /src/test/groovy/com/intershop/gradle/wsdl/WSDLPluginSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl 17 | 18 | import com.intershop.gradle.test.AbstractProjectSpec 19 | import com.intershop.gradle.wsdl.extension.WSDLExtension 20 | import com.intershop.gradle.wsdl.utils.DeployScope 21 | import org.gradle.api.Plugin 22 | 23 | class WSDLPluginSpec extends AbstractProjectSpec { 24 | 25 | @Override 26 | Plugin getPlugin() { 27 | return new WSDLPlugin() 28 | } 29 | 30 | def 'should add extension named wsdl'() { 31 | when: 32 | plugin.apply(project) 33 | 34 | then: 35 | project.extensions.getByName(WSDLExtension.WSDL_EXTENSION_NAME) 36 | } 37 | 38 | def 'should add WSDL generate task for each wsdl config'() { 39 | when: 40 | plugin.apply(project) 41 | project.extensions.getByName(WSDLExtension.WSDL_EXTENSION_NAME).axis1 { 42 | testconfiguration { 43 | } 44 | } 45 | 46 | then: 47 | project.tasks.findByName("axis1Wsdl2javaTestconfiguration") 48 | 49 | when: 50 | project.extensions.getByName(WSDLExtension.WSDL_EXTENSION_NAME).axis2 { 51 | testconfiguration { 52 | } 53 | } 54 | 55 | then: 56 | project.tasks.findByName("axis2Wsdl2javaTestconfiguration") 57 | } 58 | 59 | def 'should set all parameters in task axis1'() { 60 | when: 61 | plugin.apply(project) 62 | project.extensions.getByName(WSDLExtension.WSDL_EXTENSION_NAME).axis1 { 63 | testconfiguration { 64 | noImports = true 65 | timeout = 360 66 | noWrapped = true 67 | serverSide = true 68 | skeletonDeploy = true 69 | deployScope = 'Application' 70 | generateAllClasses = true 71 | typeMappingVersion = '1.2' 72 | factory = 'TestFactory' 73 | helperGen = true 74 | userName = 'test' 75 | password = 'testp' 76 | implementationClassName = 'BlaClassName' 77 | wrapArrays = true 78 | sourceSetName = 'test' 79 | packageName = 'com.test' 80 | generateTestcase = true 81 | namespacePackageMappings { 82 | conf1 { 83 | namespace = "a" 84 | packageName = "com.intershop.a" 85 | } 86 | conf2 { 87 | namespace = "b" 88 | packageName = "com.intershop.b" 89 | } 90 | conf3 { 91 | namespace = "c" 92 | packageName = "com.intershop.c" 93 | } 94 | } 95 | namespacePackageMappingFile = project.file('wsdl/package.mapping') 96 | wsdlFile = project.file('MyFile.wsdl') 97 | args = ['-Dtest=test', '-Dtest1=test1'] as List 98 | } 99 | } 100 | com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java task = project.tasks.findByName("axis1Wsdl2javaTestconfiguration") as com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java 101 | 102 | then: 103 | task 104 | task.noImports 105 | task.timeoutConf == 360 106 | task.noWrapped 107 | task.serverSide 108 | task.skeletonDeploy 109 | task.deployScope == DeployScope.APPLICATION.scope 110 | task.generateAllClasses 111 | task.typeMappingVersion == '1.2' 112 | task.factory == 'TestFactory' 113 | task.helperGen 114 | task.userName == 'test' 115 | task.password == 'testp' 116 | task.implementationClassName == 'BlaClassName' 117 | task.wrapArrays 118 | task.packageName == 'com.test' 119 | task.generateTestcase 120 | task.namespacePackageMappingList.contains("a=com.intershop.a") 121 | task.namespacePackageMappingFile == project.file('wsdl/package.mapping') 122 | task.wsdlFile == project.file('MyFile.wsdl') 123 | task.args == ['-Dtest=test', '-Dtest1=test1'] as List 124 | } 125 | 126 | def 'should set all parameters in task axis2'() { 127 | when: 128 | plugin.apply(project) 129 | project.extensions.getByName(WSDLExtension.WSDL_EXTENSION_NAME).axis2 { 130 | testconfiguration { 131 | wsdlFile = project.file('MyFile.wsdl') 132 | packageName = 'com.intershop.wsdl' 133 | namespacePackageMappings { 134 | conf1 { 135 | namespace = "a" 136 | packageName = "com.intershop.a" 137 | } 138 | conf2 { 139 | namespace = "b" 140 | packageName = "com.intershop.b" 141 | } 142 | conf3 { 143 | namespace = "c" 144 | packageName = "com.intershop.c" 145 | } 146 | } 147 | namespacePackageMappingFile = project.file('wsdl/package.mapping') 148 | unwrapParams = true 149 | generateAllClasses = true 150 | addArg('testParameter') 151 | 152 | } 153 | } 154 | com.intershop.gradle.wsdl.tasks.axis2.WSDL2Java task = project.tasks.findByName("axis2Wsdl2javaTestconfiguration") as com.intershop.gradle.wsdl.tasks.axis2.WSDL2Java 155 | 156 | then: 157 | task 158 | task.wsdlFile == project.file('MyFile.wsdl') 159 | task.packageName == 'com.intershop.wsdl' 160 | task.namespacePackageMappingFile == project.file('wsdl/package.mapping') 161 | task.unwrapParams 162 | task.generateAllClasses 163 | task.wsdlVersion == "" 164 | task.args == ['testParameter'] as List 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/AbstractAxisConfig.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension 17 | 18 | import com.intershop.gradle.wsdl.extension.data.NamespacePackageMapping 19 | import org.gradle.api.NamedDomainObjectContainer 20 | import org.gradle.api.file.RegularFile 21 | import org.gradle.api.file.RegularFileProperty 22 | import org.gradle.api.model.ObjectFactory 23 | import org.gradle.api.provider.ListProperty 24 | import org.gradle.api.provider.Property 25 | import org.gradle.api.provider.Provider 26 | import org.gradle.api.tasks.SourceSet 27 | import java.io.File 28 | import javax.inject.Inject 29 | 30 | /** 31 | * Class with configuration for Axis 1 and 2. 32 | * 33 | * @constructur default constructor with project and a configuration name. 34 | */ 35 | open class AbstractAxisConfig @Inject constructor(val name: String, objectFactory: ObjectFactory) { 36 | 37 | private val sourceSetNameProperty: Property = objectFactory.property(String::class.java) 38 | private val packageNameProperty: Property = objectFactory.property(String::class.java) 39 | 40 | private val namespacePackageMappingFileProperty: RegularFileProperty = objectFactory.fileProperty() 41 | private val wsdlFileProperty: RegularFileProperty = objectFactory.fileProperty() 42 | 43 | private val argumentsProperty: ListProperty = objectFactory.listProperty(String::class.java) 44 | 45 | // will be analyzed as Boolean 46 | private val generateTestcaseProperty: Property = objectFactory.property(Boolean::class.java) 47 | 48 | init { 49 | sourceSetNameProperty.set(SourceSet.MAIN_SOURCE_SET_NAME) 50 | generateTestcaseProperty.set(false) 51 | } 52 | 53 | /** 54 | * By default, package names are generated from the namespace strings in the WSDLExtension document in a 55 | * magical manner (typically, if the namespace is of the form "http://x.y.com" or "urn:x.y.com" 56 | * the corresponding package will be "com.y.x"). If this magic is not what you want, you can provide your 57 | * own mapping using the this maps argument. For example, if there is a namespace in the WSDLExtension document 58 | * called "urn:AddressFetcher2", and you want files generated from the objects within this namespace 59 | * to reside in the package samples.addr, you would provide the following option: 60 | *

 61 |      * urn:AddressFetcher2=samples.addr
 62 |      * 

63 | */ 64 | val namespacePackageMappings: NamedDomainObjectContainer 65 | = objectFactory.domainObjectContainer(NamespacePackageMapping::class.java) 66 | 67 | /** 68 | * Provider for packageName. 69 | */ 70 | val packageNameProvider: Provider 71 | get() = packageNameProperty 72 | 73 | /** 74 | * This is a shorthand option to map all namespaces in a WSDLExtension document to the same 75 | * Java package name. This can be useful, but dangerous. You must make sure that you 76 | * understand the effects of doing this. For instance there may be multiple types 77 | * with the same name in different namespaces. 78 | * Only for Axis1: It is an error to use the --NStoPkg switch and --package at the same time. 79 | * 80 | * @property packageName 81 | */ 82 | var packageName: String? 83 | get() = packageNameProperty.orNull 84 | set(value) = packageNameProperty.set(value) 85 | 86 | /** 87 | * Provider for generateTestcase. 88 | */ 89 | val generateTestcaseProvider: Provider 90 | get() = generateTestcaseProperty 91 | 92 | /** 93 | * Generate a client-side JUnit test case. This test case can stand on its own, but it doesn't 94 | * really do anything except pass default values (null for objects, 0 or false for primitive types). 95 | * Like the generated implementation file, the generated test case file could be considered a template 96 | * that you may fill in. 97 | * 98 | * @property generateTestcase 99 | */ 100 | var generateTestcase : Boolean 101 | get() = generateTestcaseProperty.getOrElse(false) 102 | set(value) = generateTestcaseProperty.set(value) 103 | 104 | /** 105 | * Provider for namespacePackageMappingFile. 106 | */ 107 | val namespacePackageMappingFileProvider: Provider 108 | get() = namespacePackageMappingFileProperty 109 | 110 | /** 111 | * If there are a number of namespaces in the WSDLExtension document, listing a mapping for them all could 112 | * become tedious. To help keep the command line terse, WSDL2Java will also look for mappings in 113 | * a properties file. By default, this file is named "NStoPkg.properties" and it must reside in 114 | * the default package (ie., no package). But you can explicitly provide your own file using this option. 115 | * 116 | * The entries in this file are of the same form as the arguments to the namespacePackageMapping option. 117 | * For example, instead of providing the command line option as above, we could provide the same 118 | * information in a properties file: 119 | *

120 |      * urn\:AddressFetcher2=samples.addr
121 |      * 

122 | * 123 | * (Note that the colon must be escaped in the properties file.) 124 | * 125 | * If an entry for a given mapping exists both with namespacePackageMapping and in this properties file, 126 | * the namespacePackageMapping entry takes precedence. 127 | * 128 | * @property namespacePackageMappingFile 129 | */ 130 | var namespacePackageMappingFile: File 131 | get() = namespacePackageMappingFileProperty.get().asFile 132 | set(value) = namespacePackageMappingFileProperty.set(value) 133 | 134 | /** 135 | * Provider for additional arguments. 136 | */ 137 | val argumentsProvider: Provider> 138 | get() = argumentsProperty 139 | 140 | /** 141 | * Additional arguments for WSDL code configuration. 142 | * 143 | * @property args 144 | */ 145 | var args: List 146 | get() = argumentsProperty.get() 147 | set(value) = this.argumentsProperty.set(value) 148 | 149 | /** 150 | * Add argument to list of additional arguments. 151 | * 152 | * @property argument 153 | */ 154 | fun addArg(argument: String) { 155 | argumentsProperty.add(argument) 156 | } 157 | 158 | /** 159 | * Add a list of arguments to list of additional arguments. 160 | * 161 | * @property args 162 | */ 163 | fun addArgs(args: List) { 164 | for(arg in args) { 165 | argumentsProperty.add(arg) 166 | } 167 | } 168 | 169 | /** 170 | * Provider for wsdlFile property. 171 | */ 172 | val wsdlFileProvider: Provider 173 | get() = wsdlFileProperty 174 | 175 | /** 176 | * WSDLExtension file for processing. 177 | */ 178 | var wsdlFile: File 179 | get() = wsdlFileProperty.get().asFile 180 | set(value) = wsdlFileProperty.set(value) 181 | 182 | /** 183 | * Provider for source set name property. 184 | */ 185 | val sourceSetNameProvider: Provider 186 | get() = sourceSetNameProperty 187 | 188 | /** 189 | * SourceSet name for Java files. 190 | */ 191 | var sourceSetName: String 192 | get() = sourceSetNameProperty.get() 193 | set(value) = sourceSetNameProperty.set(value) 194 | } 195 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Stop when "xargs" is not available. 209 | if ! command -v xargs >/dev/null 2>&1 210 | then 211 | die "xargs is not available" 212 | fi 213 | 214 | # Use "xargs" to parse quoted args. 215 | # 216 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 217 | # 218 | # In Bash we could simply go: 219 | # 220 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 221 | # set -- "${ARGS[@]}" "$@" 222 | # 223 | # but POSIX shell has neither arrays nor command substitution, so instead we 224 | # post-process each arg (as a line of input to sed) to backslash-escape any 225 | # character that might be a shell metacharacter, then use eval to reverse 226 | # that process (while maintaining the separation between arguments), and wrap 227 | # the whole thing up as a single "set" statement. 228 | # 229 | # This will of course break if any of these variables contains a newline or 230 | # an unmatched quote. 231 | # 232 | 233 | eval "set -- $( 234 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 235 | xargs -n1 | 236 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 237 | tr '\n' ' ' 238 | )" '"$@"' 239 | 240 | exec "$JAVACMD" "$@" 241 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 12 | through 9 of this document. 13 | 14 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, 17 | or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, 18 | direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) 19 | ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 20 | 21 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 22 | 23 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source 24 | code, documentation source, and configuration files. 25 | 26 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including 27 | but not limited to compiled object code, generated documentation, and conversions to other media types. 28 | 29 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as 30 | indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix 31 | below). 32 | 33 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work 34 | and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an 35 | original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain 36 | separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 37 | 38 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or 39 | additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the 40 | Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. 41 | For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent 42 | to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source 43 | code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of 44 | discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in 45 | writing by the copyright owner as "Not a Contribution." 46 | 47 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received 48 | by Licensor and subsequently incorporated within the Work. 49 | 50 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to 51 | You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare 52 | Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works 53 | in Source or Object form. 54 | 55 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You 56 | a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent 57 | license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license 58 | applies only to those patent claims licensable by such Contributor that are necessarily infringed by their 59 | Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) 60 | was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a 61 | lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory 62 | patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of 63 | the date such litigation is filed. 64 | 65 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, 66 | with or without modifications, and in Source or Object form, provided that You meet the following conditions: 67 | 68 | a. You must give any other recipients of the Work or Derivative Works a copy of this License; and 69 | b. You must cause any modified files to carry prominent notices stating that You changed the files; and 70 | c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, 71 | and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part 72 | of the Derivative Works; and 73 | d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute 74 | must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices 75 | that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE 76 | text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along 77 | with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party 78 | notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the 79 | License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an 80 | addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as 81 | modifying the License. 82 | 83 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms 84 | and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a 85 | whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated 86 | in this License. 87 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for 88 | inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any 89 | additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any 90 | separate license agreement you may have executed with Licensor regarding such Contributions. 91 | 92 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product 93 | names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and 94 | reproducing the content of the NOTICE file. 95 | 96 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work 97 | (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 98 | either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, 99 | MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness 100 | of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 101 | 102 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, 103 | or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in 104 | writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, 105 | or consequential damages of any character arising as a result of this License or out of the use or inability to use 106 | the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, 107 | or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of 108 | such damages. 109 | 110 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may 111 | choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations 112 | and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own 113 | behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, 114 | defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor 115 | by reason of your accepting any such warranty or additional liability. 116 | 117 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /license-2.0.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ 6 | 7 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | 9 | 1. Definitions. 10 | 11 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 12 | through 9 of this document. 13 | 14 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, 17 | or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, 18 | direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) 19 | ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 20 | 21 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 22 | 23 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source 24 | code, documentation source, and configuration files. 25 | 26 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including 27 | but not limited to compiled object code, generated documentation, and conversions to other media types. 28 | 29 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as 30 | indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix 31 | below). 32 | 33 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work 34 | and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an 35 | original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain 36 | separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 37 | 38 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or 39 | additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the 40 | Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. 41 | For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent 42 | to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source 43 | code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of 44 | discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in 45 | writing by the copyright owner as "Not a Contribution." 46 | 47 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received 48 | by Licensor and subsequently incorporated within the Work. 49 | 50 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to 51 | You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare 52 | Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works 53 | in Source or Object form. 54 | 55 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You 56 | a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent 57 | license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license 58 | applies only to those patent claims licensable by such Contributor that are necessarily infringed by their 59 | Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) 60 | was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a 61 | lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory 62 | patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of 63 | the date such litigation is filed. 64 | 65 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, 66 | with or without modifications, and in Source or Object form, provided that You meet the following conditions: 67 | 68 | a. You must give any other recipients of the Work or Derivative Works a copy of this License; and 69 | b. You must cause any modified files to carry prominent notices stating that You changed the files; and 70 | c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, 71 | and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part 72 | of the Derivative Works; and 73 | d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute 74 | must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices 75 | that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE 76 | text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along 77 | with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party 78 | notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the 79 | License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an 80 | addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as 81 | modifying the License. 82 | 83 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms 84 | and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a 85 | whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated 86 | in this License. 87 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for 88 | inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any 89 | additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any 90 | separate license agreement you may have executed with Licensor regarding such Contributions. 91 | 92 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product 93 | names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and 94 | reproducing the content of the NOTICE file. 95 | 96 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work 97 | (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 98 | either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, 99 | MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness 100 | of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 101 | 102 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, 103 | or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in 104 | writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, 105 | or consequential damages of any character arising as a result of this License or out of the use or inability to use 106 | the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, 107 | or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of 108 | such damages. 109 | 110 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may 111 | choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations 112 | and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own 113 | behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, 114 | defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor 115 | by reason of your accepting any such warranty or additional liability. 116 | 117 | END OF TERMS AND CONDITIONS -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/tasks/AbstractWSDL2Java.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.tasks 17 | 18 | import com.intershop.gradle.wsdl.extension.data.NamespacePackageMapping 19 | import org.gradle.api.Action 20 | import org.gradle.api.DefaultTask 21 | import org.gradle.api.NamedDomainObjectContainer 22 | import org.gradle.api.file.Directory 23 | import org.gradle.api.file.DirectoryProperty 24 | import org.gradle.api.file.RegularFile 25 | import org.gradle.api.file.RegularFileProperty 26 | import org.gradle.api.model.ObjectFactory 27 | import org.gradle.api.provider.ListProperty 28 | import org.gradle.api.provider.Property 29 | import org.gradle.api.provider.Provider 30 | import org.gradle.api.tasks.Input 31 | import org.gradle.api.tasks.InputFile 32 | import org.gradle.api.tasks.Internal 33 | import org.gradle.api.tasks.Optional 34 | import org.gradle.api.tasks.OutputDirectory 35 | import org.gradle.process.JavaForkOptions 36 | import java.io.File 37 | import javax.inject.Inject 38 | 39 | /** 40 | * Abbstract class for axis 1 and axis2 code generator. 41 | */ 42 | open class AbstractWSDL2Java @Inject constructor(objectFactory: ObjectFactory) : DefaultTask() { 43 | 44 | companion object { 45 | /** 46 | * Adds an attribute to the parameter list. 47 | * @param arguments Argument list. 48 | * @param value Value 49 | * @param optionName Parameter name 50 | * 51 | */ 52 | fun addAttribute(arguments: MutableList, value: String, optionName: String) { 53 | if (value.isNotBlank()) { 54 | arguments.add(optionName) 55 | arguments.add(value) 56 | } 57 | } 58 | 59 | /** 60 | * Adds a flag to the argument list. 61 | * @param arguments Argument list 62 | * @param value Configured value 63 | * @param optionName name of the option 64 | */ 65 | fun addFlag(arguments: MutableList, value: Boolean, optionName: String) { 66 | if (value) { 67 | arguments.add(optionName) 68 | } 69 | } 70 | } 71 | 72 | private val packageNameProperty: Property = objectFactory.property(String::class.java) 73 | 74 | /** 75 | * This is a shorthand option to map all namespaces in a WSDLExtension document to the same 76 | * Java package name. This can be useful, but dangerous. You must make sure that you 77 | * understand the effects of doing this. For instance there may be multiple types 78 | * with the same name in different namespaces. 79 | * Only for Axis1: It is an error to use the --NStoPkg switch and --package at the same time. 80 | * 81 | * @property packageName default value is "" 82 | */ 83 | @get:Input 84 | var packageName: String 85 | get() = packageNameProperty.getOrElse("") 86 | set(value) = packageNameProperty.set(value) 87 | 88 | /** 89 | * Add provider for packageName. 90 | */ 91 | fun providePackageName(packageName: Provider) = packageNameProperty.set(packageName) 92 | 93 | /** 94 | * List of namespace mappings. 95 | */ 96 | @Internal 97 | var namespacePackageMappings: NamedDomainObjectContainer? = null 98 | 99 | /** 100 | * By default, package names are generated from the namespace strings in the WSDLExtension document in a 101 | * magical manner (typically, if the namespace is of the form "http://x.y.com" or "urn:x.y.com" 102 | * the corresponding package will be "com.y.x"). If this magic is not what you want, you can provide your 103 | * own mapping using the this maps argument. For example, if there is a namespace in the WSDLExtension document 104 | * called "urn:AddressFetcher2", and you want files generated from the objects within this namespace 105 | * to reside in the package samples.addr, you would provide the following option: 106 | *

107 |      * urn:AddressFetcher2=samples.addr
108 |      * 

109 | * 110 | * @property namespacePackageMappingList list of namespace mappings 111 | */ 112 | @get:Input 113 | val namespacePackageMappingList: List 114 | get() { 115 | val mappings: MutableList = mutableListOf() 116 | 117 | namespacePackageMappings?.forEach { 118 | mappings.add("${it.namespace}=${it.packageName}") 119 | } 120 | 121 | return mappings.toList() 122 | } 123 | 124 | private val generateTestcaseProperty = objectFactory.property(Boolean::class.java) 125 | 126 | /** 127 | * Generate a client-side JUnit test case. This test case can stand on its own, but it doesn't 128 | * really do anything except pass default values (null for objects, 0 or false for primitive types). 129 | * Like the generated implementation file, the generated test case file could be considered a template 130 | * that you may fill in. 131 | * 132 | * @property generateTestcase default value is false 133 | */ 134 | @get:Input 135 | var generateTestcase: Boolean 136 | get() = generateTestcaseProperty.getOrElse(false) 137 | set(value) = generateTestcaseProperty.set(value) 138 | 139 | /** 140 | * Add provider for generateTestcase. 141 | */ 142 | fun provideGenerateTestcase(generateTestcase: Provider) = generateTestcaseProperty.set(generateTestcase) 143 | 144 | private val namespacePackageMappingFileProperty: RegularFileProperty = objectFactory.fileProperty() 145 | 146 | /** 147 | * If there are a number of namespaces in the WSDLExtension document, listing a mapping for them all could 148 | * become tedious. To help keep the command line terse, WSDL2Java will also look for mappings in 149 | * a properties file. By default, this file is named "NStoPkg.properties" and it must reside in 150 | * the default package (ie., no package). But you can explicitly provide your own file using this option. 151 | * 152 | * The entries in this file are of the same form as the arguments to the namespacePackageMapping option. 153 | * For example, instead of providing the command line option as above, we could provide the same 154 | * information in a properties file: 155 | *

156 |      * urn\:AddressFetcher2=samples.addr
157 |      * 

158 | * 159 | * (Note that the colon must be escaped in the properties file.) 160 | * 161 | * If an entry for a given mapping exists both with namespacePackageMapping and in this properties file, 162 | * the namespacePackageMapping entry takes precedence. 163 | * 164 | * @property namespacePackageMappingFile name space mapping file 165 | */ 166 | @get:Optional 167 | @get:InputFile 168 | var namespacePackageMappingFile: File? 169 | get() = namespacePackageMappingFileProperty.orNull?.asFile 170 | set(value) { 171 | if(value != null) { 172 | namespacePackageMappingFileProperty.set(value) 173 | } 174 | } 175 | 176 | /** 177 | * Add provider for namespacePackageMappingFile. 178 | */ 179 | fun provideNamespacePackageMappingFile(namespacePackageMappingFile: Provider) 180 | = namespacePackageMappingFileProperty.set(namespacePackageMappingFile) 181 | 182 | private val argumentsProperty: ListProperty = objectFactory.listProperty(String::class.java) 183 | 184 | /** 185 | * Additional parameters for WSDL Command Line Client. 186 | * 187 | * @property args a list of arguments. 188 | */ 189 | @get:Input 190 | var args: List 191 | get() = argumentsProperty.get() 192 | set(value) = argumentsProperty.set(value) 193 | 194 | /** 195 | * Add additional arguments for args. 196 | */ 197 | fun args(arg: String) { 198 | argumentsProperty.add(arg) 199 | } 200 | 201 | /** 202 | * Add provider for args. 203 | */ 204 | fun provideArguments(arguments: Provider>) = argumentsProperty.set(arguments) 205 | 206 | private val outputDirProperty: DirectoryProperty = objectFactory.directoryProperty() 207 | 208 | /** 209 | * Output directory for generated sources. 210 | */ 211 | @get:OutputDirectory 212 | var outputDir: File 213 | get() = outputDirProperty.get().asFile 214 | set(value) = outputDirProperty.set(value) 215 | 216 | /** 217 | * Add provider for outputDir. 218 | */ 219 | fun provideOutputDir(outputDir: Provider) = outputDirProperty.set(outputDir) 220 | 221 | private val wsdlFileProperty: RegularFileProperty = objectFactory.fileProperty() 222 | 223 | /** 224 | * Input wsdl file. 225 | */ 226 | @get:InputFile 227 | var wsdlFile: File 228 | get() = wsdlFileProperty.get().asFile 229 | set(value) = wsdlFileProperty.set(value) 230 | 231 | /** 232 | * Add provider for wsdlFile. 233 | */ 234 | fun provideWsdlFile(wsdlFile: Provider) = wsdlFileProperty.set(wsdlFile) 235 | 236 | /** 237 | * Java fork options for the Java task. 238 | */ 239 | @Internal 240 | protected var internalForkOptionsAction: Action? = null 241 | 242 | /** 243 | * Adds additional fork options. 244 | */ 245 | fun forkOptions(forkOptions: Action) { 246 | internalForkOptionsAction = forkOptions 247 | } 248 | 249 | } 250 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/WSDLPlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl 17 | 18 | import com.intershop.gradle.wsdl.extension.WSDLExtension 19 | import com.intershop.gradle.wsdl.extension.WSDLExtension.Companion.WSDL_EXTENSION_NAME 20 | import org.gradle.api.Plugin 21 | import org.gradle.api.Project 22 | import org.gradle.api.Task 23 | import org.gradle.api.plugins.JavaBasePlugin 24 | import org.gradle.api.plugins.JavaPluginExtension 25 | import com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java as axis1WSDL2Java 26 | import com.intershop.gradle.wsdl.tasks.axis2.WSDL2Java as axis2WSDL2Java 27 | 28 | /** 29 | * Plugin Class implementation. 30 | */ 31 | class WSDLPlugin : Plugin { 32 | 33 | companion object { 34 | /** 35 | * Description for main task. 36 | */ 37 | const val TASKDESCRIPTION = "Generate Java code for Axis 1 and Axis2 WSDL files" 38 | /** 39 | * Taskname for main task. 40 | */ 41 | const val TASKNAME = "wsdl2java" 42 | } 43 | 44 | /** 45 | * Applies the extension and calls the 46 | * task initialization for this plugin. 47 | * 48 | * @param project current project 49 | */ 50 | override fun apply(project: Project) { 51 | with(project) { 52 | logger.info("WSDL plugin adds extension {} to {}", WSDL_EXTENSION_NAME, name) 53 | val extension = extensions.findByType( 54 | WSDLExtension::class.java) ?: extensions.create(WSDL_EXTENSION_NAME, WSDLExtension::class.java) 55 | 56 | addWsdlAxis1Configuration(this) 57 | addWsdlAxis2Configuration(this) 58 | 59 | configureTask(this, extension) 60 | } 61 | } 62 | 63 | /* 64 | * Configure tasks for WSDL code generation 65 | * 66 | * @param project project to configure 67 | * @param extension extension of this plugin 68 | */ 69 | private fun configureTask(project: Project, extension: WSDLExtension) { 70 | with(project) { 71 | val wsdlMain = tasks.maybeCreate(TASKNAME).apply { 72 | description = TASKDESCRIPTION 73 | group = WSDLExtension.WSDL_GROUP_NAME 74 | } 75 | 76 | confiureAxsis1Tasks(this, extension, wsdlMain) 77 | confiureAxsis2Tasks(this, extension, wsdlMain) 78 | } 79 | } 80 | 81 | /* 82 | * Configure tasks for WSDL code generation 83 | * 84 | * @param project project to configure 85 | * @param extension extension of this plugin 86 | * @param mainTask main wsdl task 87 | */ 88 | private fun confiureAxsis1Tasks(project: Project, extension: WSDLExtension, mainTask: Task) { 89 | with(project) { 90 | extension.axis1.all { axis1 -> 91 | tasks.maybeCreate(axis1.getTaskName(), axis1WSDL2Java::class.java).apply { 92 | group = WSDLExtension.WSDL_GROUP_NAME 93 | 94 | providePackageName(axis1.packageNameProvider) 95 | namespacePackageMappings = axis1.namespacePackageMappings 96 | provideGenerateTestcase(axis1.generateTestcaseProvider) 97 | provideNamespacePackageMappingFile(axis1.namespacePackageMappingFileProvider) 98 | provideArguments(axis1.argumentsProvider) 99 | provideOutputDir(axis1.outputDirProvider) 100 | provideWsdlFile(axis1.wsdlFileProvider) 101 | 102 | provideNoImports(axis1.noImportsProvider) 103 | provideTimeout(axis1.timeoutProvider) 104 | provideNoWrapped(axis1.noWrappedProvider) 105 | provideServerSide(axis1.serverSideProvider) 106 | provideSkeletonDeploy(axis1.skeletonDeployProvider) 107 | provideDeployScope(axis1.deployScopeProvider) 108 | provideGenerateAllClasses(axis1.generateAllClassesProvider) 109 | provideTypeMappingVersion(axis1.typeMappingVersionProvider) 110 | provideFactory(axis1.factoryProvider) 111 | provideHelperGen(axis1.helperGenProvider) 112 | provideUserName(axis1.userNameProvider) 113 | providePassword(axis1.passwordProvider) 114 | provideImplementationClassName(axis1.implementationClassNameProvider) 115 | provideWrapArrays(axis1.wrapArraysProvider) 116 | provideAllowInvalidURL(axis1.allowInvalidURLProvider) 117 | provideNsInclude(axis1.nsIncludeProvider) 118 | provideNsExclude(axis1.nsExcludeProvider) 119 | 120 | toolsClasspath.from(project.configurations.findByName(WSDLExtension.WSDL_AXIS1_CONFIGURATION_NAME)) 121 | wsdlProperties = axis1.wsdlProperties 122 | 123 | afterEvaluate { 124 | project.plugins.withType(JavaBasePlugin::class.java) { 125 | project.extensions.getByType(JavaPluginExtension::class.java).sourceSets.matching { 126 | it.name == axis1.sourceSetName 127 | }.forEach { 128 | it.java.srcDir(this@apply.outputs) 129 | } 130 | } 131 | } 132 | 133 | mainTask.dependsOn(this) 134 | } 135 | } 136 | } 137 | } 138 | 139 | /* 140 | * Configure tasks for WSDL code generation 141 | * 142 | * @param project project to configure 143 | * @param extension extension of this plugin 144 | * @param mainTask main wsdl task 145 | */ 146 | private fun confiureAxsis2Tasks(project: Project, extension: WSDLExtension, mainTask: Task) { 147 | with(project) { 148 | extension.axis2.all { axis2 -> 149 | tasks.maybeCreate(axis2.getTaskName(), axis2WSDL2Java::class.java).apply { 150 | group = WSDLExtension.WSDL_GROUP_NAME 151 | 152 | providePackageName(axis2.packageNameProvider) 153 | namespacePackageMappings = axis2.namespacePackageMappings 154 | provideGenerateTestcase(axis2.generateTestcaseProvider) 155 | provideNamespacePackageMappingFile(axis2.namespacePackageMappingFileProvider) 156 | provideArguments(axis2.argumentsProvider) 157 | provideOutputDir(axis2.outputDirProvider) 158 | provideWsdlFile(axis2.wsdlFileProvider) 159 | 160 | provideAsync(axis2.asyncProvider) 161 | provideSync(axis2.syncProvider) 162 | provideServerSide(axis2.serverSideProvider) 163 | provideServiceDescription(axis2.serviceDescriptionProvider) 164 | provideDatabindingMethod(axis2.databindingMethodProvider) 165 | provideGenerateAllClasses(axis2.generateAllClassesProvider) 166 | provideUnpackClasses(axis2.unpackClassesProvider) 167 | provideServiceName(axis2.serviceNameProvider) 168 | providePortName(axis2.portNameProvider) 169 | provideServersideInterface(axis2.serversideInterfaceProvider) 170 | provideWsdlVersion(axis2.wsdlVersionProvider) 171 | provideFlattenFiles(axis2.flattenFilesProvider) 172 | provideUnwrapParams(axis2.unwrapParamsProvider) 173 | provideXsdconfig(axis2.xsdconfigProvider) 174 | provideAllPorts(axis2.allPortsProvider) 175 | provideBackwordCompatible(axis2.backwordCompatibleProvider) 176 | provideSuppressPrefixes(axis2.suppressPrefixesProvider) 177 | provideNoMessageReceiver(axis2.noMessageReceiverProvider) 178 | 179 | toolsClasspath.from(project.configurations.findByName(WSDLExtension.WSDL_AXIS2_CONFIGURATION_NAME)) 180 | 181 | afterEvaluate { 182 | project.plugins.withType(JavaBasePlugin::class.java) { 183 | project.extensions.getByType(JavaPluginExtension::class.java).sourceSets.matching { 184 | it.name == axis2.sourceSetName 185 | }.forEach { 186 | it.java.srcDir(this@apply.outputs) 187 | } 188 | } 189 | } 190 | 191 | mainTask.dependsOn(this) 192 | } 193 | } 194 | } 195 | } 196 | 197 | /* 198 | * Adds the dependencies for the AXIS1 code generation. It is possible to override this. 199 | * 200 | * @param project 201 | */ 202 | private fun addWsdlAxis1Configuration(project: Project) { 203 | val configuration = project.configurations.maybeCreate(WSDLExtension.WSDL_AXIS1_CONFIGURATION_NAME) 204 | configuration.setVisible(false) 205 | .setTransitive(true) 206 | .setDescription("Configuration for Axis code generator") 207 | .defaultDependencies { 208 | val dependencyHandler = project.dependencies 209 | 210 | it.add(dependencyHandler.create("axis:axis-wsdl4j:1.5.1")) 211 | it.add(dependencyHandler.create("commons-discovery:commons-discovery:0.5")) 212 | it.add(dependencyHandler.create("javax.activation:activation:1.1.1")) 213 | it.add(dependencyHandler.create("javax.mail:mail:1.4.7")) 214 | it.add(dependencyHandler.create("commons-logging:commons-logging:1.2")) 215 | 216 | it.add(dependencyHandler.create("org.apache.axis:axis:1.4")) 217 | it.add(dependencyHandler.create("org.apache.axis:axis-jaxrpc:1.4")) 218 | it.add(dependencyHandler.create("javax.xml.soap:javax.xml.soap-api:1.4.0")) 219 | } 220 | } 221 | 222 | /* 223 | * Adds the dependencies for the AXIS2 code generation. It is possible to override this. 224 | * 225 | * @param project 226 | */ 227 | private fun addWsdlAxis2Configuration(project: Project) { 228 | val configuration = project.configurations.maybeCreate(WSDLExtension.WSDL_AXIS2_CONFIGURATION_NAME) 229 | configuration.setVisible(false) 230 | .setTransitive(true) 231 | .setDescription("Configuration for Axis 2 code generator") 232 | .defaultDependencies { 233 | val dependencyHandler = project.dependencies 234 | 235 | it.add(dependencyHandler.create("org.apache.axis2:axis2-kernel:1.7.7")) 236 | it.add(dependencyHandler.create("org.apache.axis2:axis2-codegen:1.7.7")) 237 | it.add(dependencyHandler.create("org.apache.axis2:axis2-adb:1.7.7")) 238 | it.add(dependencyHandler.create("org.apache.axis2:axis2-adb-codegen:1.7.7")) 239 | it.add(dependencyHandler.create("org.apache.axis2:axis2-jaxbri:1.7.7")) 240 | it.add(dependencyHandler.create("com.sun.xml.ws:jaxws-tools:2.2.10")) 241 | it.add(dependencyHandler.create("wsdl4j:wsdl4j:1.6.3")) 242 | it.add(dependencyHandler.create("commons-logging:commons-logging:1.2")) 243 | it.add(dependencyHandler.create("org.apache.neethi:neethi:3.0.3")) 244 | it.add(dependencyHandler.create("org.apache.ws.commons.axiom:axiom-api:1.2.20")) 245 | it.add(dependencyHandler.create("org.apache.ws.commons.axiom:axiom-impl:1.2.20")) 246 | it.add(dependencyHandler.create("org.apache.woden:woden-core:1.0M10")) 247 | it.add(dependencyHandler.create("org.apache.ws.xmlschema:xmlschema-core:2.2.1")) 248 | it.add(dependencyHandler.create("com.sun.xml.bind:jaxb-impl:2.2.6")) 249 | it.add(dependencyHandler.create("com.sun.xml.bind:jaxb-xjc:2.2.6")) 250 | it.add(dependencyHandler.create("javax.xml.soap:javax.xml.soap-api:1.4.0")) 251 | } 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /src/test/groovy/com/intershop/gradle/wsdl/Axis1IntegrationSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl 17 | 18 | import com.intershop.gradle.test.AbstractIntegrationGroovySpec 19 | 20 | import static org.gradle.testkit.runner.TaskOutcome.SUCCESS 21 | import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE 22 | 23 | class Axis1IntegrationSpec extends AbstractIntegrationGroovySpec { 24 | 25 | def 'Test simple code generation'() { 26 | given: 27 | copyResources('axis1/addressbook/AddressBook.wsdl', 'staticfiles/wsdl/AddressBook.wsdl') 28 | 29 | buildFile << """ 30 | plugins { 31 | id 'java' 32 | id 'com.intershop.gradle.wsdl' 33 | } 34 | 35 | wsdl { 36 | axis1 { 37 | addressBook { 38 | wsdlFile = file('staticfiles/wsdl/AddressBook.wsdl') 39 | } 40 | } 41 | } 42 | 43 | repositories { 44 | mavenCentral() 45 | } 46 | 47 | dependencies { 48 | implementation 'org.apache.axis:axis:1.4' 49 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 50 | implementation 'javax.xml:jaxrpc-api:1.1' 51 | } 52 | """.stripIndent() 53 | 54 | when: 55 | List args = ['compileJava', '-d', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 56 | 57 | def result1 = getPreparedGradleRunner() 58 | .withArguments(args) 59 | .withGradleVersion(gradleVersion) 60 | .build() 61 | 62 | then: 63 | result1.task(':axis1Wsdl2javaAddressBook').outcome == SUCCESS 64 | result1.task(':compileJava').outcome == SUCCESS 65 | 66 | when: 67 | def result2 = getPreparedGradleRunner() 68 | .withArguments(args) 69 | .withGradleVersion(gradleVersion) 70 | .build() 71 | 72 | then: 73 | result2.task(':axis1Wsdl2javaAddressBook').outcome == UP_TO_DATE 74 | result2.task(':compileJava').outcome == UP_TO_DATE 75 | 76 | where: 77 | gradleVersion << supportedGradleVersions 78 | } 79 | 80 | def 'Test with namespace mapping'() { 81 | copyResources('axis1/echo-sample/InteropTest.wsdl', 'staticfiles/wsdl/InteropTest.wsdl') 82 | 83 | buildFile << """ 84 | plugins { 85 | id 'java' 86 | id 'com.intershop.gradle.wsdl' 87 | } 88 | 89 | wsdl { 90 | axis1 { 91 | echo { 92 | wsdlFile = file('staticfiles/wsdl/InteropTest.wsdl') 93 | namespacePackageMappings { 94 | sample1 { 95 | namespace = 'http://soapinterop.org/' 96 | packageName = 'samples.echo' 97 | } 98 | sample2 { 99 | namespace = 'http://soapinterop.org/xsd' 100 | packageName = 'samples.echo' 101 | } 102 | } 103 | } 104 | } 105 | } 106 | 107 | repositories { 108 | mavenCentral() 109 | } 110 | 111 | dependencies { 112 | implementation 'org.apache.axis:axis:1.4' 113 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 114 | implementation 'javax.xml:jaxrpc-api:1.1' 115 | } 116 | """.stripIndent() 117 | 118 | when: 119 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 120 | 121 | def result = getPreparedGradleRunner() 122 | .withArguments(args) 123 | .withGradleVersion(gradleVersion) 124 | .build() 125 | 126 | then: 127 | result.task(':axis1Wsdl2javaEcho').outcome == SUCCESS 128 | result.task(':compileJava').outcome == SUCCESS 129 | (new File(testProjectDir, 'build/generated/wsdl2java/axis1/echo/samples/echo/InteropTestPortType.java')).exists() 130 | 131 | where: 132 | gradleVersion << supportedGradleVersions 133 | } 134 | 135 | def 'Test with generated server code'() { 136 | copyResources('axis1/jaxrpc-sample/Address.wsdl', 'staticfiles/wsdl/Address.wsdl') 137 | copyResources('axis1/jaxrpc-sample/HelloWorld.wsdl', 'staticfiles/wsdl/HelloWorld.wsdl') 138 | 139 | buildFile << """ 140 | plugins { 141 | id 'java' 142 | id 'com.intershop.gradle.wsdl' 143 | } 144 | 145 | wsdl { 146 | axis1 { 147 | address { 148 | wsdlFile = file('staticfiles/wsdl/Address.wsdl') 149 | serverSide = true 150 | } 151 | hello { 152 | wsdlFile = file('staticfiles/wsdl/HelloWorld.wsdl') 153 | } 154 | } 155 | } 156 | 157 | repositories { 158 | mavenCentral() 159 | } 160 | 161 | dependencies { 162 | implementation 'org.apache.axis:axis:1.4' 163 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 164 | implementation 'javax.xml:jaxrpc-api:1.1' 165 | } 166 | """.stripIndent() 167 | 168 | when: 169 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 170 | 171 | def result = getPreparedGradleRunner() 172 | .withArguments(args) 173 | .withGradleVersion(gradleVersion) 174 | .build() 175 | 176 | then: 177 | result.task(':axis1Wsdl2javaAddress').outcome == SUCCESS 178 | result.task(':axis1Wsdl2javaHello').outcome == SUCCESS 179 | result.task(':compileJava').outcome == SUCCESS 180 | (new File(testProjectDir, 'build/generated/wsdl2java/axis1/address/samples/jaxrpc/address/deploy.wsdd')).exists() 181 | 182 | where: 183 | gradleVersion << supportedGradleVersions 184 | } 185 | 186 | def 'Test with extended configuration'() { 187 | copyResources('axis1/jms-sample/GetQuote.wsdl', 'staticfiles/wsdl/GetQuote.wsdl') 188 | 189 | buildFile << """ 190 | plugins { 191 | id 'java' 192 | id 'com.intershop.gradle.wsdl' 193 | } 194 | 195 | wsdl { 196 | axis1 { 197 | jms { 198 | wsdlFile = file('staticfiles/wsdl/GetQuote.wsdl') 199 | typeMappingVersion = '1.1' 200 | deployScope = 'Session' 201 | allowInvalidURL = true 202 | namespacePackageMappings { 203 | sample1 { 204 | namespace = 'urn:xmltoday-delayed-quotes' 205 | packageName = 'samples.jms.stub.xmltoday_delayed_quotes' 206 | } 207 | sample2 { 208 | namespace = 'urn:xmltoday-delayed-quotes' 209 | packageName = 'samples.jms.stub.xmltoday_delayed_quotes' 210 | } 211 | } 212 | } 213 | } 214 | } 215 | 216 | repositories { 217 | mavenCentral() 218 | } 219 | 220 | dependencies { 221 | implementation 'org.apache.axis:axis:1.4' 222 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 223 | implementation 'javax.xml:jaxrpc-api:1.1' 224 | } 225 | """.stripIndent() 226 | 227 | when: 228 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 229 | 230 | def result = getPreparedGradleRunner() 231 | .withArguments(args) 232 | .withGradleVersion(gradleVersion) 233 | .build() 234 | 235 | then: 236 | result.task(':axis1Wsdl2javaJms').outcome == SUCCESS 237 | result.task(':compileJava').outcome == SUCCESS 238 | 239 | where: 240 | gradleVersion << supportedGradleVersions 241 | } 242 | 243 | def 'Test simple code generation with javaOptions'() { 244 | given: 245 | copyResources('axis1/addressbook/AddressBook.wsdl', 'staticfiles/wsdl/AddressBook.wsdl') 246 | 247 | buildFile << """ 248 | plugins { 249 | id 'java' 250 | id 'com.intershop.gradle.wsdl' 251 | } 252 | 253 | wsdl { 254 | axis1 { 255 | addressBook { 256 | wsdlFile = file('staticfiles/wsdl/AddressBook.wsdl') 257 | } 258 | } 259 | } 260 | 261 | tasks.withType(com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java) { 262 | forkOptions { JavaForkOptions options -> 263 | options.setMaxHeapSize('64m') 264 | options.jvmArgs += ["-XX:-UseSerialGC"] 265 | options.systemProperty('http.proxyHost', 'test.host.com') 266 | options.systemProperty('http.proxyPort', '8081') 267 | options.systemProperty('https.proxyHost', 'test.host.com') 268 | options.systemProperty('https.proxyPort', '4081') 269 | } 270 | } 271 | 272 | repositories { 273 | mavenCentral() 274 | } 275 | 276 | dependencies { 277 | implementation 'org.apache.axis:axis:1.4' 278 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 279 | implementation 'javax.xml:jaxrpc-api:1.1' 280 | } 281 | """.stripIndent() 282 | 283 | when: 284 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 285 | 286 | def result = getPreparedGradleRunner() 287 | .withArguments(args) 288 | .withGradleVersion(gradleVersion) 289 | .build() 290 | 291 | then: 292 | result.task(':axis1Wsdl2javaAddressBook').outcome == SUCCESS 293 | result.task(':compileJava').outcome == SUCCESS 294 | result.output.contains('-Dhttp.proxyHost=test.host.com') 295 | result.output.contains('-Dhttp.proxyPort=8081') 296 | result.output.contains('-Dhttps.proxyHost=test.host.com') 297 | result.output.contains('-Dhttps.proxyPort=4081') 298 | 299 | where: 300 | gradleVersion << supportedGradleVersions 301 | } 302 | 303 | def 'Test code generation wsrp service'() { 304 | given: 305 | copyResources('axis1/wsrpservice/NStoPkg.properties' ,'staticfiles/wsdl/NStoPkg.properties') 306 | copyResources('axis1/wsrpservice/wsrp_service.wsdl' ,'staticfiles/wsdl/wsrp_service.wsdl') 307 | copyResources('axis1/wsrpservice/wsrp_v1_bindings.wsdl' ,'staticfiles/wsdl/wsrp_v1_bindings.wsdl') 308 | copyResources('axis1/wsrpservice/wsrp_v1_interfaces.wsdl' ,'staticfiles/wsdl/wsrp_v1_interfaces.wsdl') 309 | copyResources('axis1/wsrpservice/wsrp_v1_types.xsd' ,'staticfiles/wsdl/wsrp_v1_types.xsd') 310 | copyResources('axis1/wsrpservice/wsrp_v1_types_original.xsd' ,'staticfiles/wsdl/wsrp_v1_types_original.xsd') 311 | copyResources('axis1/wsrpservice/xml.xsd' ,'staticfiles/wsdl/xml.xsd') 312 | 313 | 314 | buildFile << """ 315 | plugins { 316 | id 'java' 317 | id 'com.intershop.gradle.wsdl' 318 | } 319 | 320 | wsdl { 321 | axis1 { 322 | wsrpservice { 323 | wsdlFile = file('staticfiles/wsdl/wsrp_service.wsdl') 324 | namespacePackageMappingFile = file('staticfiles/wsdl/NStoPkg.properties') 325 | wrapArrays = true 326 | noWrapped = true 327 | } 328 | } 329 | } 330 | 331 | repositories { 332 | mavenCentral() 333 | } 334 | 335 | dependencies { 336 | implementation 'org.apache.axis:axis:1.4' 337 | implementation 'org.apache.axis:axis-jaxrpc:1.4' 338 | implementation 'javax.xml:jaxrpc-api:1.1' 339 | } 340 | """.stripIndent() 341 | 342 | File resultBindDir = new File(testProjectDir, 'build/generated/wsdl2java/axis1/wsrpservice/oasis/names/tc/wsrp/v1/bind') 343 | 344 | when: 345 | List args = ['compileJava'] 346 | def result = getPreparedGradleRunner() 347 | .withArguments(args) 348 | .withGradleVersion(gradleVersion) 349 | .build() 350 | 351 | then: 352 | result.task(':axis1Wsdl2javaWsrpservice').outcome == SUCCESS 353 | result.task(':compileJava').outcome == SUCCESS 354 | resultBindDir.exists() 355 | resultBindDir.listFiles().length == 4 356 | 357 | where: 358 | gradleVersion << supportedGradleVersions 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /src/test/groovy/com/intershop/gradle/wsdl/Axis1IntegrationKtsSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl 17 | 18 | import com.intershop.gradle.test.AbstractIntegrationKotlinSpec 19 | 20 | import static org.gradle.testkit.runner.TaskOutcome.SUCCESS 21 | import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE 22 | 23 | class Axis1IntegrationKtsSpec extends AbstractIntegrationKotlinSpec { 24 | 25 | def 'Test simple code generation'() { 26 | given: 27 | copyResources('axis1/addressbook/AddressBook.wsdl', 'staticfiles/wsdl/AddressBook.wsdl') 28 | 29 | buildFile << """ 30 | plugins { 31 | `java` 32 | id("com.intershop.gradle.wsdl") 33 | } 34 | 35 | wsdl { 36 | axis1 { 37 | register("addressBook") { 38 | wsdlFile = file("staticfiles/wsdl/AddressBook.wsdl") 39 | } 40 | } 41 | } 42 | 43 | repositories { 44 | mavenCentral() 45 | } 46 | 47 | dependencies { 48 | implementation("org.apache.axis:axis:1.4") 49 | implementation("org.apache.axis:axis-jaxrpc:1.4") 50 | implementation("javax.xml:jaxrpc-api:1.1") 51 | } 52 | """.stripIndent() 53 | 54 | when: 55 | List args = ['compileJava', '-d', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 56 | 57 | def result1 = getPreparedGradleRunner() 58 | .withArguments(args) 59 | .withGradleVersion(gradleVersion) 60 | .build() 61 | 62 | then: 63 | result1.task(':axis1Wsdl2javaAddressBook').outcome == SUCCESS 64 | result1.task(':compileJava').outcome == SUCCESS 65 | 66 | when: 67 | def result2 = getPreparedGradleRunner() 68 | .withArguments(args) 69 | .withGradleVersion(gradleVersion) 70 | .build() 71 | 72 | then: 73 | result2.task(':axis1Wsdl2javaAddressBook').outcome == UP_TO_DATE 74 | result2.task(':compileJava').outcome == UP_TO_DATE 75 | 76 | where: 77 | gradleVersion << supportedGradleVersions 78 | } 79 | 80 | def 'Test with namespace mapping'() { 81 | copyResources('axis1/echo-sample/InteropTest.wsdl', 'staticfiles/wsdl/InteropTest.wsdl') 82 | 83 | buildFile << """ 84 | plugins { 85 | `java` 86 | id("com.intershop.gradle.wsdl") 87 | } 88 | 89 | wsdl { 90 | axis1 { 91 | register("echo") { 92 | wsdlFile = file("staticfiles/wsdl/InteropTest.wsdl") 93 | namespacePackageMappings { 94 | register("sample1") { 95 | namespace = "http://soapinterop.org/" 96 | packageName = "samples.echo" 97 | } 98 | register("sample2") { 99 | namespace = "http://soapinterop.org/xsd" 100 | packageName = "samples.echo" 101 | } 102 | } 103 | } 104 | } 105 | } 106 | 107 | repositories { 108 | mavenCentral() 109 | } 110 | 111 | dependencies { 112 | implementation("org.apache.axis:axis:1.4") 113 | implementation("org.apache.axis:axis-jaxrpc:1.4") 114 | implementation("javax.xml:jaxrpc-api:1.1") 115 | } 116 | """.stripIndent() 117 | 118 | when: 119 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 120 | 121 | def result = getPreparedGradleRunner() 122 | .withArguments(args) 123 | .withGradleVersion(gradleVersion) 124 | .build() 125 | 126 | then: 127 | result.task(':axis1Wsdl2javaEcho').outcome == SUCCESS 128 | result.task(':compileJava').outcome == SUCCESS 129 | (new File(testProjectDir, 'build/generated/wsdl2java/axis1/echo/samples/echo/InteropTestPortType.java')).exists() 130 | 131 | where: 132 | gradleVersion << supportedGradleVersions 133 | } 134 | 135 | def 'Test with generated server code'() { 136 | copyResources('axis1/jaxrpc-sample/Address.wsdl', 'staticfiles/wsdl/Address.wsdl') 137 | copyResources('axis1/jaxrpc-sample/HelloWorld.wsdl', 'staticfiles/wsdl/HelloWorld.wsdl') 138 | 139 | buildFile << """ 140 | plugins { 141 | `java` 142 | id("com.intershop.gradle.wsdl") 143 | } 144 | 145 | wsdl { 146 | axis1 { 147 | register("address") { 148 | wsdlFile = file("staticfiles/wsdl/Address.wsdl") 149 | serverSide = true 150 | } 151 | register("hello") { 152 | wsdlFile = file("staticfiles/wsdl/HelloWorld.wsdl") 153 | } 154 | } 155 | } 156 | 157 | repositories { 158 | mavenCentral() 159 | } 160 | 161 | dependencies { 162 | implementation("org.apache.axis:axis:1.4") 163 | implementation("org.apache.axis:axis-jaxrpc:1.4") 164 | implementation("javax.xml:jaxrpc-api:1.1") 165 | } 166 | """.stripIndent() 167 | 168 | when: 169 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 170 | 171 | def result = getPreparedGradleRunner() 172 | .withArguments(args) 173 | .withGradleVersion(gradleVersion) 174 | .build() 175 | 176 | then: 177 | result.task(':axis1Wsdl2javaAddress').outcome == SUCCESS 178 | result.task(':axis1Wsdl2javaHello').outcome == SUCCESS 179 | result.task(':compileJava').outcome == SUCCESS 180 | (new File(testProjectDir, 'build/generated/wsdl2java/axis1/address/samples/jaxrpc/address/deploy.wsdd')).exists() 181 | 182 | where: 183 | gradleVersion << supportedGradleVersions 184 | } 185 | 186 | def 'Test with extended configuration'() { 187 | copyResources('axis1/jms-sample/GetQuote.wsdl', 'staticfiles/wsdl/GetQuote.wsdl') 188 | 189 | buildFile << """ 190 | plugins { 191 | `java` 192 | id("com.intershop.gradle.wsdl") 193 | } 194 | 195 | wsdl { 196 | axis1 { 197 | register("jms") { 198 | wsdlFile = file("staticfiles/wsdl/GetQuote.wsdl") 199 | typeMappingVersion = "1.1" 200 | deployScope = "Session" 201 | allowInvalidURL = true 202 | namespacePackageMappings { 203 | register("sample1") { 204 | namespace = "urn:xmltoday-delayed-quotes" 205 | packageName = "samples.jms.stub.xmltoday_delayed_quotes" 206 | } 207 | register("sample2") { 208 | namespace = "urn:xmltoday-delayed-quotes" 209 | packageName = "samples.jms.stub.xmltoday_delayed_quotes" 210 | } 211 | } 212 | } 213 | } 214 | } 215 | 216 | repositories { 217 | mavenCentral() 218 | } 219 | 220 | dependencies { 221 | implementation("org.apache.axis:axis:1.4") 222 | implementation("org.apache.axis:axis-jaxrpc:1.4") 223 | implementation("javax.xml:jaxrpc-api:1.1") 224 | } 225 | """.stripIndent() 226 | 227 | when: 228 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 229 | 230 | def result = getPreparedGradleRunner() 231 | .withArguments(args) 232 | .withGradleVersion(gradleVersion) 233 | .build() 234 | 235 | then: 236 | result.task(':axis1Wsdl2javaJms').outcome == SUCCESS 237 | result.task(':compileJava').outcome == SUCCESS 238 | 239 | where: 240 | gradleVersion << supportedGradleVersions 241 | } 242 | 243 | def 'Test simple code generation with javaOptions'() { 244 | given: 245 | copyResources('axis1/addressbook/AddressBook.wsdl', 'staticfiles/wsdl/AddressBook.wsdl') 246 | 247 | buildFile << """ 248 | import com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java 249 | plugins { 250 | `java` 251 | id("com.intershop.gradle.wsdl") 252 | } 253 | 254 | wsdl { 255 | axis1 { 256 | register("addressBook") { 257 | wsdlFile = file("staticfiles/wsdl/AddressBook.wsdl") 258 | } 259 | } 260 | } 261 | 262 | tasks.withType(com.intershop.gradle.wsdl.tasks.axis1.WSDL2Java::class.java) { 263 | forkOptions { 264 | maxHeapSize = "64m" 265 | jvmArgs = listOf("-XX:MaxPermSize=512m", "-XX:-UseSerialGC") 266 | systemProperty("http.proxyHost", "test.host.com") 267 | systemProperty("http.proxyPort", "8081") 268 | systemProperty("https.proxyHost", "test.host.com") 269 | systemProperty("https.proxyPort", "4081") 270 | } 271 | } 272 | 273 | repositories { 274 | mavenCentral() 275 | } 276 | 277 | dependencies { 278 | implementation("org.apache.axis:axis:1.4") 279 | implementation("org.apache.axis:axis-jaxrpc:1.4") 280 | implementation("javax.xml:jaxrpc-api:1.1") 281 | } 282 | """.stripIndent() 283 | 284 | when: 285 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 286 | 287 | def result = getPreparedGradleRunner() 288 | .withArguments(args) 289 | .withGradleVersion(gradleVersion) 290 | .build() 291 | 292 | then: 293 | result.task(':axis1Wsdl2javaAddressBook').outcome == SUCCESS 294 | result.task(':compileJava').outcome == SUCCESS 295 | result.output.contains('-Dhttp.proxyHost=test.host.com') 296 | result.output.contains('-Dhttp.proxyPort=8081') 297 | result.output.contains('-Dhttps.proxyHost=test.host.com') 298 | result.output.contains('-Dhttps.proxyPort=4081') 299 | 300 | where: 301 | gradleVersion << supportedGradleVersions 302 | } 303 | 304 | def 'Test code generation wsrp service'() { 305 | given: 306 | copyResources('axis1/wsrpservice/NStoPkg.properties' ,'staticfiles/wsdl/NStoPkg.properties') 307 | copyResources('axis1/wsrpservice/wsrp_service.wsdl' ,'staticfiles/wsdl/wsrp_service.wsdl') 308 | copyResources('axis1/wsrpservice/wsrp_v1_bindings.wsdl' ,'staticfiles/wsdl/wsrp_v1_bindings.wsdl') 309 | copyResources('axis1/wsrpservice/wsrp_v1_interfaces.wsdl' ,'staticfiles/wsdl/wsrp_v1_interfaces.wsdl') 310 | copyResources('axis1/wsrpservice/wsrp_v1_types.xsd' ,'staticfiles/wsdl/wsrp_v1_types.xsd') 311 | copyResources('axis1/wsrpservice/wsrp_v1_types_original.xsd' ,'staticfiles/wsdl/wsrp_v1_types_original.xsd') 312 | copyResources('axis1/wsrpservice/xml.xsd' ,'staticfiles/wsdl/xml.xsd') 313 | 314 | 315 | buildFile << """ 316 | plugins { 317 | `java` 318 | id("com.intershop.gradle.wsdl") 319 | } 320 | 321 | wsdl { 322 | axis1 { 323 | register("wsrpservice") { 324 | wsdlFile = file("staticfiles/wsdl/wsrp_service.wsdl") 325 | namespacePackageMappingFile = file("staticfiles/wsdl/NStoPkg.properties") 326 | wrapArrays = true 327 | noWrapped = true 328 | } 329 | } 330 | } 331 | 332 | repositories { 333 | mavenCentral() 334 | } 335 | 336 | dependencies { 337 | implementation("org.apache.axis:axis:1.4") 338 | implementation("org.apache.axis:axis-jaxrpc:1.4") 339 | implementation("javax.xml:jaxrpc-api:1.1") 340 | } 341 | """.stripIndent() 342 | 343 | File resultBindDir = new File(testProjectDir, 'build/generated/wsdl2java/axis1/wsrpservice/oasis/names/tc/wsrp/v1/bind') 344 | 345 | when: 346 | List args = ['compileJava'] 347 | def result = getPreparedGradleRunner() 348 | .withArguments(args) 349 | .withGradleVersion(gradleVersion) 350 | .build() 351 | 352 | then: 353 | result.task(':axis1Wsdl2javaWsrpservice').outcome == SUCCESS 354 | result.task(':compileJava').outcome == SUCCESS 355 | resultBindDir.exists() 356 | resultBindDir.listFiles().length == 4 357 | 358 | where: 359 | gradleVersion << supportedGradleVersions 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/Axis2.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension 17 | 18 | import com.intershop.gradle.wsdl.utils.Databinding 19 | import org.gradle.api.file.Directory 20 | import org.gradle.api.file.DirectoryProperty 21 | import org.gradle.api.file.ProjectLayout 22 | import org.gradle.api.model.ObjectFactory 23 | import org.gradle.api.provider.Property 24 | import org.gradle.api.provider.Provider 25 | import java.io.File 26 | import java.util.* 27 | import javax.inject.Inject 28 | 29 | /** 30 | * Axis 2 Configuration container. 31 | * 32 | * @constructur default constructor with project and configuration name. 33 | */ 34 | open class Axis2 @Inject constructor(name: String, objectFactory: ObjectFactory, layout: ProjectLayout): 35 | AbstractAxisConfig(name, objectFactory) { 36 | 37 | // properties will analyzed as Boolean 38 | private val asyncProperty = objectFactory.property(Boolean::class.java) 39 | private val syncProperty = objectFactory.property(Boolean::class.java) 40 | private val serverSideProperty = objectFactory.property(Boolean::class.java) 41 | private val serviceDescriptionProperty = objectFactory.property(Boolean::class.java) 42 | private val generateAllClassesProperty = objectFactory.property(Boolean::class.java) 43 | private val unpackClassesProperty = objectFactory.property(Boolean::class.java) 44 | private val serversideInterfaceProperty = objectFactory.property(Boolean::class.java) 45 | private val flattenFilesProperty = objectFactory.property(Boolean::class.java) 46 | private val unwrapParamsProperty = objectFactory.property(Boolean::class.java) 47 | private val xsdconfigProperty = objectFactory.property(Boolean::class.java) 48 | private val allPortsProperty = objectFactory.property(Boolean::class.java) 49 | private val backwordCompatibleProperty = objectFactory.property(Boolean::class.java) 50 | private val suppressPrefixesProperty = objectFactory.property(Boolean::class.java) 51 | private val noMessageReceiverProperty = objectFactory.property(Boolean::class.java) 52 | 53 | // Strings 54 | private val databindingMethodProperty: Property = objectFactory.property(String::class.java) 55 | private val wsdlVersionProperty: Property = objectFactory.property(String::class.java) 56 | private val serviceNameProperty: Property = objectFactory.property(String::class.java) 57 | private val portNameProperty: Property = objectFactory.property(String::class.java) 58 | 59 | private val outputDirProperty: DirectoryProperty = objectFactory.directoryProperty() 60 | 61 | init { 62 | asyncProperty.convention(false) 63 | syncProperty.convention(false) 64 | serverSideProperty.convention(false) 65 | serviceDescriptionProperty.convention(false) 66 | databindingMethodProperty.convention(Databinding.ADB.binding) 67 | generateAllClassesProperty.convention(false) 68 | unpackClassesProperty.convention(false) 69 | serviceNameProperty.convention("") 70 | portNameProperty.convention("") 71 | serversideInterfaceProperty.convention(false) 72 | wsdlVersionProperty.convention("") 73 | flattenFilesProperty.convention(false) 74 | unwrapParamsProperty.convention(false) 75 | xsdconfigProperty.convention(false) 76 | allPortsProperty.convention(false) 77 | backwordCompatibleProperty.convention(false) 78 | suppressPrefixesProperty.convention(false) 79 | noMessageReceiverProperty.convention(false) 80 | 81 | outputDirProperty.convention(layout.buildDirectory.dir( 82 | "${WSDLExtension.CODEGEN_OUTPUTPATH}/axis2/${name.replace(' ', '_')}" 83 | )) 84 | } 85 | 86 | /** 87 | * Provider for async property. 88 | */ 89 | val asyncProvider: Provider 90 | get() = asyncProperty 91 | 92 | /** 93 | * Generate code only for async style. When this option is used the generated 94 | * stubs will have only the asynchronous invocation methods. Switched off by default. 95 | * 96 | * @property async 97 | */ 98 | var async : Boolean 99 | get() = asyncProperty.get() 100 | set(value) = asyncProperty.set(value) 101 | 102 | /** 103 | * Provider for sync property. 104 | */ 105 | val syncProvider: Provider 106 | get() = syncProperty 107 | 108 | /** 109 | * Generate code only for sync style . When this option is used the generated stubs 110 | * will have only the synchronous invocation methods. Switched off by default. 111 | * When async is set to true, this takes precedence. 112 | * 113 | * @property sync 114 | */ 115 | var sync : Boolean 116 | get() = syncProperty.get() 117 | set(value) = syncProperty.set(value) 118 | 119 | /** 120 | * Provider for serverSide property. 121 | */ 122 | val serverSideProvider: Provider 123 | get() = serverSideProperty 124 | 125 | /** 126 | * Generates server side code (i.e. skeletons). Default is false. 127 | * 128 | * @property serverSide 129 | */ 130 | var serverSide : Boolean 131 | get() = serverSideProperty.get() 132 | set(value) = serverSideProperty.set(value) 133 | 134 | /** 135 | * Provider for serviceDescription property. 136 | */ 137 | val serviceDescriptionProvider: Provider 138 | get() = serviceDescriptionProperty 139 | 140 | /** 141 | * Generates the service descriptor (i.e. server.xml). Default is false. 142 | * Only valid if serverSide is true, the server side code generation option. 143 | * 144 | * @property serviceDescription 145 | */ 146 | var serviceDescription : Boolean 147 | get() = serviceDescriptionProperty.get() 148 | set(value) = serviceDescriptionProperty.set(value) 149 | 150 | /** 151 | * Provider for databindingMethod property. 152 | */ 153 | val databindingMethodProvider: Provider 154 | get() = databindingMethodProperty 155 | 156 | /** 157 | * Specifies the Databinding framework. 158 | * Valid values are 159 | * - xmlbeans -> XMLBEANS, 160 | * - adb -> ADB, 161 | * - jaxbri -> JAXBRI 162 | * - jibx -> JIBX, and 163 | * - none -> NONE. 164 | * Default is adb. 165 | * 166 | * @property databindingMethod 167 | */ 168 | var databindingMethod : String 169 | get() = databindingMethodProperty.get() 170 | set(value) = databindingMethodProperty.set(value) 171 | 172 | /** 173 | * Provider for generateAllClasses property. 174 | */ 175 | val generateAllClassesProvider: Provider 176 | get() = generateAllClassesProperty 177 | 178 | /** 179 | * Generates all the classes. This option is valid only if serverSide otpion is true. If the value is true, 180 | * the client code (stubs) will also be generated along with the skeleton. 181 | * 182 | * @property generateAllClasses 183 | */ 184 | var generateAllClasses : Boolean 185 | get() = generateAllClassesProperty.get() 186 | set(value) = generateAllClassesProperty.set(value) 187 | 188 | /** 189 | * Provider for unpackClasses property. 190 | */ 191 | val unpackClassesProvider: Provider 192 | get() = unpackClassesProperty 193 | 194 | /** 195 | * Unpack classes. This option specifies whether to unpack the classes and 196 | * generate separate classes for the databinders. 197 | * 198 | * @property unpackClasses 199 | */ 200 | var unpackClasses : Boolean 201 | get() = unpackClassesProperty.get() 202 | set(value) = unpackClassesProperty.set(value) 203 | 204 | /** 205 | * Provider for serviceName property. 206 | */ 207 | val serviceNameProvider: Provider 208 | get() = serviceNameProperty 209 | 210 | /** 211 | * Specifies the service name to be code generated. If the service name is not specified, 212 | * then the first service will be picked. 213 | * 214 | * @property serviceName 215 | */ 216 | var serviceName : String 217 | get() = serviceNameProperty.get() 218 | set(value) = serviceNameProperty.set(value) 219 | 220 | /** 221 | * Provider for portName property. 222 | */ 223 | val portNameProvider: Provider 224 | get() = portNameProperty 225 | 226 | /** 227 | * Specifies the port name to be code generated. If the port name is not specified, 228 | * then the first port (of the selected service) will be picked. 229 | * 230 | * @property portName 231 | */ 232 | var portName : String 233 | get() = portNameProperty.get() 234 | set(value) = portNameProperty.set(value) 235 | 236 | /** 237 | * Provider for serversideInterface property. 238 | */ 239 | val serversideInterfaceProvider: Provider 240 | get() = serversideInterfaceProperty 241 | 242 | /** 243 | * Generate an interface for the service skeleton. 244 | * 245 | * @property serversideInterface 246 | */ 247 | var serversideInterface : Boolean 248 | get() = serversideInterfaceProperty.get() 249 | set(value) = serversideInterfaceProperty.set(value) 250 | 251 | /** 252 | * Provider for wsdlVersion property. 253 | */ 254 | val wsdlVersionProvider: Provider 255 | get() = wsdlVersionProperty 256 | 257 | /** 258 | * WSDLExtension Version. Valid Options : 2, 2.0, 1.1 259 | * 260 | * @property wsdlVersion 261 | */ 262 | var wsdlVersion : String 263 | get() = wsdlVersionProperty.get() 264 | set(value) = wsdlVersionProperty.set(value) 265 | 266 | /** 267 | * Provider for flattenFiles property. 268 | */ 269 | val flattenFilesProvider: Provider 270 | get() = flattenFilesProperty 271 | 272 | /** 273 | * Flattens the generated files. 274 | * 275 | * @property flattenFiles 276 | */ 277 | var flattenFiles : Boolean 278 | get() = flattenFilesProperty.get() 279 | set(value) = flattenFilesProperty.set(value) 280 | 281 | /** 282 | * Provider for unwrapParams property. 283 | */ 284 | val unwrapParamsProvider: Provider 285 | get() = unwrapParamsProperty 286 | 287 | /** 288 | * Switch on un-wrapping, if this value is true. 289 | * 290 | * @property unwrapParams 291 | */ 292 | var unwrapParams : Boolean 293 | get() = unwrapParamsProperty.get() 294 | set(value) = unwrapParamsProperty.set(value) 295 | 296 | /** 297 | * Provider for xsdconfig property. 298 | */ 299 | val xsdconfigProvider: Provider 300 | get() = xsdconfigProperty 301 | 302 | /** 303 | * Use XMLBeans .xsdconfig file if this value is true. 304 | * This is only valid if databindingMethod is 'xmlbeans'. 305 | * 306 | * @property xsdconfig 307 | */ 308 | var xsdconfig : Boolean 309 | get() = xsdconfigProperty.get() 310 | set(value) = xsdconfigProperty.set(value) 311 | 312 | /** 313 | * Provider for allPorts property. 314 | */ 315 | val allPortsProvider: Provider 316 | get() = allPortsProperty 317 | 318 | /** 319 | * Generate code for all ports. 320 | * 321 | * @property allPorts 322 | */ 323 | var allPorts : Boolean 324 | get() = allPortsProperty.get() 325 | set(value) = allPortsProperty.set(value) 326 | 327 | /** 328 | * Provider for backwordCompatible property. 329 | */ 330 | val backwordCompatibleProvider: Provider 331 | get() = backwordCompatibleProperty 332 | 333 | /** 334 | * Generate Axis 1.x backword compatible code. 335 | * 336 | * @property backwordCompatible 337 | */ 338 | var backwordCompatible : Boolean 339 | get() = backwordCompatibleProperty.get() 340 | set(value) = backwordCompatibleProperty.set(value) 341 | 342 | /** 343 | * Provider for suppressPrefixes property. 344 | */ 345 | val suppressPrefixesProvider: Provider 346 | get() = suppressPrefixesProperty 347 | 348 | /** 349 | * Suppress namespace prefixes (Optimzation that reduces size of soap request/response). 350 | * 351 | * @property suppressPrefixes 352 | */ 353 | var suppressPrefixes : Boolean 354 | get() = suppressPrefixesProperty.get() 355 | set(value) = suppressPrefixesProperty.set(value) 356 | 357 | /** 358 | * Provider for noMessageReceiver property. 359 | */ 360 | val noMessageReceiverProvider: Provider 361 | get() = noMessageReceiverProperty 362 | 363 | /** 364 | * Don't generate a MessageReceiver in the generated sources. 365 | * 366 | * @property noMessageReceiver 367 | */ 368 | var noMessageReceiver : Boolean 369 | get() = noMessageReceiverProperty.get() 370 | set(value) = noMessageReceiverProperty.set(value) 371 | 372 | /** 373 | * Provider for outputDir property. 374 | */ 375 | val outputDirProvider: Provider 376 | get() = outputDirProperty 377 | 378 | /** 379 | * Output directory for the generated code. 380 | * 381 | * @return file for output directory. 382 | */ 383 | var outputDir: File 384 | get() = outputDirProperty.get().asFile 385 | set(value) = this.outputDirProperty.set(value) 386 | 387 | /** 388 | * Calculate the task name for the task. 389 | * @return task name for configuration 390 | */ 391 | fun getTaskName(): String { 392 | return "axis2Wsdl2java${name.toCamelCase()}" 393 | } 394 | 395 | private fun String.toCamelCase() : String { 396 | return split(" ").joinToString("") { 397 | it.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() } } 398 | } 399 | } 400 | -------------------------------------------------------------------------------- /src/test/groovy/com/intershop/gradle/wsdl/Axis2IntegrationSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl 17 | 18 | import com.intershop.gradle.test.AbstractIntegrationGroovySpec 19 | 20 | import static org.gradle.testkit.runner.TaskOutcome.SUCCESS 21 | import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE 22 | 23 | class Axis2IntegrationSpec extends AbstractIntegrationGroovySpec { 24 | 25 | def 'Test code generation faulthandling'() { 26 | given: 27 | copyResources('axis2/faulthandling/bank.wsdl', 'staticfiles/wsdl/bank.wsdl') 28 | 29 | buildFile << """ 30 | plugins { 31 | id 'java' 32 | id 'com.intershop.gradle.wsdl' 33 | } 34 | 35 | wsdl { 36 | axis2 { 37 | bank { 38 | wsdlFile = file('staticfiles/wsdl/bank.wsdl') 39 | serverSide = true 40 | serviceDescription = true 41 | packageName = 'sample.bank.service' 42 | } 43 | } 44 | } 45 | 46 | repositories { 47 | mavenCentral() 48 | } 49 | 50 | dependencies { 51 | implementation 'org.apache.axis2:axis2:1.7.7' 52 | implementation 'org.apache.axis2:axis2-adb:1.7.7' 53 | } 54 | """.stripIndent() 55 | 56 | when: 57 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 58 | def result1 = getPreparedGradleRunner() 59 | .withArguments(args) 60 | .withGradleVersion(gradleVersion) 61 | .build() 62 | 63 | then: 64 | result1.task(':axis2Wsdl2javaBank').outcome == SUCCESS 65 | result1.task(':compileJava').outcome == SUCCESS 66 | 67 | when: 68 | def result2 = getPreparedGradleRunner() 69 | .withArguments(args) 70 | .withGradleVersion(gradleVersion) 71 | .build() 72 | 73 | then: 74 | result2.task(':axis2Wsdl2javaBank').outcome == UP_TO_DATE 75 | result2.task(':compileJava').outcome == UP_TO_DATE 76 | 77 | where: 78 | gradleVersion << supportedGradleVersions 79 | } 80 | 81 | def 'Test code generation mtom'() { 82 | given: 83 | copyResources('axis2/mtom/MTOMSample.wsdl', 'staticfiles/wsdl/MTOMSample.wsdl') 84 | copyResources('axis2/mtom/xmime.xsd', 'staticfiles/wsdl/xmime.xsd') 85 | buildFile << """ 86 | plugins { 87 | id 'java' 88 | id 'com.intershop.gradle.wsdl' 89 | } 90 | 91 | wsdl { 92 | axis2 { 93 | mtom { 94 | wsdlFile = file('staticfiles/wsdl/MTOMSample.wsdl') 95 | serverSide = true 96 | allPorts = true 97 | serviceDescription = true 98 | packageName = 'sample.mtom.service' 99 | } 100 | } 101 | } 102 | 103 | repositories { 104 | mavenCentral() 105 | } 106 | 107 | dependencies { 108 | implementation 'org.apache.axis2:axis2:1.7.7' 109 | implementation 'org.apache.axis2:axis2-adb:1.7.7' 110 | } 111 | """.stripIndent() 112 | 113 | when: 114 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 115 | def result = getPreparedGradleRunner() 116 | .withArguments(args) 117 | .withGradleVersion(gradleVersion) 118 | .build() 119 | 120 | then: 121 | result.task(':axis2Wsdl2javaMtom').outcome == SUCCESS 122 | result.task(':compileJava').outcome == SUCCESS 123 | 124 | where: 125 | gradleVersion << supportedGradleVersions 126 | } 127 | 128 | def 'Test code generation qstartadb'() { 129 | given: 130 | copyResources('axis2/quickstartadb/StockQuoteService.wsdl', 'staticfiles/wsdl/StockQuoteService.wsdl') 131 | 132 | buildFile << """ 133 | plugins { 134 | id 'java' 135 | id 'com.intershop.gradle.wsdl' 136 | } 137 | 138 | wsdl { 139 | axis2 { 140 | qstartadb { 141 | wsdlFile = file('staticfiles/wsdl/StockQuoteService.wsdl') 142 | sync = true 143 | serverSide = true 144 | serviceDescription = true 145 | serversideInterface = true 146 | allPorts = true 147 | packageName = 'samples.quickstart.service.adb' 148 | namespacePackageMappings { 149 | quickstart { 150 | namespace = 'http://quickstart.samples/xsd' 151 | packageName = 'samples.quickstart.service.adb.xsd' 152 | } 153 | } 154 | databindingMethod = 'adb' 155 | } 156 | } 157 | } 158 | 159 | repositories { 160 | mavenCentral() 161 | } 162 | 163 | dependencies { 164 | implementation 'org.apache.axis2:axis2:1.7.7' 165 | implementation 'org.apache.axis2:axis2-adb:1.7.7' 166 | } 167 | """.stripIndent() 168 | 169 | when: 170 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 171 | def result = getPreparedGradleRunner() 172 | .withArguments(args) 173 | .withGradleVersion(gradleVersion) 174 | .build() 175 | 176 | then: 177 | result.task(':axis2Wsdl2javaQstartadb').outcome == SUCCESS 178 | result.task(':compileJava').outcome == SUCCESS 179 | (new File(testProjectDir, 'build/generated/wsdl2java/axis2/qstartadb/resources/services.xml')).exists() 180 | (new File(testProjectDir, 'build/generated/wsdl2java/axis2/qstartadb/src/samples/quickstart/service/adb/StockQuoteServiceSkeleton.java')).exists() 181 | 182 | where: 183 | gradleVersion << supportedGradleVersions 184 | } 185 | 186 | def 'Test code generation qstartjibx'() { 187 | given: 188 | copyResources('axis2/quickstartadb/StockQuoteService.wsdl', 'staticfiles/wsdl/StockQuoteService.wsdl') 189 | 190 | buildFile << """ 191 | plugins { 192 | id 'java' 193 | id 'com.intershop.gradle.wsdl' 194 | } 195 | 196 | wsdl { 197 | axis2 { 198 | qstartjibx { 199 | wsdlFile = file('staticfiles/wsdl/StockQuoteService.wsdl') 200 | sync = true 201 | serverSide = true 202 | unwrapParams = true 203 | serviceDescription = true 204 | serversideInterface = true 205 | allPorts = true 206 | packageName = 'samples.quickstart.service.jibx' 207 | namespacePackageMappings { 208 | quickstart { 209 | namespace = 'http://quickstart.samples/xsd' 210 | packageName = 'samples.quickstart.service.jibx.xsd' 211 | } 212 | } 213 | databindingMethod = 'jibx' 214 | } 215 | } 216 | } 217 | 218 | repositories { 219 | mavenCentral() 220 | } 221 | 222 | configurations { 223 | wsdlAxis2.extendsFrom(implementation) 224 | } 225 | 226 | dependencies { 227 | implementation 'org.apache.axis2:axis2:1.7.3' 228 | implementation 'org.apache.axis2:axis2-kernel:1.7.3' 229 | implementation 'org.apache.axis2:axis2-jibx:1.7.3' 230 | implementation 'org.jibx:jibx-run:1.2' 231 | implementation 'org.jibx:jibx-bind:1.2' 232 | 233 | wsdlAxis2 'org.apache.axis2:axis2-codegen:1.7.3' 234 | wsdlAxis2 'wsdl4j:wsdl4j:1.6.3' 235 | wsdlAxis2 'commons-logging:commons-logging:1.2' 236 | wsdlAxis2 'org.apache.neethi:neethi:3.0.3' 237 | wsdlAxis2 'org.apache.ws.commons.axiom:axiom-api:1.2.20' 238 | wsdlAxis2 'org.apache.ws.commons.axiom:axiom-impl:1.2.20' 239 | wsdlAxis2 'org.apache.woden:woden-core:1.0M10' 240 | wsdlAxis2 'org.apache.ws.xmlschema:xmlschema-core:2.2.1' 241 | } 242 | """.stripIndent() 243 | 244 | when: 245 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 246 | def result = getPreparedGradleRunner() 247 | .withArguments(args) 248 | .withGradleVersion(gradleVersion) 249 | .build() 250 | 251 | then: 252 | result.task(':axis2Wsdl2javaQstartjibx').outcome == SUCCESS 253 | result.task(':compileJava').outcome == SUCCESS 254 | (new File(testProjectDir, 'build/generated/wsdl2java/axis2/qstartjibx/resources/services.xml')).exists() 255 | (new File(testProjectDir, 'build/generated/wsdl2java/axis2/qstartjibx/src/samples/quickstart/service/jibx/StockQuoteServiceSkeleton.java')).exists() 256 | 257 | where: 258 | gradleVersion << supportedGradleVersions 259 | } 260 | 261 | def 'Test code generation databinding'() { 262 | given: 263 | copyResources('axis2/databinding/StockQuoteService.wsdl', 'staticfiles/wsdl/StockQuoteService.wsdl') 264 | copyResources('axis2/databinding/StockQuote.xsd', 'staticfiles/wsdl/StockQuote.xsd') 265 | 266 | buildFile << """ 267 | plugins { 268 | id 'java' 269 | id 'com.intershop.gradle.wsdl' 270 | } 271 | 272 | wsdl { 273 | axis2 { 274 | databinding { 275 | wsdlFile = file('staticfiles/wsdl/StockQuoteService.wsdl') 276 | serverSide = true 277 | allPorts = true 278 | serviceDescription = true 279 | packageName = 'samples.databinding' 280 | databindingMethod = 'none' 281 | } 282 | } 283 | } 284 | 285 | repositories { 286 | mavenCentral() 287 | } 288 | 289 | dependencies { 290 | implementation 'org.apache.axis2:axis2:1.7.7' 291 | implementation 'org.apache.axis2:axis2-kernel:1.7.7' 292 | } 293 | """.stripIndent() 294 | 295 | when: 296 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 297 | def result = getPreparedGradleRunner() 298 | .withArguments(args) 299 | .withGradleVersion(gradleVersion) 300 | .build() 301 | 302 | then: 303 | result.task(':axis2Wsdl2javaDatabinding').outcome == SUCCESS 304 | result.task(':compileJava').outcome == SUCCESS 305 | 306 | where: 307 | gradleVersion << supportedGradleVersions 308 | } 309 | 310 | def 'Test code generation faulthandling with javaOptions'() { 311 | given: 312 | copyResources('axis2/faulthandling/bank.wsdl', 'staticfiles/wsdl/bank.wsdl') 313 | 314 | buildFile << """ 315 | plugins { 316 | id 'java' 317 | id 'com.intershop.gradle.wsdl' 318 | } 319 | 320 | wsdl { 321 | axis2 { 322 | bank { 323 | wsdlFile = file('staticfiles/wsdl/bank.wsdl') 324 | serverSide = true 325 | serviceDescription = true 326 | packageName = 'sample.bank.service' 327 | } 328 | } 329 | } 330 | 331 | tasks.withType(com.intershop.gradle.wsdl.tasks.axis2.WSDL2Java) { 332 | forkOptions { JavaForkOptions options -> 333 | options.setMaxHeapSize('64m') 334 | options.jvmArgs += ["-XX:-UseSerialGC"] 335 | options.systemProperty('http.proxyHost', 'test.host.com') 336 | options.systemProperty('http.proxyPort', '8081') 337 | options.systemProperty('https.proxyHost', 'test.host.com') 338 | options.systemProperty('https.proxyPort', '4081') 339 | } 340 | } 341 | 342 | repositories { 343 | mavenCentral() 344 | } 345 | 346 | dependencies { 347 | implementation 'org.apache.axis2:axis2:1.7.3' 348 | implementation 'org.apache.axis2:axis2-adb:1.7.3' 349 | } 350 | """.stripIndent() 351 | 352 | when: 353 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 354 | def result = getPreparedGradleRunner() 355 | .withArguments(args) 356 | .withGradleVersion(gradleVersion) 357 | .build() 358 | 359 | then: 360 | result.task(':axis2Wsdl2javaBank').outcome == SUCCESS 361 | result.task(':compileJava').outcome == SUCCESS 362 | 363 | where: 364 | gradleVersion << supportedGradleVersions 365 | } 366 | 367 | def 'Test code generation add number service'() { 368 | given: 369 | copyResources('axis2/addnumberservice/AddNumbersService.wsdl', 'staticfiles/wsdl/AddNumbersService.wsdl') 370 | 371 | buildFile << """ 372 | plugins { 373 | id 'java' 374 | id 'com.intershop.gradle.wsdl' 375 | } 376 | 377 | wsdl { 378 | axis2 { 379 | numberservice { 380 | wsdlFile = file('staticfiles/wsdl/AddNumbersService.wsdl') 381 | databindingMethod = 'jaxbri' 382 | wsdlVersion = '1.1' 383 | } 384 | } 385 | } 386 | 387 | repositories { 388 | mavenCentral() 389 | } 390 | 391 | dependencies { 392 | implementation 'org.apache.axis2:axis2:1.7.7' 393 | implementation 'org.apache.axis2:axis2-jaxbri:1.7.7' 394 | } 395 | """.stripIndent() 396 | 397 | when: 398 | List args = ['compileJava', '-s', '-i', '--configure-on-demand', '--parallel', '--max-workers=4'] 399 | def result = getPreparedGradleRunner() 400 | .withArguments(args) 401 | .withGradleVersion(gradleVersion) 402 | .build() 403 | 404 | then: 405 | result.task(':axis2Wsdl2javaNumberservice').outcome == SUCCESS 406 | result.task(':compileJava').outcome == SUCCESS 407 | 408 | where: 409 | gradleVersion << supportedGradleVersions 410 | } 411 | } 412 | -------------------------------------------------------------------------------- /src/main/kotlin/com/intershop/gradle/wsdl/extension/Axis1.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Intershop Communications AG. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.intershop.gradle.wsdl.extension 17 | 18 | import com.intershop.gradle.wsdl.extension.data.WSDLProperty 19 | import org.gradle.api.NamedDomainObjectContainer 20 | import org.gradle.api.file.Directory 21 | import org.gradle.api.file.ProjectLayout 22 | import org.gradle.api.model.ObjectFactory 23 | import org.gradle.api.provider.Provider 24 | import java.io.File 25 | import java.util.* 26 | import javax.inject.Inject 27 | 28 | /** 29 | * Axis 1 Configuration container. 30 | * 31 | * @constructur default constructor with project and configuration name. 32 | */ 33 | open class Axis1 @Inject constructor(name: String, objectFactory: ObjectFactory, layout: ProjectLayout): 34 | AbstractAxisConfig(name, objectFactory) { 35 | 36 | companion object { 37 | /** 38 | * Default timeout configuration value. 39 | */ 40 | const val TIMEOUT = 240 41 | } 42 | 43 | // Integer 44 | private val timeoutProperty = objectFactory.property(Int::class.java) 45 | 46 | // Boolean 47 | private val noImportsProperty = objectFactory.property(Boolean::class.java) 48 | private val noWrappedProperty = objectFactory.property(Boolean::class.java) 49 | private val serverSideProperty = objectFactory.property(Boolean::class.java) 50 | private val skeletonDeployProperty = objectFactory.property(String::class.java) 51 | private val generateAllClassesProperty = objectFactory.property(Boolean::class.java) 52 | private val helperGenProperty = objectFactory.property(Boolean::class.java) 53 | private val wrapArraysProperty = objectFactory.property(Boolean::class.java) 54 | private val allowInvalidURLProperty = objectFactory.property(Boolean::class.java) 55 | 56 | // Strings 57 | private val deployScopeProperty = objectFactory.property(String::class.java) 58 | private val typeMappingVersionProperty = objectFactory.property(String::class.java) 59 | private val factoryProperty = objectFactory.property(String::class.java) 60 | private val userNameProperty = objectFactory.property(String::class.java) 61 | private val passwordProperty = objectFactory.property(String::class.java) 62 | private val implementationClassNameProperty = objectFactory.property(String::class.java) 63 | private val nsIncludeProperty = objectFactory.property(String::class.java) 64 | private val nsExcludeProperty = objectFactory.property(String::class.java) 65 | 66 | private val outputDirProperty = objectFactory.directoryProperty() 67 | 68 | init { 69 | noImportsProperty.convention(false) 70 | timeoutProperty.convention(TIMEOUT) 71 | noWrappedProperty.convention(false) 72 | serverSideProperty.convention(false) 73 | skeletonDeployProperty.convention("") 74 | deployScopeProperty.convention("") 75 | generateAllClassesProperty.convention(false) 76 | typeMappingVersionProperty.convention("1.2") 77 | factoryProperty.convention("") 78 | helperGenProperty.convention(false) 79 | userNameProperty.convention("") 80 | passwordProperty.convention("") 81 | implementationClassNameProperty.convention("") 82 | wrapArraysProperty.convention(false) 83 | allowInvalidURLProperty.convention(false) 84 | nsIncludeProperty.convention("") 85 | nsExcludeProperty.convention("") 86 | 87 | outputDirProperty.convention(layout.buildDirectory.dir( 88 | "${WSDLExtension.CODEGEN_OUTPUTPATH}/axis1/${name.replace(' ', '_')}" 89 | )) 90 | } 91 | 92 | /** 93 | * Names and values of a properties for use by the custom GeneratorFactory. 94 | */ 95 | val wsdlProperties: NamedDomainObjectContainer 96 | = objectFactory.domainObjectContainer(WSDLProperty::class.java) 97 | 98 | /** 99 | * Provider for noImports property. 100 | */ 101 | val noImportsProvider: Provider 102 | get() = noImportsProperty 103 | 104 | /** 105 | * Only generate code for the WSDLExtension document that appears on the command line if this 106 | * value is true. The default behaviour is to generate files for all WSDLExtension documents, 107 | * the immediate one and all imported ones. 108 | * 109 | * @property noImports 110 | */ 111 | var noImports : Boolean 112 | get() = noImportsProperty.get() 113 | set(value) = noImportsProperty.set(value) 114 | 115 | /** 116 | * Provider for timeout property. 117 | */ 118 | val timeoutProvider: Provider 119 | get() = timeoutProperty 120 | 121 | /** 122 | * Timeout in seconds. The default is 240. 123 | * Use -1 to disable the timeout. 124 | * 125 | * @property timeout 126 | */ 127 | var timeout : Int 128 | get() = timeoutProperty.get() 129 | set(value) = timeoutProperty.set(value) 130 | 131 | /** 132 | * Provider for noWrapped property. 133 | */ 134 | val noWrappedProvider: Provider 135 | get() = noWrappedProperty 136 | 137 | /** 138 | * If this value is true, it turns off the special treatment of what is called "wrapped" document/literal 139 | * style operations. By default, WSDL2Java will recognize the following conditions: 140 | * - If an input message has is a single part. 141 | * - The part is an element. 142 | * - The element has the same name as the operation 143 | * - The element's complex type has no attributes 144 | * If this value is true, WSDL2Java will 'unwrap' the top level element, and treat each of the 145 | * components of the element as arguments to the operation. This type of WSDLExtension is the 146 | * default for Microsoft .NET web services, which wrap up RPC style arguments in this top level schema element. 147 | * 148 | * @property noWrapped 149 | */ 150 | var noWrapped : Boolean 151 | get() = noWrappedProperty.get() 152 | set(value) = noWrappedProperty.set(value) 153 | 154 | /** 155 | * Provider for serverSide property. 156 | */ 157 | val serverSideProvider: Provider 158 | get() = serverSideProperty 159 | 160 | /** 161 | * Emit the server-side bindings for the web service. 162 | * 163 | * @property serverSide 164 | */ 165 | var serverSide : Boolean 166 | get() = serverSideProperty.get() 167 | set(value) = serverSideProperty.set(value) 168 | 169 | /** 170 | * Provider for skeletonDeploy property. 171 | */ 172 | val skeletonDeployProvider: Provider 173 | get() = skeletonDeployProperty 174 | 175 | /** 176 | * Deploy either the skeleton (true) or the implementation (false) in deploy.wsdd. In other words, for "true" 177 | * the service clause in the deploy.wsdd file will look something like: 178 | *

179 |      * 
180 |      *     
181 |      *     ...
182 |      * 
183 |      * 

184 | * and for "false" it would look like: 185 | *

186 |      * 
187 |      *     
188 |      *     ...
189 |      * 
190 |      * 

191 | * If this configuration is used, serverSide is automatically set to true. 192 | * 193 | * @property skeletonDeploy 194 | */ 195 | var skeletonDeploy : String 196 | get() = skeletonDeployProperty.get() 197 | set(value) = skeletonDeployProperty.set(value) 198 | 199 | /** 200 | * Provider for deployScope property. 201 | */ 202 | val deployScopeProvider: Provider 203 | get() = deployScopeProperty 204 | 205 | /** 206 | * Add scope to deploy.wsdd: 207 | * - APPLICATION -> "Application", 208 | * - REQUEST -> "Request", or 209 | * - SESSION -> "Session". 210 | * If this option does not appear, no scope tag appears in deploy.wsdd, 211 | * which the Axis runtime defaults to "Request". 212 | * 213 | * @property deployScope 214 | */ 215 | var deployScope : String 216 | get() = deployScopeProperty.get() 217 | set(value) = deployScopeProperty.set(value) 218 | 219 | /** 220 | * Provider for generateAllClasses property. 221 | */ 222 | val generateAllClassesProvider: Provider 223 | get() = generateAllClassesProperty 224 | 225 | /** 226 | * Generate code for all elements, even unreferenced ones. By default, 227 | * WSDL2Java only generates code for those elements in the WSDLExtension file that are referenced. 228 | * 229 | * A note about what it means to be referenced. We cannot simply say: start with the services, 230 | * generate all bindings referenced by the service, generate all portTypes referenced by the referenced 231 | * bindings, etc. What if we're generating code from a WSDLExtension file that only contains portTypes, messages, 232 | * and types? If WSDL2Java used service as an anchor, and there's no service in the file, then nothing 233 | * will be generated. So the anchor is the lowest element that exists in the WSDLExtension file in the order: 234 | * - types 235 | * - portTypes 236 | * - bindings 237 | * - services 238 | * For example, if a WSDLExtension file only contained types, then all the listed types would be generated. 239 | * But if a WSDLExtension file contained types and a portType, then that portType will be generated and only those 240 | * types that are referenced by that portType. 241 | * 242 | * Note that the anchor is searched for in the WSDLExtension file appearing on the command line, not 243 | * in imported WSDLExtension files. This allows one WSDLExtension file to import constructs defined 244 | * in another WSDLExtension file without the nuisance of having all the imported WSDLExtension file's 245 | * constructs generated. 246 | * 247 | * @property generateAllClasses 248 | */ 249 | var generateAllClasses : Boolean 250 | get() = generateAllClassesProperty.get() 251 | set(value) = generateAllClassesProperty.set(value) 252 | 253 | /** 254 | * Provider for typeMappingVersion property. 255 | */ 256 | val typeMappingVersionProvider: Provider 257 | get() = typeMappingVersionProperty 258 | 259 | /** 260 | * Indicate 1.1 or 1.2. The default is 1.2 (SOAP 1.2 JAX-RPC compliant). 261 | * 262 | * @property typeMappingVersion 263 | */ 264 | var typeMappingVersion : String 265 | get() = typeMappingVersionProperty.get() 266 | set(value) = typeMappingVersionProperty.set(value) 267 | 268 | /** 269 | * Provider for factory property. 270 | */ 271 | val factoryProvider: Provider 272 | get() = factoryProperty 273 | 274 | /** 275 | * Used to extend the functionality of the WSDL2Java emitter. 276 | * The argument is the name of a class which extends JavaWriterFactory. 277 | * 278 | * @property factory 279 | */ 280 | var factory : String 281 | get() = factoryProperty.get() 282 | set(value) = factoryProperty.set(value) 283 | 284 | /** 285 | * Provider for helperGen property. 286 | */ 287 | val helperGenProvider: Provider 288 | get() = helperGenProperty 289 | 290 | /** 291 | * Emits separate Helper classes for meta data. 292 | * 293 | * @property helperGen 294 | */ 295 | var helperGen : Boolean 296 | get() = helperGenProperty.get() 297 | set(value) = helperGenProperty.set(value) 298 | 299 | /** 300 | * Provider for userName property. 301 | */ 302 | val userNameProvider: Provider 303 | get() = userNameProperty 304 | 305 | /** 306 | * This username is used in resolving the WSDLExtension-URI provided as the input to WSDL2Java. 307 | * If the URI contains a username, this will override the command line switch. An example 308 | * of a URL with a username and password is: http://user:password@hostname:port/path/to/service?WSDL 309 | * 310 | * @property userName 311 | */ 312 | var userName : String 313 | get() = userNameProperty.get() 314 | set(value) = userNameProperty.set(value) 315 | 316 | /** 317 | * Provider for password property. 318 | */ 319 | val passwordProvider: Provider 320 | get() = passwordProperty 321 | 322 | /** 323 | * This password is used in resolving the WSDLExtension-URI provided as the input to WSDL2Java. 324 | * If the URI contains a password, this will override the command line switch. 325 | * 326 | * @property password 327 | */ 328 | var password : String 329 | get() = passwordProperty.get() 330 | set(value) = passwordProperty.set(value) 331 | 332 | /** 333 | * Provider for implementationClassName property. 334 | */ 335 | val implementationClassNameProvider: Provider 336 | get() = implementationClassNameProperty 337 | 338 | /** 339 | * Set the name of the implementation class. Especially useful when exporting an existing class as 340 | * a web service using java2wsdl followed by wsdl2java. If you are using the skeleton deploy option 341 | * you must make sure, after generation, that your implementation class implements the port type name 342 | * interface generated by wsdl2java. You should also make sure that all your exported methods throws 343 | * java.lang.RemoteException. 344 | * 345 | * @property implementationClassName 346 | */ 347 | var implementationClassName : String 348 | get() = implementationClassNameProperty.get() 349 | set(value) = implementationClassNameProperty.set(value) 350 | 351 | /** 352 | * Provider for wrapArrays property. 353 | */ 354 | val wrapArraysProvider: Provider 355 | get() = wrapArraysProperty 356 | 357 | /** 358 | * When processing a schema like this: 359 | *

360 |      * 
361 |      *    
362 |      *       
363 |      *          
364 |      *       
365 |      *    
366 |      * 
367 |      * 

368 | * The default behavior (as of Axis 1.2 final) is to map this XML construct to a Java String 369 | * array (String[]). If you would rather a specific JavaBean class (i.e. ArrayOfString) be 370 | * generated for these types of schemas, you may specify the -w or --wrapArrays option. 371 | * 372 | * @property wrapArrays 373 | */ 374 | var wrapArrays : Boolean 375 | get() = wrapArraysProperty.get() 376 | set(value) = wrapArraysProperty.set(value) 377 | 378 | /** 379 | * Provider for allowInvalidURL property. 380 | */ 381 | val allowInvalidURLProvider: Provider 382 | get() = allowInvalidURLProperty 383 | 384 | /** 385 | * This flag is used to allow Stub generation even if WSDLExtension endpoint URL is not a valid URL. 386 | * It's the responsibility of the user to update the endpoint value before using generated classes 387 | * default=false 388 | * 389 | * @property allowInvalidURL 390 | */ 391 | var allowInvalidURL : Boolean 392 | get() = allowInvalidURLProperty.get() 393 | set(value) = allowInvalidURLProperty.set(value) 394 | 395 | /** 396 | * Provider for nsInclude property. 397 | */ 398 | val nsIncludeProvider: Provider 399 | get() = nsIncludeProperty 400 | 401 | /** 402 | * Namespace to specifically exclude from the generated code (defaults to 403 | * none excluded until first namespace included with -i option). 404 | * 405 | * @property nsInclude 406 | */ 407 | var nsInclude : String 408 | get() = nsIncludeProperty.get() 409 | set(value) = nsIncludeProperty.set(value) 410 | 411 | /** 412 | * Provider for nsExclude property. 413 | */ 414 | val nsExcludeProvider: Provider 415 | get() = nsExcludeProperty 416 | 417 | /** 418 | * Namescape to specifically include in the generated code (defaults to 419 | * all namespaces unless specifically excluded with the -x option). 420 | * 421 | * @property nsExclude 422 | */ 423 | var nsExclude : String 424 | get() = nsExcludeProperty.get() 425 | set(value) = nsExcludeProperty.set(value) 426 | 427 | /** 428 | * Provider for outputDir property. 429 | */ 430 | val outputDirProvider: Provider 431 | get() = outputDirProperty 432 | 433 | /** 434 | * Output directory for the generated code. 435 | * 436 | * @return file for output directory. 437 | */ 438 | var outputDir: File 439 | get() = outputDirProperty.get().asFile 440 | set(value) = this.outputDirProperty.set(value) 441 | 442 | /** 443 | * Calculate the task name for the task. 444 | * @return task name for configuration 445 | */ 446 | fun getTaskName(): String { 447 | return "axis1Wsdl2java${name.toCamelCase()}" 448 | } 449 | 450 | private fun String.toCamelCase() : String { 451 | return split(" ").joinToString("") { 452 | it.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() } } 453 | } 454 | } 455 | --------------------------------------------------------------------------------