diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..9af12cbdd1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "8", + "installMaven": "true", + "mavenVersion": "3.9.1" + } + }, + "hostRequirements": { + "memory": "8gb" + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..a751db8027 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Continuous Integration + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ '*' ] + +env: + MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 + +jobs: + build: + strategy: + fail-fast: false + matrix: + java: [ 8 ] + name: "Java ${{ matrix.java }}" + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache Maven Repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: maven-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-java-${{ matrix.java }}- + maven- + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Build + run: mvn -B -e -Papache-release -Dgpg.skip=true install site + - name: Remove Snapshots + run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..23bb21a237 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.project +.classpath +.settings +target \ No newline at end of file diff --git a/README b/README index 7e3245af71..8e4d11f56b 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Axis (Apache eXtensible Interaction System) - ------------------------------------------- + ------------------------------------------- Welcome to Axis! You'll find documentation in the docs/ directory. diff --git a/apidocs/pom.xml b/apidocs/pom.xml new file mode 100644 index 0000000000..d1fe3e6219 --- /dev/null +++ b/apidocs/pom.xml @@ -0,0 +1,202 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + apidocs + pom + Javadoc + ${baseUrl}/apiDocs + + + axis + ${baseSiteUrl}/apiDocs + + + + 1.5 + + + + ${project.groupId} + axis-ant + ${project.version} + + + ${project.groupId} + axis-codegen + ${project.version} + + + ${project.groupId} + axis-jaxrpc + ${project.version} + + + ${project.groupId} + axis-rt-core + ${project.version} + + + ${project.groupId} + axis-rt-databinding-castor + ${project.version} + + + ${project.groupId} + axis-rt-databinding-xmlbeans + ${project.version} + + + ${project.groupId} + axis-rt-jws + ${project.version} + + + ${project.groupId} + axis-rt-management + ${project.version} + + + ${project.groupId} + axis-rt-provider-bsf + ${project.version} + + + ${project.groupId} + axis-rt-soapmonitor + ${project.version} + + + ${project.groupId} + axis-rt-transport-http-hc3 + ${project.version} + + + ${project.groupId} + axis-rt-transport-http-javanet + ${project.version} + + + ${project.groupId} + axis-rt-transport-jms + ${project.version} + + + ${project.groupId} + axis-rt-transport-mail + ${project.version} + + + ${project.groupId} + axis-saaj + ${project.version} + + + ${project.groupId} + axis-standalone-server + ${project.version} + + + ${project.groupId} + axis-tools + ${project.version} + + + ${project.groupId} + soapmonitor-client + ${project.version} + + + ${project.groupId} + tcpmon + ${project.version} + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9 + + + site-javadoc + site + + javadoc + + + ${project.reporting.outputDirectory} + . + + + + + true + + ${project.groupId}:* + + + org.xmlsoap.schemas.* + + false + + http://download.oracle.com/javaee/1.4/api/ + + true + + true + Apache Axis + Copyright © {organizationName}. All Rights Reserved. + + Apache Axis ${project.version} + + + ant.task + X + + + + + + maven-site-plugin + + + default-site + site + + site + + + true + + + + + + + diff --git a/axis-ant/pom.xml b/axis-ant/pom.xml index 79868d2b8d..5f86fd6ea8 100644 --- a/axis-ant/pom.xml +++ b/axis-ant/pom.xml @@ -26,7 +26,7 @@ ../pom.xml axis-ant - Axis :: Ant tasks + Ant Tasks ${baseUrl}/ant @@ -61,6 +61,11 @@ commons-io test + + log4j + log4j + test + @@ -76,12 +81,17 @@ - - + + + + + + + @@ -93,22 +103,201 @@ - - - - + - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - + org.codehaus.mojo + build-helper-maven-plugin + + + process-test-classes + + add-test-source + + + + ${project.build.directory}/work + + + + + + + + maven-compiler-plugin + + + testCompile-phase2 + process-test-classes + + testCompile + + + + + + maven-surefire-plugin + + + + test/wsdl/clash/SharedName_ServiceTestCase.java + test/wsdl/header/HeaderServiceTestCase.java + test/wsdl/multibinding/MbServiceTestCase.java + + + + + com.github.veithen.filecheck + filecheck-maven-plugin + + + test + + check-multiple + + + + + ${project.build.directory}/work/test/wsdl/axis2900 + + Exception.java + MyWS.java + MyWSException.java + MyWSLocator.java + MyWSPortType.java + MyWSSoap11BindingStub.java + + + + ${project.build.directory}/work/test/wsdl/clash + + AnotherNonSharedNameImpl.java + AnotherNonSharedNameStub.java + DescribeLayoutType0.java + DescribeLayout.java + NonSharedNameImpl.java + NonSharedNameStub.java + SayHello.java + SharedName_PortType.java + SharedName_Service.java + SharedName_ServiceLocator.java + SharedName_ServiceTestCase.java + SharedName_Type.java + deploy.wsdd + undeploy.wsdd + + + SharedName_Type_Helper.java + + + + ${project.build.directory}/work/test/wsdl/extra/gen + + Extra.java + MyService.java + MyServiceService.java + MyServiceServiceLocator.java + MyServiceSoapBindingStub.java + MyService.wsdl + + + + ${project.build.directory}/work/test/wsdl/filegenAll + + Address.java + OpFault.java + PortTypeSoap.java + ReferenceService.java + ReferenceServiceLocator.java + ReferenceSoapBindingStub.java + StateType.java + + + + ${project.build.directory}/work/test/wsdl/filegen + + OpFault.java + PortTypeSoap.java + ReferenceService.java + ReferenceServiceLocator.java + ReferenceSoapBindingStub.java + + + + ${project.build.directory}/work/test/wsdl/groups + + SomeType.java + + + + ${project.build.directory}/work/test/wsdl/header + + BindingImpl.java + BindingSkeleton.java + BindingStub.java + HeaderService.java + HeaderServiceLocator.java + HeaderServiceTestCase.java + HeaderType.java + ImplicitFault.java + Op1Fault.java + PortType.java + deploy.wsdd + undeploy.wsdd + + + + ${project.build.directory}/work/test/wsdl/literal + + SalesRankNPrice1.java + SalesRanks.java + Prices.java + All.java + SalesRankNPriceSoap.java + SalesRankNPriceSoapStub.java + SalesRankNPrice.java + SalesRankNPriceLocator.java + + + + ${project.build.directory}/work/test/wsdl/multibinding + + BindingAllLitImpl.java + BindingAllLitSkeleton.java + BindingAllLitStub.java + BindingNoLitImpl.java + BindingNoLitSkeleton.java + BindingNoLitStub.java + BindingSomeLitImpl.java + BindingSomeLitSkeleton.java + BindingSomeLitStub.java + MbPT.java + MbService.java + MbServiceLocator.java + MbServiceTestCase.java + deploy.wsdd + undeploy.wsdd + + + + + + + + + maven-javadoc-plugin + + + + ant.task + X + + + - + diff --git a/axis-ant/src/main/java/org/apache/axis/tools/ant/axis/AdminClientTask.java b/axis-ant/src/main/java/org/apache/axis/tools/ant/axis/AdminClientTask.java index 3f6ced409f..d2d008dbe2 100644 --- a/axis-ant/src/main/java/org/apache/axis/tools/ant/axis/AdminClientTask.java +++ b/axis-ant/src/main/java/org/apache/axis/tools/ant/axis/AdminClientTask.java @@ -245,8 +245,8 @@ public void traceParams(int logLevel) { * *

If -l or -h -p -s are not set, the * AdminClient will invoke - * http://localhost:8080/axis/servlet/AxisServlet.

- *

+ * http://localhost:8080/axis/servlet/AxisServlet. + *

* outputs XML result or null in case of failure. In the case of multiple * commands, the XML results will be concatenated, separated by \n * diff --git a/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamItem.java b/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamItem.java index 35de41cfeb..6051cac5b9 100644 --- a/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamItem.java +++ b/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamItem.java @@ -16,7 +16,7 @@ package org.apache.axis.tools.ant.foreach; /** - * Inner class stores s with lists + * Inner class stores <item>s with <param> lists * * @author Tim Vernum * @author Davanum Srinivas diff --git a/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamSet.java b/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamSet.java index 9bc7cb867b..13c0e806b1 100644 --- a/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamSet.java +++ b/axis-ant/src/main/java/org/apache/axis/tools/ant/foreach/ParamSet.java @@ -25,8 +25,8 @@ import java.util.Vector; /** - * Inner class stores sets of s. - * It can hold s or s or both. + * Inner class stores sets of <param>s. + * It can hold <fileset>s or <item>s or both. * * @author Tim Vernum * @author Davanum Srinivas diff --git a/axis-ant/src/main/java/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java b/axis-ant/src/main/java/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java index dac5dca097..efa0adeedb 100644 --- a/axis-ant/src/main/java/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java +++ b/axis-ant/src/main/java/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java @@ -59,7 +59,7 @@ * classes are generated overwriting anything that exists. *

* The safe way to use this task is to have it generate the java source in - * a build directory, then have a <copy> task selectively copy the + * a build directory, then have a <copy> task selectively copy the * files you need into a safe location. Again, copying into the source tree * is dangerous, but a separate build/src tree is safe. Then include this * separate tree in the <javac> task's src attribute to include it in the diff --git a/axis-ant/src/site/site.xml b/axis-ant/src/site/site.xml index 7da4ca3181..5690e9b05d 100644 --- a/axis-ant/src/site/site.xml +++ b/axis-ant/src/site/site.xml @@ -17,16 +17,18 @@ ~ specific language governing permissions and limitations ~ under the License. --> - +

- + + + diff --git a/axis-ant/src/site/xdoc/index.xml b/axis-ant/src/site/xdoc/ant.xml similarity index 100% rename from axis-ant/src/site/xdoc/index.xml rename to axis-ant/src/site/xdoc/ant.xml diff --git a/axis-ant/src/site/xdoc/foreach.xml b/axis-ant/src/site/xdoc/foreach.xml new file mode 100644 index 0000000000..a0faa4d0b1 --- /dev/null +++ b/axis-ant/src/site/xdoc/foreach.xml @@ -0,0 +1,100 @@ + + + + + Foreach Task + + + +
+ +

Call a target foreach entry in a set of parameters based on a fileset.

+

For Axis development; there is no support or stability associated with this task

+<target name="target1"> + <foreach target="target2"> + <param name="param1"> + <fileset refid="fset1"/> + </param> + <param name="param2"> + <item value="jar" /> + <item value="zip" /> + </param> + </foreach> + </target> + + <target name="target2"> + <echo message="prop is ${param1}.${param2}" /> + </target> +

Really this just a wrapper around "AntCall"
+ Added a "type" attribute that works precisely like + its equivalent in ExecuteOn. It allows + the user to specify whether directories, files, or + both directories and files from the filesets are + included as entries in the parameter set.

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionType
forkIf true, forks the ant invocation.boolean
inheritallIf true, pass all properties to the new Ant project. Defaults to true.boolean
inheritrefsIf true, pass all references to the new Ant project. Defaults to falseboolean
targetTarget to execute, required.java.lang.String
verboseEnable verbose output when signing ; optional: default falseboolean
+ +
+ +
+ +

param (org.apache.axis.tools.ant.foreach.ParamSet)

+ +
+ + +
diff --git a/axis-ant/src/site/xdoc/runaxisfunctionaltests.xml b/axis-ant/src/site/xdoc/runaxisfunctionaltests.xml new file mode 100644 index 0000000000..4904ca257e --- /dev/null +++ b/axis-ant/src/site/xdoc/runaxisfunctionaltests.xml @@ -0,0 +1,73 @@ + + + + + Runaxisfunctionaltests Task + + + +
+ +

Ant task for starting / stopping servers and running junit in the middle. Based on the Cactus org.apache.commons.cactus.ant package, heavily munged and cruftily dumped into one file.

+

For Axis development; there is no support or stability associated with this task

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionType
httpservertargetSets the target to call to start server 2.java.lang.String
httpstoptargetSets the stop target. This is the target which does a HTTP admin shutdown on the simple server.java.lang.String
tcpservertargetSets the target to call to start server 1.java.lang.String
testtargetSets the target to call to run the tests.java.lang.String
urlSets the target URL (just http://host:port)java.lang.String
+ +
+ + +
diff --git a/axis-ant/src/test/ant/axis2378/build.xml b/axis-ant/src/test/ant/axis2378/build.xml new file mode 100644 index 0000000000..ed1e8cf822 --- /dev/null +++ b/axis-ant/src/test/ant/axis2378/build.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/axis-ant/src/test/ant/axis2900/build.xml b/axis-ant/src/test/ant/axis2900/build.xml new file mode 100644 index 0000000000..ad0b37c4df --- /dev/null +++ b/axis-ant/src/test/ant/axis2900/build.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/axis-ant/src/test/ant/axis2901/build.xml b/axis-ant/src/test/ant/axis2901/build.xml new file mode 100644 index 0000000000..59542881eb --- /dev/null +++ b/axis-ant/src/test/ant/axis2901/build.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/axis-ant/src/test/ant/extra/build.xml b/axis-ant/src/test/ant/extra/build.xml index 655f09ec1c..018c9ebb34 100644 --- a/axis-ant/src/test/ant/extra/build.xml +++ b/axis-ant/src/test/ant/extra/build.xml @@ -1,10 +1,10 @@ - + - - - + diff --git a/axis-ant/src/test/ant/groups/build.xml b/axis-ant/src/test/ant/groups/build.xml new file mode 100644 index 0000000000..91a80ef481 --- /dev/null +++ b/axis-ant/src/test/ant/groups/build.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java b/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java index d76c496162..e73afa950b 100644 --- a/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java +++ b/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java @@ -26,7 +26,7 @@ public class CustomGeneratorFactoryTest extends TestCase { public void test() throws Exception { - File file = new File(System.getProperty("basedir", "."), "target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java"); + File file = new File("target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java"); assertTrue(FileUtils.readFileToString(file).contains("My header comment")); } } \ No newline at end of file diff --git a/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java deleted file mode 100644 index 29983c4636..0000000000 --- a/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - */ -package test.wsdl.clash; - -import test.wsdl.filegen.FileGenTestCase; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -public class VerifyFilesTestCase extends FileGenTestCase { - public VerifyFilesTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("AnotherNonSharedNameImpl.java"); - set.add("AnotherNonSharedNameStub.java"); - set.add("DescribeLayoutType0.java"); - set.add("DescribeLayout.java"); - set.add("NonSharedNameImpl.java"); - set.add("NonSharedNameStub.java"); - set.add("SayHello.java"); - set.add("SharedName_PortType.java"); - set.add("SharedName_Service.java"); - set.add("SharedName_ServiceLocator.java"); - set.add("SharedName_ServiceTestCase.java"); - set.add("SharedName_Type.java"); - set.add("deploy.wsdd"); - set.add("undeploy.wsdd"); - return set; - } // shouldExist - - /** - * List of files which may be generated. - */ - protected Set mayExist() { - HashSet set = new HashSet(); - set.add("SharedName_Type_Helper.java"); - return set; - } // shouldExist - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "clash"; - } // rootDir - -} // class VerifyFilesTestCase diff --git a/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java b/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java deleted file mode 100644 index 8216feb749..0000000000 --- a/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package test.wsdl.extra; - -import java.io.File; -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; -import java.util.Vector; - -/** - * This tests the file generation of only the items that are referenced in WSDL - * This should extend FileGenTestCase, but we have a dependancy problem as - * "extra" comes before "filegen". Oh well. - * - */ -public class ExtraClassesTestCase extends junit.framework.TestCase { - public ExtraClassesTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("Extra.java"); // this is the important one - set.add("MyService.java"); - set.add("MyServiceService.java"); - set.add("MyServiceServiceLocator.java"); - set.add("MyServiceSoapBindingStub.java"); - set.add("MyService.wsdl"); - return set; - } // shouldExist - - /** - * List of files which may or may not be generated. - */ - protected Set mayExist() { - HashSet set = new HashSet(); - return set; - } - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "extra"; - } // rootDir - - public void testFileGen() throws IOException { - String rootDir = rootDir(); - Set shouldExist = shouldExist(); - Set mayExist = mayExist(); - - // open up the output directory and check what files exist. - File outputDir = new File(rootDir); - - String[] files = outputDir.list(); - - Vector shouldNotExist = new Vector(); - - for (int i = 0; i < files.length; ++i) { - if (shouldExist.contains(files[i])) { - shouldExist.remove(files[i]); - } - else if (mayExist.contains(files[i])) { - mayExist.remove(files[i]); - } - else { - shouldNotExist.add(files[i]); - } - } - - if (shouldExist.size() > 0) { - fail("The following files should exist but do not: " + shouldExist); - } - - if (shouldNotExist.size() > 0) { - fail("The following files should NOT exist, but do: " + shouldNotExist); - } - } -} // class AllOptionTestCase diff --git a/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java b/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java deleted file mode 100644 index 50ba645c00..0000000000 --- a/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - */ -package test.wsdl.filegen; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -public class AllOptionTestCase extends FileGenTestCase { - public AllOptionTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("Address.java"); - set.add("OpFault.java"); - set.add("PortTypeSoap.java"); - set.add("ReferenceService.java"); - set.add("ReferenceServiceLocator.java"); - set.add("ReferenceSoapBindingStub.java"); - set.add("StateType.java"); - return set; - } // shouldExist - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "filegenAll"; - } // rootDir - -} // class AllOptionTestCase diff --git a/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java b/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java deleted file mode 100644 index 6dae4483d2..0000000000 --- a/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - * @author Tom Jordahl (tomj@macromedia.com) - */ -package test.wsdl.filegen; - -import test.AxisFileGenTestBase; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; -import java.util.Vector; - - -public class FileGenTestCase extends AxisFileGenTestBase { - public FileGenTestCase(String name) { - super(name); - } - - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("OpFault.java"); - set.add("PortTypeSoap.java"); - set.add("ReferenceService.java"); - set.add("ReferenceServiceLocator.java"); - set.add("ReferenceSoapBindingStub.java"); - return set; - } - - /** - * List of files which may or may not be generated. - */ - protected Set mayExist() { - HashSet set = new HashSet(); - return set; - } - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "filegen"; - } - -} - diff --git a/axis-ant/src/test/java/test/wsdl/filegen/README b/axis-ant/src/test/java/test/wsdl/filegen/README deleted file mode 100644 index cc06f0dbf5..0000000000 --- a/axis-ant/src/test/java/test/wsdl/filegen/README +++ /dev/null @@ -1,21 +0,0 @@ -FileGenTestCase verifies that the proper set of files is generated for FileGen.wsdl. This is a test that would be useful for many WSDL files, so FileGenTestCase is also extensible. - -Here is the interface for FileGenTestCase: - -FileGenTestCase { - public FileGenTestCase(java.lang.String); - protected java.util.Set shouldExist(); - protected java.lang.String rootDir(); - public void testFileGen() throws java.io.IOException; -} - -All extensions should have a constructor that takes a String and calls super(string). This is a requirement of the junit framework. - -All extensions should override shouldExist. This method returns a set containing the String local names of the files that should exist in a given directory. - -All extensions should override rootDir. This method returns the name of the directory which will be checked for file existence. - -testFileGen is the test that does all the work and extensions do not need to override it. - -For a concrete example of an extension to FileGenTestCase, see xml-axis/java/test/wsdl/clash/VerifyFilesTestCase.java. - diff --git a/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java b/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java new file mode 100644 index 0000000000..a556338bd7 --- /dev/null +++ b/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java @@ -0,0 +1,42 @@ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This tests the file generation of only the items that are referenced in WSDL + * + * @author Steve Green (steve.green@epok.net) + */ +package test.wsdl.groups; + +import java.io.IOException; + +public class GroupsTestCase extends junit.framework.TestCase { + public GroupsTestCase(String name) { + super(name); + } + + public void testGroups() throws IOException, ClassNotFoundException, SecurityException, NoSuchMethodException { + // Test for the proper members + + Class ourClass = Class.forName("test.wsdl.groups.SomeType"); + ourClass.getDeclaredMethod("getA", null); + ourClass.getDeclaredMethod("getB", null); + ourClass.getDeclaredMethod("getZ", null); + + return; + } +} + diff --git a/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java deleted file mode 100644 index 4d3edb471f..0000000000 --- a/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - */ -package test.wsdl.header; - -import test.wsdl.filegen.FileGenTestCase; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -public class VerifyFilesTestCase extends FileGenTestCase { - public VerifyFilesTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. We're primarily concerned with - * the implicit fault class. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - - set.add("BindingImpl.java"); - set.add("BindingSkeleton.java"); - set.add("BindingStub.java"); - set.add("HeaderService.java"); - set.add("HeaderServiceLocator.java"); - set.add("HeaderServiceTestCase.java"); - set.add("HeaderType.java"); - set.add("ImplicitFault.java"); - set.add("Op1Fault.java"); - set.add("PortType.java"); - set.add("deploy.wsdd"); - set.add("undeploy.wsdd"); - return set; - } // shouldExist - - /** - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "header"; - } // rootDir - -} // class VerifyFilesTestCase diff --git a/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java b/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java deleted file mode 100644 index 33eec82673..0000000000 --- a/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * SalesRankNPrice_ServiceTestCase.java - * - * This file was auto-generated from WSDL - * by the Apache Axis Wsdl2java emitter. - * Edited by hand to test a .NET web service on the internet. - * - *@author Tom Jordahl (tomj@macromedia.com) - */ - -package test.wsdl.literal; - -import java.io.File; -import java.io.IOException; - -public class SalesRankNPrice_ServiceTestCase extends junit.framework.TestCase { - // List of files which should be generated - private static String[] shouldExist= new String[] { - "SalesRankNPrice1.java", - "SalesRanks.java", - "Prices.java", - "All.java", - "SalesRankNPriceSoap.java", - "SalesRankNPriceSoapStub.java", - "SalesRankNPrice.java", - "SalesRankNPriceLocator.java" - - }; - - // List of files which should NOT be generated - private static String[] shouldNotExist= new String[] { - "GetAmazonSalesRank.java", - "GetAmazonSalesRankResponse.java", - "GetAmazonUKSalesRank.java", - "GetAmazonUKSalesRankResponse.java", - "GetBNSalesRank.java", - "GetBNSalesRankResponse.java", - "GetAmazonPrice.java", - "GetAmazonPriceReponse.java", - "GetAmazonUKPrice.java", - "GetAmazonUKPriceResponse.java", - "GetBNPrice.java", - "GetBNPriceResponse.java", - "GetAmazonSalesRankNPrice.java", - "GetAmazonSalesRankNPriceResponse.java", - "GetBNSalesRankNPrice.java", - "GetBNSalesRankNPriceResponse.java", - "GetAmazonAndBNSalesRank.java", - "GetAmazonAndBNSalesRankResponse.java", - "GetAmazonAndBNPrice.java", - "GetAmazonAndBNPriceResponse.java", - "GetAll.java", - "GetAllResponse.java" - }; - - public void testFileGen() throws IOException { - String rootDir = System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + "literal"; - // open up the output directory and check what files exist. - File outputDir = new File(rootDir); - - String[] files = outputDir.list(); - - for (int i=0; i < shouldExist.length; i++) { - File f = new File(rootDir, shouldExist[i]); - assertTrue("File does not exist (and it should): " + shouldExist[i], f.exists()); - } - - for (int i=0; i < shouldNotExist.length; i++) { - File f = new File(rootDir, shouldNotExist[i]); - assertTrue("File exist (and it should NOT): " + shouldNotExist[i], !f.exists()); - } - } -} diff --git a/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java deleted file mode 100644 index 9521f6a49f..0000000000 --- a/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - */ -package test.wsdl.multibinding; - -import test.wsdl.filegen.FileGenTestCase; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -public class VerifyFilesTestCase extends FileGenTestCase { - public VerifyFilesTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("BindingAllLitImpl.java"); - set.add("BindingAllLitSkeleton.java"); - set.add("BindingAllLitStub.java"); - set.add("BindingNoLitImpl.java"); - set.add("BindingNoLitSkeleton.java"); - set.add("BindingNoLitStub.java"); - set.add("BindingSomeLitImpl.java"); - set.add("BindingSomeLitSkeleton.java"); - set.add("BindingSomeLitStub.java"); - set.add("MbPT.java"); - set.add("MbService.java"); - set.add("MbServiceLocator.java"); - set.add("MbServiceTestCase.java"); - set.add("deploy.wsdd"); - set.add("undeploy.wsdd"); - return set; - } // shouldExist - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "multibinding"; - } // rootDir - -} // class VerifyFilesTestCase diff --git a/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java b/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java index 689bc18896..cb82eec658 100644 --- a/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java +++ b/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java @@ -42,8 +42,7 @@ public SchemaImportTestCase(String name) { } public void testSchemaImport() { - String path = System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "work" + File.separator + + String path = "target" + File.separator + "work" + File.separator + "test" + File.separator + "wsdl" + File.separator + "schemaImport" + File.separator + "foo.wsdl"; Document doc = null; diff --git a/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java b/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java index 784aab8f9c..bc6fe1e042 100644 --- a/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java +++ b/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java @@ -33,8 +33,7 @@ public class SplitTestCase extends TestCase { public void testValidateWSDL() throws Exception { WSDLReader reader = WSDLFactory.newInstance().newWSDLReader(); - Definition definition = reader.readWSDL(new File(System.getProperty("basedir", ".") - + "/target/work/test/wsdl/split/SplitTestImpl.wsdl").toURI().toString()); + Definition definition = reader.readWSDL(new File("target/work/test/wsdl/split/SplitTestImpl.wsdl").getAbsoluteFile().toURI().toString()); Service service = definition.getService(new QName("http://split.wsdl.test", "MyPortTypeService")); Port port = service.getPort("SplitTest"); // This is the critical part: the binding is defined in the imported WSDL diff --git a/axis-ant/src/test/resources/log4j.properties b/axis-ant/src/test/resources/log4j.properties new file mode 100644 index 0000000000..bdb4c087f9 --- /dev/null +++ b/axis-ant/src/test/resources/log4j.properties @@ -0,0 +1,26 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +log4j.rootLogger=INFO, CONSOLE + +#log4j.logger.org.apache.axis=DEBUG + +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %c - %m%n diff --git a/axis-ant/src/test/wsdl/axis2378/sample.wsdl b/axis-ant/src/test/wsdl/axis2378/sample.wsdl new file mode 100644 index 0000000000..efdad99fa4 --- /dev/null +++ b/axis-ant/src/test/wsdl/axis2378/sample.wsdl @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/axis-ant/src/test/wsdl/axis2900/sample.wsdl b/axis-ant/src/test/wsdl/axis2900/sample.wsdl new file mode 100644 index 0000000000..942808715f --- /dev/null +++ b/axis-ant/src/test/wsdl/axis2900/sample.wsdl @@ -0,0 +1,76 @@ + + + + Please Type your service description here + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-ant/src/test/wsdl/axis2901/sample.wsdl b/axis-ant/src/test/wsdl/axis2901/sample.wsdl new file mode 100644 index 0000000000..ebe3fd3a67 --- /dev/null +++ b/axis-ant/src/test/wsdl/axis2901/sample.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/wsdl/groups/Groups.wsdl b/axis-ant/src/test/wsdl/groups/Groups.wsdl similarity index 100% rename from test/wsdl/groups/Groups.wsdl rename to axis-ant/src/test/wsdl/groups/Groups.wsdl diff --git a/axis-codegen/pom.xml b/axis-codegen/pom.xml index 2e5fe14291..f53a6f2280 100644 --- a/axis-codegen/pom.xml +++ b/axis-codegen/pom.xml @@ -40,26 +40,15 @@ axis-rt-core ${project.version} + + ${project.groupId} + axis-model + ${project.version} + junit junit test - - - - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - - - - diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Emitter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Emitter.java index 89879bdedf..59476ee6a7 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Emitter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Emitter.java @@ -349,7 +349,7 @@ public void setNStoPkg(String NStoPkgFilename) { } // setNStoPkg /** - * Set a map of namespace -> Java package names + * Set a map of namespace -> Java package names * * @param map */ @@ -358,7 +358,7 @@ public void setNamespaceMap(HashMap map) { } /** - * Get the map of namespace -> Java package names + * Get the map of namespace -> Java package names * * @return */ @@ -583,7 +583,7 @@ protected String getJavaVariableNameHook(QName typeQName, QName xmlName, boolean /** * Emit appropriate Java files for a WSDL at a given URL. - *

+ *

* This method will time out after the number of milliseconds specified * by our timeoutms member. * diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/GeneratedFileInfo.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/GeneratedFileInfo.java index 2eb2ff895a..cc1871ca5e 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/GeneratedFileInfo.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/GeneratedFileInfo.java @@ -145,8 +145,7 @@ public List findType(String type) { /** * Lookup an entry by file name * - * @param file name you want info about - * @param fileName + * @param fileName name you want info about * @return The entry for the file name specified. Null if not found */ public Entry findName(String fileName) { @@ -166,8 +165,7 @@ public Entry findName(String fileName) { /** * Lookup an entry by class name * - * @param class name you want info about - * @param className + * @param className name you want info about * @return The entry for the class specified. Null if not found */ public Entry findClass(String className) { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanFaultWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanFaultWriter.java index 04c102346e..8548dbf33b 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanFaultWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanFaultWriter.java @@ -36,7 +36,7 @@ public class JavaBeanFaultWriter extends JavaBeanWriter { * that may potentially conflict with those that would be generated by * this class for an XSD complex type used as a fault. The following * immutable object contains all property names that must be excluded - * when generating a service specific exception. Note: + * when generating a service specific exception. Note: * {@link org.apache.axis.encoding.ser.BeanSerializer} always excludes * Throwable's and AxisFault's properties * when marshalling a service Java exception. @@ -95,7 +95,7 @@ protected JavaBeanFaultWriter(Emitter emitter, TypeEntry type, /** * Returns the appropriate extends text * - * @return "" or " extends " + * @return "" or " extends <class> " */ protected String getExtendsText() { @@ -114,7 +114,7 @@ protected String getExtendsText() { /** * Write the Exception serialization code - *

+ *

* NOTE: This function is written in JavaFaultWriter.java also. * * @param pw diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java index 61343ecbb6..368279557a 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java @@ -32,7 +32,7 @@ import java.util.Set; /** - * This is Wsdl2java's Helper Type Writer. It writes the .java file. + * This is Wsdl2java's Helper Type Writer. It writes the <typeName>.java file. */ public class JavaBeanHelperWriter extends JavaClassWriter { @@ -143,7 +143,7 @@ protected void registerFile(String file) { } // registerFile /** - * Return the string: "Generating ". + * Return the string: "Generating <file>". * only if we are going to generate a new file. * * @param file diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanWriter.java index e53f18c663..26cf30e99f 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanWriter.java @@ -34,7 +34,7 @@ import java.util.Vector; /** - * This is Wsdl2java's Complex Type Writer. It writes the .java file. + * This is Wsdl2java's Complex Type Writer. It writes the <typeName>.java file. */ public class JavaBeanWriter extends JavaClassWriter { @@ -535,7 +535,7 @@ protected String getClassModifiers() { /** * Returns the appropriate extends text * - * @return "" or " extends " + * @return "" or " extends <class> " */ protected String getExtendsText() { @@ -554,7 +554,7 @@ protected String getExtendsText() { /** * Returns the appropriate implements text * - * @return " implements " + * @return " implements <classes> " */ protected String getImplementsText() { @@ -637,9 +637,14 @@ protected void writeDefaultConstructor() { pw.println(); } + /** + * Write a constructor containing the fields in this class. + * Will not write a construtor with more than 254 arguments as + * the Java compiler will choke. + */ protected void writeMinimalConstructor() { - if (isUnion() || names.size() == 0) { + if (isUnion() || names.size() == 0 || names.size() > 254) { return; } @@ -770,7 +775,7 @@ protected void writeFullConstructor() { int localParams = paramTypes.size() - names.size() / 2; // Now write the constructor signature - if (paramTypes.size() > 0) { + if (paramTypes.size() > 0 && paramTypes.size() < 255) { // Prevent name clash between local parameters and the // parameters for the super class @@ -1211,7 +1216,6 @@ protected void writeEqualsMethod() { + ")) return false;"); pw.println(" " + className + " other = (" + className + ") obj;"); - pw.println(" if (obj == null) return false;"); pw.println(" if (this == obj) return true;"); // Have we been here before ? return true if yes otherwise false diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBindingWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBindingWriter.java index b80fe221ea..7daca6c165 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBindingWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBindingWriter.java @@ -26,7 +26,7 @@ /** * This is Wsdl2java's Binding Writer. It writes the following files, as appropriate: - * Stub.java, Skeleton.java, Impl.java. + * <bindingName>Stub.java, <bindingName>Skeleton.java, <bindingName>Impl.java. */ public class JavaBindingWriter implements Generator { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaClassWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaClassWriter.java index 01a9606afb..e789cf0f51 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaClassWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaClassWriter.java @@ -29,16 +29,13 @@ * JavaWriter. So the Java WSDL writers (JavaPortTypeWriter, JavaBindingWriter, * etc.) each calls a file writer (JavaStubWriter, JavaSkelWriter, etc.) for * each file that that WSDL generates. - *

*

For example, when Emitter calls JavaWriterFactory for a Binding Writer, it * returns a JavaBindingWriter. JavaBindingWriter, in turn, contains a * JavaStubWriter, JavaSkelWriter, and JavaImplWriter since a Binding may cause * a stub, skeleton, and impl template to be generated. - *

*

Note that the writers that are given to Emitter by JavaWriterFactory DO NOT * extend JavaWriter. They simply implement Writer and delegate the actual * task of writing to extensions of JavaWriter. - *

*

All of Wsdl2java's Writer implementations follow a common behaviour. * JavaWriter is the abstract base class that dictates this common behaviour. * Many of the files generated are .java files, so this abstract class - @@ -79,7 +76,7 @@ *

You should not need to override this method. It simply closes the * PrintWriter. * - *

+ *

* Additional behaviour that JavaClassWriter introduces beyond JavaWriter is * related to the class header and definition: *

@@ -136,7 +133,7 @@ protected JavaClassWriter(Emitter emitter, String fullClassName, /** * Return the file name as a string of the form: - * ".java" + * "<directory-ized fully-qualified classname>.java" * * @return */ @@ -246,7 +243,7 @@ protected String getClassText() { /** * Returns the appropriate extends clause. This default implementation - * simply returns "", but if you want "extends " + * simply returns "", but if you want "extends <class/interface list> " * then you must override this method. * * @return "" @@ -257,7 +254,7 @@ protected String getExtendsText() { /** * Returns the appropriate implements clause. This default implementation - * simply returns "", but if you want "implements " then + * simply returns "", but if you want "implements <interface list> " then * you must override this method. * * @return "" diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDefinitionWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDefinitionWriter.java index 8e1861477a..2cbf09eca7 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDefinitionWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDefinitionWriter.java @@ -109,19 +109,8 @@ protected void writeFaults() throws IOException { // by JavaTypeWriter. MessageEntry me = symbolTable.getMessageEntry(message.getQName()); - boolean emitSimpleFault = true; - if (me != null) { - Boolean complexTypeFault = (Boolean) me.getDynamicVar( - JavaGeneratorFactory.COMPLEX_TYPE_FAULT); - - if ((complexTypeFault != null) - && complexTypeFault.booleanValue()) { - emitSimpleFault = false; - } - } - - if (emitSimpleFault) { + if (me == null || !Utils.isFaultComplex(me)) { try { JavaFaultWriter writer = new JavaFaultWriter(emitter, symbolTable, faultInfo); diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDeployWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDeployWriter.java index 51b9975d31..5a8f1c2692 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDeployWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaDeployWriter.java @@ -22,8 +22,17 @@ import org.apache.axis.constants.Scope; import org.apache.axis.constants.Style; import org.apache.axis.constants.Use; +import org.apache.axis.model.wsdd.ArrayMapping; +import org.apache.axis.model.wsdd.Deployment; +import org.apache.axis.model.wsdd.Fault; +import org.apache.axis.model.wsdd.OperationParameter; +import org.apache.axis.model.wsdd.ParameterMode; +import org.apache.axis.model.wsdd.TypeMapping; +import org.apache.axis.model.wsdd.WSDDFactory; +import org.apache.axis.model.wsdd.WSDDUtil; import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Messages; +import org.apache.axis.utils.StringUtils; import org.apache.axis.wsdl.symbolTable.BindingEntry; import org.apache.axis.wsdl.symbolTable.FaultInfo; import org.apache.axis.wsdl.symbolTable.Parameter; @@ -135,10 +144,6 @@ protected void writeFileHeader(PrintWriter pw) throws IOException { pw.println(Messages.getMessage("deploy07")); pw.println(Messages.getMessage("deploy09")); pw.println(); - pw.println(""); } // writeFileHeader /** @@ -148,17 +153,18 @@ protected void writeFileHeader(PrintWriter pw) throws IOException { * @throws IOException */ protected void writeFileBody(PrintWriter pw) throws IOException { - writeDeployServices(pw); - pw.println(""); + Deployment deployment = WSDDFactory.INSTANCE.createDeployment(); + writeDeployServices(deployment); + WSDDUtil.save(deployment, pw); } // writeFileBody /** * Write out deployment and undeployment instructions for each WSDL service * - * @param pw + * @param deployment * @throws IOException */ - protected void writeDeployServices(PrintWriter pw) throws IOException { + protected void writeDeployServices(Deployment deployment) throws IOException { // deploy the ports on each service Map serviceMap = definition.getServices(); @@ -167,13 +173,6 @@ protected void writeDeployServices(PrintWriter pw) throws IOException { mapIterator.hasNext();) { Service myService = (Service) mapIterator.next(); - pw.println(); - pw.println( - " "); - pw.println(); - for (Iterator portIterator = myService.getPorts().values().iterator(); portIterator.hasNext();) { Port myPort = (Port) portIterator.next(); @@ -185,7 +184,7 @@ protected void writeDeployServices(PrintWriter pw) throws IOException { continue; } - writeDeployPort(pw, myPort, myService, bEntry); + writeDeployPort(deployment, myPort, myService, bEntry); } } } // writeDeployServices @@ -193,7 +192,7 @@ protected void writeDeployServices(PrintWriter pw) throws IOException { /** * Write out bean mappings for each type * - * @param pw + * @param service * @param binding * @param hasLiteral * @param hasMIME @@ -201,20 +200,19 @@ protected void writeDeployServices(PrintWriter pw) throws IOException { * @throws IOException */ protected void writeDeployTypes( - PrintWriter pw, Binding binding, boolean hasLiteral, boolean hasMIME, Use use) + org.apache.axis.model.wsdd.Service service, Binding binding, boolean hasLiteral, boolean hasMIME, Use use) throws IOException { - pw.println(); - if (hasMIME) { QName bQName = binding.getQName(); - writeTypeMapping( - pw, bQName.getNamespaceURI(), "DataHandler", - "javax.activation.DataHandler", - "org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory", - "org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory", - use.getEncoding()); + TypeMapping typeMapping = WSDDFactory.INSTANCE.createTypeMapping(); + typeMapping.setQname(new QName(bQName.getNamespaceURI(), "DataHandler")); + typeMapping.setType(new QName(WSDDConstants.URI_WSDD_JAVA, "javax.activation.DataHandler", WSDDConstants.NS_PREFIX_WSDD_JAVA)); + typeMapping.setSerializer("org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory"); + typeMapping.setDeserializer("org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory"); + typeMapping.setEncodingStyle(use.getEncoding()); + service.getTypeMappings().add(typeMapping); } Map types = symbolTable.getTypeIndex(); @@ -232,8 +230,6 @@ protected void writeDeployTypes( } if (process) { - String namespaceURI = type.getQName().getNamespaceURI(); - String localPart = type.getQName().getLocalPart(); String javaType = type.getName(); String serializerFactory; String deserializerFactory; @@ -282,87 +278,43 @@ protected void writeDeployTypes( if (innerType == null) { // no arrays - writeTypeMapping(pw, namespaceURI, localPart, javaType, - serializerFactory, deserializerFactory, - encodingStyle); + TypeMapping typeMapping = WSDDFactory.INSTANCE.createTypeMapping(); + typeMapping.setQname(type.getQName()); + typeMapping.setType(new QName(WSDDConstants.URI_WSDD_JAVA, javaType)); + typeMapping.setSerializer(serializerFactory); + typeMapping.setDeserializer(deserializerFactory); + typeMapping.setEncodingStyle(encodingStyle); + service.getTypeMappings().add(typeMapping); } else { // arrays - writeArrayTypeMapping(pw, namespaceURI, localPart, javaType, - encodingStyle, innerType); + ArrayMapping arrayMapping = WSDDFactory.INSTANCE.createArrayMapping(); + arrayMapping.setQname(type.getQName()); + arrayMapping.setType(new QName(WSDDConstants.URI_WSDD_JAVA, javaType)); + arrayMapping.setEncodingStyle(encodingStyle); + arrayMapping.setInnerType(innerType); + service.getArrayMappings().add(arrayMapping); } } } } // writeDeployTypes - /** - * Raw routine that writes out the typeMapping. - * - * @param pw - * @param namespaceURI - * @param localPart - * @param javaType - * @param serializerFactory - * @param deserializerFactory - * @param encodingStyle - * @throws IOException - */ - protected void writeArrayTypeMapping( - PrintWriter pw, String namespaceURI, String localPart, String javaType, String encodingStyle, QName innerType) - throws IOException { - - pw.println(" "); - } - - /** - * Raw routine that writes out the typeMapping. - * - * @param pw - * @param namespaceURI - * @param localPart - * @param javaType - * @param serializerFactory - * @param deserializerFactory - * @param encodingStyle - * @throws IOException - */ - protected void writeTypeMapping( - PrintWriter pw, String namespaceURI, String localPart, String javaType, String serializerFactory, String deserializerFactory, String encodingStyle) - throws IOException { - - pw.println(" "); - } - /** * Write out deployment and undeployment instructions for given WSDL port * - * @param pw + * @param deployment * @param port * @param service * @param bEntry * @throws IOException */ protected void writeDeployPort( - PrintWriter pw, Port port, Service service, BindingEntry bEntry) + Deployment deployment, Port port, Service service, BindingEntry bEntry) throws IOException { String serviceName = port.getName(); boolean hasLiteral = bEntry.hasLiteral(); boolean hasMIME = Utils.hasMIME(bEntry); - String prefix = WSDDConstants.NS_PREFIX_WSDD_JAVA; - String styleStr = ""; + Style style; Iterator iterator = bEntry.getBinding().getExtensibilityElements().iterator(); @@ -375,28 +327,26 @@ protected void writeDeployPort( } if (symbolTable.isWrapped()) { - styleStr = " style=\"" + Style.WRAPPED + "\""; + style = Style.WRAPPED; use = Use.LITERAL; } else { - styleStr = " style=\"" + bEntry.getBindingStyle().getName() + "\""; + style = bEntry.getBindingStyle(); if (hasLiteral) { use = Use.LITERAL; } } - String useStr = " use=\"" + use + "\""; - - pw.println(" "); - pw.println(" "); - pw.println(" "); + org.apache.axis.model.wsdd.Service wsddService = WSDDFactory.INSTANCE.createService(); + wsddService.setName(serviceName); + wsddService.setProvider(new QName(WSDDConstants.URI_WSDD_JAVA, "RPC")); + wsddService.setStyle(style); + wsddService.setUse(use); + wsddService.setParameter("wsdlTargetNamespace", service.getQName().getNamespaceURI()); + wsddService.setParameter("wsdlServiceElement", service.getQName().getLocalPart()); // MIME attachments don't work with multiref, so turn it off. if (hasMIME) { - pw.println( - " "); + wsddService.setParameter("sendMultiRefs", "false"); } ArrayList qualified = new ArrayList(); ArrayList unqualified = new ArrayList(); @@ -410,41 +360,26 @@ protected void writeDeployPort( } } if(qualified.size()>0){ - pw.print(" "); + wsddService.setParameter("schemaQualified", StringUtils.join(qualified, ',')); } if(unqualified.size()>0){ - pw.print(" "); + wsddService.setParameter("schemaUnqualified", StringUtils.join(unqualified, ',')); } - pw.println(" "); + wsddService.setParameter("wsdlServicePort", serviceName); - writeDeployBinding(pw, bEntry); - writeDeployTypes(pw, bEntry.getBinding(), hasLiteral, hasMIME, use); - pw.println(" "); + writeDeployBinding(wsddService, bEntry); + writeDeployTypes(wsddService, bEntry.getBinding(), hasLiteral, hasMIME, use); + deployment.getServices().add(wsddService); } // writeDeployPort /** * Write out deployment instructions for given WSDL binding * - * @param pw + * @param service * @param bEntry * @throws IOException */ - protected void writeDeployBinding(PrintWriter pw, BindingEntry bEntry) + protected void writeDeployBinding(org.apache.axis.model.wsdd.Service service, BindingEntry bEntry) throws IOException { Binding binding = bEntry.getBinding(); @@ -461,14 +396,9 @@ protected void writeDeployBinding(PrintWriter pw, BindingEntry bEntry) className += "Impl"; } - pw.println(" "); - - pw.println(" "); - - pw.println(" "); + service.setParameter("className", className); + service.setParameter("wsdlPortType", binding.getPortType().getQName().getLocalPart()); + service.setParameter("typeMappingVersion", emitter.getTypeMappingVersion()); HashSet allowedMethods = new HashSet(); @@ -549,47 +479,26 @@ protected void writeDeployBinding(PrintWriter pw, BindingEntry bEntry) String SOAPAction = Utils.getOperationSOAPAction(bindingOper); // Write the operation metadata - writeOperation(pw, javaOperName, elementQName, returnQName, + writeOperation(service, javaOperName, elementQName, returnQName, returnType, params, binding.getQName(), faults, SOAPAction); } } } - pw.print(" "); - } else { - boolean first = true; - - for (Iterator i = allowedMethods.iterator(); i.hasNext();) { - String method = (String) i.next(); - - if (first) { - pw.print(method); - - first = false; - } else { - pw.print(" " + method); - } - } - - pw.println("\"/>"); - } + service.setParameter("allowedMethods", allowedMethods.isEmpty() ? "*" : StringUtils.join(allowedMethods, ' ')); Scope scope = emitter.getScope(); if (scope != null) { - pw.println(" "); + service.setParameter("scope", scope.getName()); } } // writeDeployBinding /** * Raw routine that writes out the operation and parameters. * - * @param pw + * @param service * @param javaOperName * @param elementQName * @param returnQName @@ -598,70 +507,43 @@ protected void writeDeployBinding(PrintWriter pw, BindingEntry bEntry) * @param bindingQName * @param faults */ - protected void writeOperation(PrintWriter pw, String javaOperName, + protected void writeOperation(org.apache.axis.model.wsdd.Service service, String javaOperName, QName elementQName, QName returnQName, QName returnType, Parameters params, QName bindingQName, ArrayList faults, String SOAPAction) { - pw.print(" "); - Vector paramList = params.list; for (int i = 0; i < paramList.size(); i++) { @@ -671,41 +553,33 @@ protected void writeOperation(PrintWriter pw, String javaOperName, QName paramQName = param.getQName(); QName paramType = Utils.getXSIType(param); - pw.print(" "); + operation.getParameters().add(parameter); } if (faults != null) { @@ -718,39 +592,17 @@ protected void writeOperation(PrintWriter pw, String javaOperName, Utils.getFullExceptionName(faultInfo.getMessage(), symbolTable); - pw.print(" "); + Fault fault = WSDDFactory.INSTANCE.createFault(); + fault.setName(faultInfo.getName()); + fault.setQname(faultQName); + fault.setClass(className); + fault.setType(faultInfo.getXMLType()); + operation.getFaults().add(fault); } } } - pw.println(" "); - } - - /** - * Method getModeString - * - * @param mode - * @return - */ - public String getModeString(byte mode) { - - if (mode == Parameter.IN) { - return "IN"; - } else if (mode == Parameter.INOUT) { - return "INOUT"; - } else { - return "OUT"; - } + service.getOperations().add(operation); } /** diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java index ba4cc38497..a3422a71cd 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaEnumTypeWriter.java @@ -24,7 +24,7 @@ import java.util.Vector; /** - * This is Wsdl2java's Complex Type Writer. It writes the .java file. + * This is Wsdl2java's Complex Type Writer. It writes the <typeName>.java file. */ public class JavaEnumTypeWriter extends JavaClassWriter { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaFaultWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaFaultWriter.java index 1e06e31e63..6b7fe807fd 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaFaultWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaFaultWriter.java @@ -27,8 +27,8 @@ import java.util.Vector; /** - * This is Wsdl2java's Fault Writer. It writes the .java file. - *

+ * This is Wsdl2java's Fault Writer. It writes the <faultName>.java file. + *

* NOTE: This only writes simple type faults, the JavaTypeWriter emits * faults that are complex types. */ diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java index 4e44e9580c..8b67fa6d04 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java @@ -64,7 +64,7 @@ * This is Wsdl2java's implementation of the GeneratorFactory */ public class JavaGeneratorFactory implements GeneratorFactory { - private static final Log log_ = + private static final Log log = LogFactory.getLog(JavaGeneratorFactory.class.getName()); /** Field emitter */ @@ -450,6 +450,10 @@ public void generate() throws IOException { gen.generate(); } } // generate + + public String toString() { + return "Writers[baseWriter=" + baseWriter + ",writers=" + writers + ",entry.name=" + (entry == null ? "N/A" : entry.getName()) + "]"; + } } // class Writers /** @@ -459,6 +463,9 @@ public void generate() throws IOException { * @param generator */ public void addGenerator(Class wsdlClass, Class generator) { + if (log.isDebugEnabled()) { + log.debug("Adding generator for " + wsdlClass.getName() + ": " + generator.getName()); + } // This is just a hack right now... it just works with Service if (Message.class.isAssignableFrom(wsdlClass)) { @@ -805,10 +812,7 @@ private void setFaultContext(FaultInfo fault, SymbolTable symbolTable) { } else { // Complex Type Exception - Boolean isComplexFault = (Boolean) te.getDynamicVar( - JavaGeneratorFactory.COMPLEX_TYPE_FAULT); - - if ((isComplexFault == null) || !isComplexFault.booleanValue()) { + if (!Utils.isFaultComplex(te)) { // Mark the type as a complex type fault te.setDynamicVar(JavaGeneratorFactory.COMPLEX_TYPE_FAULT, @@ -1011,7 +1015,9 @@ protected void resolveNameClashes(SymbolTable symbolTable) { if (v.elementAt(index) instanceof MessageEntry) { // Need to resolve a Exception message. MessageEntry msgEntry = (MessageEntry) v.elementAt(index); - if (msgEntry.getDynamicVar(EXCEPTION_CLASS_NAME) == null) { + // AXIS-2900: Only simple type faults generate additional classes; message entries for + // complex type faults don't cause any collisions. + if (Utils.isFaultComplex(msgEntry) || msgEntry.getDynamicVar(EXCEPTION_CLASS_NAME) == null) { v.removeElementAt(index); } else { index++; @@ -1089,7 +1095,7 @@ protected void resolveNameClashes(SymbolTable symbolTable) { SymTabEntry entry = (SymTabEntry) v.elementAt(i); if (entry instanceof Element) { - entry.setName(mangleName(entry.getName(), ELEMENT_SUFFIX)); + mangleName(entry, ELEMENT_SUFFIX); // If this global element was defined using // an anonymous type, then need to change the @@ -1153,13 +1159,8 @@ && sameJavaClass(entry.getName(), } // Appended Suffix for avoiding name collisions (JAX-RPC 1.1) - Boolean isComplexTypeFault = (Boolean)entry.getDynamicVar(COMPLEX_TYPE_FAULT); - if ((isComplexTypeFault != null) && isComplexTypeFault.booleanValue()) { - entry.setName(mangleName(entry.getName(), EXCEPTION_SUFFIX)); - } - else { - entry.setName(mangleName(entry.getName(), TYPE_SUFFIX)); - } + boolean isComplexTypeFault = Utils.isFaultComplex(entry); + mangleName(entry, isComplexTypeFault ? EXCEPTION_SUFFIX : TYPE_SUFFIX); // should update the class name of ElementEntry which references this type entry Map elementIndex = symbolTable.getElementIndex(); @@ -1173,13 +1174,12 @@ && sameJavaClass(entry.getName(), } // Need to resolve a complex-type exception message. - if ((isComplexTypeFault != null) && isComplexTypeFault.booleanValue()) { + if (isComplexTypeFault) { // SHOULD update the exception class name of a referencing message entry. List messageEntries = symbolTable.getMessageEntries(); for (int j = 0; j < messageEntries.size(); j++) { MessageEntry messageEntry = (MessageEntry)messageEntries.get(j); - Boolean isComplexTypeFaultMsg = (Boolean)messageEntry.getDynamicVar(COMPLEX_TYPE_FAULT); - if ((isComplexTypeFaultMsg != null) && (isComplexTypeFaultMsg.booleanValue())) { + if (Utils.isFaultComplex(messageEntry)) { QName exceptionDataType = (QName)messageEntry.getDynamicVar(EXCEPTION_DATA_TYPE); if (((TypeEntry)entry).getQName().equals(exceptionDataType)) { String className = (String)messageEntry.getDynamicVar(EXCEPTION_CLASS_NAME); @@ -1190,13 +1190,11 @@ && sameJavaClass(entry.getName(), } } } else if (entry instanceof PortTypeEntry) { - entry.setName(mangleName(entry.getName(), PORT_TYPE_SUFFIX)); // "_Port" --> "_PortType" for JAX-RPC 1.1 + mangleName(entry, PORT_TYPE_SUFFIX); // "_Port" --> "_PortType" for JAX-RPC 1.1 } else if (entry instanceof ServiceEntry) { - entry.setName(mangleName(entry.getName(), SERVICE_SUFFIX)); + mangleName(entry, SERVICE_SUFFIX); } else if (entry instanceof MessageEntry) { - Boolean complexTypeFault = - (Boolean) entry.getDynamicVar(COMPLEX_TYPE_FAULT); - if ((complexTypeFault == null) || !complexTypeFault.booleanValue()) { + if (!Utils.isFaultComplex(entry)) { String exceptionClassName = (String) entry.getDynamicVar(EXCEPTION_CLASS_NAME); entry.setDynamicVar(EXCEPTION_CLASS_NAME, exceptionClassName + EXCEPTION_SUFFIX); } @@ -1214,8 +1212,7 @@ else if (entry instanceof BindingEntry) { // named after the binding name, so there is the // possibility of a name clash. if (bEntry.hasLiteral()) { - entry.setName(mangleName(entry.getName(), - BINDING_SUFFIX)); + mangleName(entry, BINDING_SUFFIX); } } } @@ -1225,23 +1222,31 @@ else if (entry instanceof BindingEntry) { } // resolveNameClashes /** - * Change the indicated type name into a mangled form using the mangle string. + * Change the type name of the given symbol table entry into a mangled + * form using the given suffix. * - * @param name - * @param mangle - * @return + * @param entry + * @param suffix */ - private String mangleName(String name, String mangle) { + private void mangleName(SymTabEntry entry, String suffix) { + String name = entry.getName(); int index = name.indexOf("["); + String newName; if (index >= 0) { String pre = name.substring(0, index); String post = name.substring(index); - return pre + mangle + post; + newName = pre + suffix + post; } else { - return name + mangle; + newName = name + suffix; + } + + entry.setName(newName); + + if (log.isDebugEnabled()) { + log.debug("Symbol table of type " + entry.getClass().getName() + " mangled: " + name + " -> " + newName); } } @@ -1619,20 +1624,20 @@ public String getBaseName(QName qNameIn) { /** * Determines whether the QName supplied should be generated by comparing * the namespace for the QName against the included and excluded names. -

-

    -
  • if both the includes and excludes are both empty, - the element is generated
  • -
  • if the namespace is in the includes, - the element is generated
  • -
  • if the namespace is not in the excludes and the includes are empty, - the element will be generated. -
  • if the namespace is only in the excludes, - the element is not generated
  • -
  • if the namespace is not in the includes and the includes are not - empty, the element is not generated
  • - @param qName - @return + *
      + *
    • if both the includes and excludes are both empty, + * the element is generated
    • + *
    • if the namespace is in the includes, + * the element is generated
    • + *
    • if the namespace is not in the excludes and the includes are empty, + * the element will be generated. + *
    • if the namespace is only in the excludes, + * the element is not generated
    • + *
    • if the namespace is not in the includes and the includes are not + * empty, the element is not generated
    • + *
    + * @param qName + * @return */ protected boolean include(QName qName) { String namespace = @@ -1650,7 +1655,7 @@ protected boolean include(QName qName) { doInclude = true; } else { - log_.info( + log.info( "excluding code generation for non-included QName:" + qName); } diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaHolderWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaHolderWriter.java index 636b13b696..08e5e41a51 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaHolderWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaHolderWriter.java @@ -23,7 +23,7 @@ import java.io.PrintWriter; /** - * This is Wsdl2java's Holder Writer. It writes the Holder.java file. + * This is Wsdl2java's Holder Writer. It writes the <typeName>Holder.java file. */ public class JavaHolderWriter extends JavaClassWriter { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaImplWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaImplWriter.java index c93c3c48ec..bb38541417 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaImplWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaImplWriter.java @@ -33,8 +33,8 @@ import java.util.List; /** - * This is Wsdl2java's implementation template writer. It writes the Impl.java - * file which contains the Impl class. + * This is Wsdl2java's implementation template writer. It writes the <BindingName>Impl.java + * file which contains the <bindingName>Impl class. */ public class JavaImplWriter extends JavaClassWriter { @@ -98,7 +98,7 @@ protected void writeFileBody(PrintWriter pw) throws IOException { /** * Returns the appropriate implements text * - * @return " implements " + * @return " implements <classes>" */ protected String getImplementsText() { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaInterfaceWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaInterfaceWriter.java index 76000bb16d..fda2a8af35 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaInterfaceWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaInterfaceWriter.java @@ -27,8 +27,8 @@ import java.util.Iterator; /** - * This is Wsdl2java's PortType Writer. It writes the .java file - * which contains the interface. + * This is Wsdl2java's PortType Writer. It writes the <portTypeName>.java file + * which contains the <portTypeName> interface. */ public class JavaInterfaceWriter extends JavaClassWriter { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceIfaceWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceIfaceWriter.java index 6b9acb014d..89dca2de21 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceIfaceWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceIfaceWriter.java @@ -31,7 +31,7 @@ import java.util.Map; /** - * This is Wsdl2java's service writer. It writes the .java file. + * This is Wsdl2java's service writer. It writes the <serviceName>.java file. */ public class JavaServiceIfaceWriter extends JavaClassWriter { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java index 1bfaa7b6bc..ad6008ed40 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceImplWriter.java @@ -38,7 +38,7 @@ /** * This is Wsdl2java's service implementation writer. - * It writes the Locator.java file. + * It writes the <serviceName>Locator.java file. */ public class JavaServiceImplWriter extends JavaClassWriter { @@ -74,7 +74,7 @@ protected String getExtendsText() { } // getExtendsText /** - * Returns "implements ". + * Returns "implements <serviceInterface>". * * @return */ @@ -354,7 +354,7 @@ protected void writeWSDDServiceNameInfo(PrintWriter pw, } // writeWSDDServiceNameInfo /** - * Write the get() method. + * Write the get<portName>() method. * * @param pw * @param bindingType @@ -380,7 +380,7 @@ protected void writeGetPortName(PrintWriter pw, String bindingType, } // writeGetPortName /** - * Write the get(URL) method. + * Write the get<portName>(URL) method. * * @param pw * @param bindingType @@ -410,7 +410,7 @@ protected void writeGetPortNameURL(PrintWriter pw, String bindingType, } // writeGetPortNameURL /** - * Write the setEndpointAddress(String) method. + * Write the set<portName>EndpointAddress(String) method. * * @param pw * @param portName diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceWriter.java index f30f08e313..85d712e777 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaServiceWriter.java @@ -24,7 +24,7 @@ /** * This is Wsdl2java's Service Writer. It writes the following files, as appropriate: - * .java, TestCase.java. + * <serviceName>.java, <serviceName>TestCase.java. */ public class JavaServiceWriter implements Generator { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaSkelWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaSkelWriter.java index 6ef64f7276..b2a281aa96 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaSkelWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaSkelWriter.java @@ -41,8 +41,8 @@ import java.util.List; /** - * This is Wsdl2java's skeleton writer. It writes the Skeleton.java - * file which contains the Skeleton class. + * This is Wsdl2java's skeleton writer. It writes the <BindingName>Skeleton.java + * file which contains the <bindingName>Skeleton class. */ public class JavaSkelWriter extends JavaClassWriter { @@ -73,7 +73,7 @@ protected JavaSkelWriter(Emitter emitter, BindingEntry bEntry, } // ctor /** - * Returns "implements , org.apache.axis.wsdl.Skeleton ". + * Returns "implements <SEI>, org.apache.axis.wsdl.Skeleton ". * * @return */ diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaStubWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaStubWriter.java index a93cd98648..b48c5bb1f0 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaStubWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaStubWriter.java @@ -61,8 +61,8 @@ import java.util.Collections; /** - * This is Wsdl2java's stub writer. It writes the Stub.java - * file which contains the Stub class. + * This is Wsdl2java's stub writer. It writes the <BindingName>Stub.java + * file which contains the <bindingName>Stub class. */ public class JavaStubWriter extends JavaClassWriter { @@ -137,7 +137,7 @@ protected String getExtendsText() { } // getExtendsText /** - * Returns "implements ". + * Returns "implements <SEI> ". * * @return */ diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java index 98f4d628f5..22ba7c9bea 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTestCaseWriter.java @@ -37,7 +37,7 @@ import java.util.Map; /** - * This is Wsdl2java's TestCase writer. It writes the TestCase.java file. + * This is Wsdl2java's TestCase writer. It writes the <serviceName>TestCase.java file. */ public class JavaTestCaseWriter extends JavaClassWriter { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTypeWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTypeWriter.java index 99c12804ac..c917362bc4 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTypeWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaTypeWriter.java @@ -30,7 +30,7 @@ /** * This is Wsdl2java's Type Writer. It writes the following files, as appropriate: - * .java, Holder.java. + * <typeName>.java, <typeName>Holder.java. */ public class JavaTypeWriter implements Generator { @@ -160,10 +160,7 @@ protected JavaWriter getBeanWriter(Emitter emitter, TypeEntry type, TypeEntry ba // If this complexType is referenced in a // fault context, emit a bean-like exception // class - Boolean isComplexFault = (Boolean) type.getDynamicVar( - JavaGeneratorFactory.COMPLEX_TYPE_FAULT); - - if ((isComplexFault != null) && isComplexFault.booleanValue()) { + if (Utils.isFaultComplex(type)) { return new JavaBeanFaultWriter(emitter, type, elements, base, attributes, @@ -205,4 +202,8 @@ protected JavaWriter getBeanHelperWriter( protected Generator getHolderWriter(Emitter emitter, TypeEntry type) { return new JavaHolderWriter(emitter, type); } + + public String toString() { + return "JavaTypeWriter[typeWriter=" + typeWriter + ",holderWriter=" + holderWriter + "]"; + } } // class JavaTypeWriter diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaWriter.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaWriter.java index b34fcdcb28..7cc1211a6e 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaWriter.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaWriter.java @@ -15,8 +15,10 @@ */ package org.apache.axis.wsdl.toJava; +import org.apache.axis.components.logger.LogFactory; import org.apache.axis.utils.Messages; import org.apache.axis.wsdl.gen.Generator; +import org.apache.commons.logging.Log; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -30,16 +32,13 @@ * JavaWriter. So the Java WSDL writers (JavaPortTypeWriter, JavaBindingWriter, * etc.) each calls a file writer (JavaStubWriter, JavaSkelWriter, etc.) for * each file that that WSDL generates. - *

    *

    For example, when Emitter calls JavaWriterFactory for a Binding Writer, it * returns a JavaBindingWriter. JavaBindingWriter, in turn, contains a * JavaStubWriter, JavaSkelWriter, and JavaImplWriter since a Binding may cause * a stub, skeleton, and impl template to be generated. - *

    *

    Note that the writers that are given to Emitter by JavaWriterFactory DO NOT * extend JavaWriter. They simply implement Writer and delegate the actual * task of writing to extensions of JavaWriter. - *

    *

    All of Wsdl2java's Writer implementations follow a common behaviour. * JavaWriter is the abstract base class that dictates this common behaviour. * This behaviour is primarily placed within the generate method. The generate @@ -76,6 +75,7 @@ *

*/ public abstract class JavaWriter implements Generator { + private static final Log log = LogFactory.getLog(JavaWriter.class.getName()); /** This controls how many characters per line for javadoc comments */ protected final static int LINE_LENGTH = 65; @@ -121,6 +121,10 @@ public void generate() throws IOException { } } + if (log.isDebugEnabled()) { + log.debug("Start generating file " + file); + } + PrintWriter pw = getPrintWriter(file); writeFileHeader(pw); @@ -162,7 +166,7 @@ protected void registerFile(String file) { } // registerFile /** - * Return the string: "Generating ". Override this + * Return the string: "Generating <file>". Override this * method if you want to provide more information. * * @param file diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Namespaces.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Namespaces.java index bf56931148..042393b069 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Namespaces.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Namespaces.java @@ -25,7 +25,7 @@ import java.util.Vector; /** - * This class is essentially a HashMap of pairs with + * This class is essentially a HashMap of <namespace, package name> pairs with * a few extra wizzbangs. */ public class Namespaces extends HashMap { diff --git a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Utils.java b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Utils.java index 2f46662fad..e1e94c710d 100644 --- a/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Utils.java +++ b/axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/Utils.java @@ -282,16 +282,13 @@ public static QName getFaultDataType(Message faultMessage, public static boolean isFaultComplex(Message faultMessage, SymbolTable symbolTable) { - MessageEntry me = symbolTable.getMessageEntry(faultMessage.getQName()); - Boolean ret = - (Boolean) me.getDynamicVar(JavaGeneratorFactory.COMPLEX_TYPE_FAULT); - - if (ret != null) { - return ret.booleanValue(); - } else { - return false; - } + return isFaultComplex(symbolTable.getMessageEntry(faultMessage.getQName())); } // isFaultComplex + + static boolean isFaultComplex(SymTabEntry entry) { + Boolean value = (Boolean) entry.getDynamicVar(JavaGeneratorFactory.COMPLEX_TYPE_FAULT); + return value != null && value.booleanValue(); + } /** * If the specified node represents a supported JAX-RPC enumeration, @@ -916,13 +913,13 @@ public static String getParameterTypeName(Parameter parm) { /** * Return a constructor for the provided Parameter * This string will be suitable for assignment: - *

+ *

* Foo var = string returned - *

+ *

* Handles basic java types (int, float, etc), wrapper types (Integer, etc) * and certain java.math (BigDecimal, BigInteger) types. * Will also handle all Axis specific types (org.apache.axis.types.*) - *

+ *

* Caller should expect to wrap the construction in a try/catch block * if bThrow is set to true. * diff --git a/axis-codegen/src/site/site.xml b/axis-codegen/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-codegen/src/site/site.xml @@ -0,0 +1,24 @@ + + + + +

+ + diff --git a/axis-jaxrpc/pom.xml b/axis-jaxrpc/pom.xml index f52517077e..5d7eec729d 100644 --- a/axis-jaxrpc/pom.xml +++ b/axis-jaxrpc/pom.xml @@ -26,7 +26,15 @@ ../pom.xml axis-jaxrpc - Axis :: JAX-RPC + JAX-RPC API + Contains the JAX-RPC 1.1 API + ${baseUrl}/jaxrpc + + + axis + ${baseSiteUrl}/jaxrpc + + ${project.groupId} @@ -58,13 +66,6 @@ - - maven-site-plugin - - true - true - - diff --git a/axis-jaxrpc/src/main/java/javax/xml/rpc/Call.java b/axis-jaxrpc/src/main/java/javax/xml/rpc/Call.java index 693c801ba2..8622ac2ce2 100644 --- a/axis-jaxrpc/src/main/java/javax/xml/rpc/Call.java +++ b/axis-jaxrpc/src/main/java/javax/xml/rpc/Call.java @@ -36,7 +36,7 @@ public interface Call { /** * Standard property: User name for authentication - *

Type: java.lang.String + *

Type: java.lang.String */ public static final String USERNAME_PROPERTY = "javax.xml.rpc.security.auth.username"; @@ -126,7 +126,7 @@ public interface Call { * @param parameterMode Mode of the parameter-whether * ParameterMode.IN, * ParameterMode.OUT, - * or ParameterMode.INOUT + * or ParameterMode.INOUT * @throws JAXRPCException This exception may * be thrown if the method isParameterAndReturnSpecRequired * returns false for this operation. diff --git a/axis-jaxrpc/src/site/site.xml b/axis-jaxrpc/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-jaxrpc/src/site/site.xml @@ -0,0 +1,24 @@ + + + + +

+ + diff --git a/axis-model/model/axis.genmodel b/axis-model/model/axis.genmodel new file mode 100644 index 0000000000..c35ccfa733 --- /dev/null +++ b/axis-model/model/axis.genmodel @@ -0,0 +1,117 @@ + + + wsdd.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-model/model/soap.ecore b/axis-model/model/soap.ecore new file mode 100644 index 0000000000..b045613c79 --- /dev/null +++ b/axis-model/model/soap.ecore @@ -0,0 +1,8 @@ + + + + + diff --git a/axis-model/model/wsdd.ecore b/axis-model/model/wsdd.ecore new file mode 100644 index 0000000000..f207fd56de --- /dev/null +++ b/axis-model/model/wsdd.ecore @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+
+ + + + + + + + +
+ + + + +
+
+
+ + + + + + + + + + + + +
+
+
+ + + + + + +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + + +
+
+
+ + + + +
+
+
+ + + + + +
+
+ + + + +
+ + + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + diff --git a/axis-model/model/xml.ecore b/axis-model/model/xml.ecore new file mode 100644 index 0000000000..77b7e8202a --- /dev/null +++ b/axis-model/model/xml.ecore @@ -0,0 +1,7 @@ + + + + diff --git a/axis-model/pom.xml b/axis-model/pom.xml new file mode 100644 index 0000000000..71cff40e41 --- /dev/null +++ b/axis-model/pom.xml @@ -0,0 +1,154 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-model + EMF Model for WSDD Files + ${baseUrl}/model + + + axis + ${baseSiteUrl}/model + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + org.eclipse.emf + common + 2.2.3 + + + org.eclipse.emf + ecore + 2.2.3 + + + org.eclipse.emf + ecore-xmi + 2.2.3 + + + org.eclipse.xsd + xsd + 2.2.3 + + + junit + junit + test + + + + + + com.github.veithen.cosmos + p2-maven-connector + 0.3 + + + + + com.github.veithen.maven + emf-maven-plugin + 0.1.0 + + + + generate-sources + + + model/axis.genmodel + + + + + + maven-shade-plugin + + + package + + shade + + + + + org.eclipse.*:* + + + + + org.eclipse.*:* + + **/*.class + + + + + + + org.eclipse.emf + org.apache.axis.model + + + org.eclipse.xsd + org.apache.axis.model.xsd + + + ${project.build.directory}/dependency-reduced-pom.xml + + + + + + maven-javadoc-plugin + + + + generated + X + + + model + X + + + ordered + X + + + + all,-html + + + + + diff --git a/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLHelper.java b/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLHelper.java new file mode 100644 index 0000000000..f383b7b756 --- /dev/null +++ b/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLHelper.java @@ -0,0 +1,123 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.util; + +import java.util.Map; + +import javax.xml.namespace.QName; + +import org.apache.axis.constants.Style; +import org.apache.axis.constants.Use; +import org.apache.axis.model.soap.impl.SOAPPackageImpl; +import org.apache.axis.model.xml.impl.XmlPackageImpl; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EFactory; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.xmi.XMLHelper; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl; + +/** + * Custom {@link XMLHelper} that adds support for {@link QName}. This is necessary because we use an + * EMF version compatible with Java 1.4 and that version doesn't support {@link QName} (because it's + * not included in the JRE). Instead it uses its own class to represent QNames. Since Axis depends + * on {@link QName} anyway, we add support for it here. + * + * @author Andreas Veithen + */ +// TODO: this is actually not entirely correct; Axis may generate QNames that are not strictly valid (such as "ns:>fault") and they should be represented using a specific class +public class AxisXMLHelper extends XMLHelperImpl { + private String ignoreNamespaceForUnqualifiedQName; + + public AxisXMLHelper(XMLResource resource) { + super(resource); + } + + public void setOptions(Map options) { + super.setOptions(options); + ignoreNamespaceForUnqualifiedQName = (String)options.get(AxisXMLResource.OPTION_IGNORE_NAMESPACE_FOR_UNQUALIFIED_QNAME); + } + + protected Object createFromString(EFactory eFactory, EDataType dataType, String value) { + if (dataType == XmlPackageImpl.eINSTANCE.getQName()) { + String prefix; + String localName; + int idx = value.indexOf(':'); + if (idx == -1) { + prefix = ""; + localName = value; + } else { + prefix = value.substring(0, idx); + localName = value.substring(idx+1); + } + String namespaceURI = getURI(prefix); + if (namespaceURI == null) { + if (prefix.length() == 0) { + namespaceURI = ""; + } else { + throw new IllegalArgumentException("The prefix '" + prefix + "' is not declared for the QName '" + value + "'"); + } + } + if (prefix.length() == 0 && namespaceURI.equals(ignoreNamespaceForUnqualifiedQName)) { + // TODO: emit warning here + // TODO: add unit test for this case + namespaceURI = ""; + } + return new QName(namespaceURI, localName, prefix); + } else if (dataType == SOAPPackageImpl.eINSTANCE.getStyle()) { + return Style.getStyle(value); + } else if (dataType == SOAPPackageImpl.eINSTANCE.getUse()) { + return Use.getUse(value); + } else { + return super.createFromString(eFactory, dataType, value); + } + } + + public String convertToString(EFactory factory, EDataType dataType, Object value) { + if (dataType == SOAPPackageImpl.eINSTANCE.getStyle()) { + return ((Style)value).getName(); + } else if (dataType == SOAPPackageImpl.eINSTANCE.getUse()) { + return ((Use)value).getName(); + } else { + return super.convertToString(factory, dataType, value); + } + } + + protected String updateQNamePrefix(EFactory factory, EDataType dataType, Object value, boolean list) { + if (!list && value instanceof QName) { + QName qname = (QName)value; + String namespace = qname.getNamespaceURI(); + if (namespace.length() == 0) { + return qname.getLocalPart(); + } else { + EPackage ePackage = extendedMetaData.getPackage(namespace); + if (ePackage == null) { + ePackage = extendedMetaData.demandPackage(namespace); + } + String prefix = getPrefix(ePackage, true); + if (!packages.containsKey(ePackage)) { + packages.put(ePackage, prefix); + } + return prefix + ":" + qname.getLocalPart(); + } + } else { + return super.updateQNamePrefix(factory, dataType, value, list); + } + } +} diff --git a/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLResource.java b/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLResource.java new file mode 100644 index 0000000000..071fdf1b45 --- /dev/null +++ b/axis-model/src/main/java/org/apache/axis/model/util/AxisXMLResource.java @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.util; + +import org.eclipse.emf.ecore.xmi.XMLHelper; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * {@link XMLHelper} implementation that uses {@link AxisXMLHelper}. + * + * @author Andreas Veithen + */ +public class AxisXMLResource extends XMLResourceImpl { + /** + * Option to specify a namespace that will be ignored if it is used in an unqualified + * xsd:QName literal. + *

+ * Axis 1.4 incorrectly assumes that xsd:QName literals that have no prefix don't + * belong to any namespace. This is incorrect: values of type xsd:QName are resolved in + * the same way as element names. An unqualified literal therefore belongs to the default + * namespace in scope where the xsd:QName appears. + *

+ * Consider the following example: + * + *

+     * <deployment xmlns="http://xml.apache.org/axis/wsdd/"
+     *             xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+     *   <transport name="http">
+     *     <requestFlow>
+     *       <handler type="URLMapper"/>
+     *       <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
+     *     </requestFlow>
+     *   </transport>
+     * </deployment>
+     * 
+ * + * If the type attribute is assumed to be of type xsd:QName, then the + * URLMapper literal actually resolves to + * {http://xml.apache.org/axis/wsdd/}URLMapper. However, Axis 1.4 incorrectly assumes + * that it has no namespace because it is unprefixed. + *

+ * This option allows to preserve compatibility with Axis 1.4 by specifying a namespace that + * will be ignored if it is encountered in the resolution of a xsd:QName literal + * without prefix. + */ + public static final String OPTION_IGNORE_NAMESPACE_FOR_UNQUALIFIED_QNAME = "IGNORE_NAMESPACE_FOR_UNQUALIFIED_QNAME"; + + protected XMLHelper createXMLHelper() { + return new AxisXMLHelper(this); + } +} diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java new file mode 100644 index 0000000000..1f5f4726ef --- /dev/null +++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.wsdd; + +import org.apache.axis.model.wsdd.impl.WSDDPackageImpl; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.BasicExtendedMetaData; + +final class WSDDExtendedMetaData extends BasicExtendedMetaData { + private static final EClass mapping = WSDDPackageImpl.eINSTANCE.getMapping(); + + public EStructuralFeature getAttribute(EClass eClass, String namespace, String name) { + if (mapping.isSuperTypeOf(eClass) && namespace == null && name.equals("languageSpecificType")) { + // TODO: emit warning + return mapping.getEStructuralFeature(WSDDPackageImpl.MAPPING__TYPE); + } else { + return super.getAttribute(eClass, namespace, name); + } + } +} diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java new file mode 100644 index 0000000000..86d71e57c9 --- /dev/null +++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.wsdd; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Writer; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +import org.apache.axis.components.logger.LogFactory; +import org.apache.axis.configuration.DefaultConfiguration; +import org.apache.axis.model.util.AxisXMLResource; +import org.apache.axis.model.wsdd.impl.WSDDPackageImpl; +import org.apache.commons.logging.Log; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; +import org.xml.sax.InputSource; + +public final class WSDDUtil { + private static final Log log = LogFactory.getLog(WSDDUtil.class.getName()); + + private WSDDUtil() {} + + public static Deployment load(InputSource is) throws IOException { + WSDDPackageImpl.eINSTANCE.eClass(); + AxisXMLResource resource = new AxisXMLResource(); + Map options = new HashMap(); + options.put(XMLResource.OPTION_EXTENDED_META_DATA, new WSDDExtendedMetaData()); + options.put(AxisXMLResource.OPTION_IGNORE_NAMESPACE_FOR_UNQUALIFIED_QNAME, WSDDPackageImpl.eNS_URI); + resource.load(is, options); + return (Deployment)resource.getContents().get(0); + } + + /** + * Load the default Axis configuration. This method implements the same algorithm as + * {@link DefaultConfiguration}. + * + * @param cl + * the class loader to load the configuration from + * @param type + * the type of configuration (client or server) + * @return the default configuration + * @throws IOException + */ + public static Deployment buildDefaultConfiguration(ClassLoader cl, String type) throws IOException { + // Load the base configuration + String resourceName = "org/apache/axis/" + type + "/" + type + "-config.wsdd"; + InputStream in = cl.getResourceAsStream(resourceName); + if (in == null) { + throw new IOException("Resource " + resourceName + " not found"); + } + if (log.isDebugEnabled()) { + log.debug("Loading resource " + resourceName); + } + Deployment deployment; + try { + deployment = WSDDUtil.load(new InputSource(in)); + } finally { + in.close(); + } + + // Discover and load additional default configuration fragments + resourceName = "META-INF/axis/default-" + type + "-config.wsdd"; + Enumeration resources = cl.getResources(resourceName); + while (resources.hasMoreElements()) { + URL url = (URL)resources.nextElement(); + if (log.isDebugEnabled()) { + log.debug("Loading " + url); + } + in = url.openStream(); + try { + deployment.merge(WSDDUtil.load(new InputSource(in))); + } finally { + in.close(); + } + } + + return deployment; + } + + public static void save(Deployment deployment, OutputStream out) throws IOException { + AxisXMLResource resource = new AxisXMLResource(); + XMLProcessor processor = new XMLProcessor(); + resource.getContents().add(deployment); + Map options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, "UTF-8"); + processor.save(out, resource, options); + } + + public static void save(Deployment deployment, Writer writer) throws IOException { + AxisXMLResource resource = new AxisXMLResource(); + XMLProcessor processor = new XMLProcessor(); + resource.getContents().add(deployment); + Map options = new HashMap(); + options.put(XMLResource.OPTION_DECLARE_XML, Boolean.FALSE); + processor.save(writer, resource, options); + } +} diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/Helper.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/Helper.java new file mode 100644 index 0000000000..620f92d395 --- /dev/null +++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/Helper.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.wsdd.impl; + +import java.util.Iterator; + +import org.apache.axis.model.wsdd.Deployment; +import org.apache.axis.model.wsdd.GlobalConfiguration; +import org.apache.axis.model.wsdd.Parameter; +import org.apache.axis.model.wsdd.Parameterizable; +import org.apache.axis.model.wsdd.WSDDFactory; + +final class Helper { + private Helper() {} + + static void merge(Deployment that, Deployment other) { + // TODO: very naive implementation; need more fine grained merging + GlobalConfiguration otherGlobalConfiguration = other.getGlobalConfiguration(); + if (otherGlobalConfiguration != null) { + that.setGlobalConfiguration(otherGlobalConfiguration); + } + that.getHandlers().addAll(other.getHandlers()); + that.getTransports().addAll(other.getTransports()); + that.getServices().addAll(other.getServices()); + that.getTypeMappings().addAll(other.getTypeMappings()); + that.getBeanMappings().addAll(other.getBeanMappings()); + that.getArrayMappings().addAll(other.getArrayMappings()); + } + + static void setParameter(Parameterizable that, String name, String value) { + for (Iterator it = that.getParameters().iterator(); it.hasNext(); ) { + Parameter param = (Parameter)it.next(); + if (name.equals(param.getName())) { + param.setValue(value); + return; + } + } + Parameter param = WSDDFactory.INSTANCE.createParameter(); + param.setName(name); + param.setValue(value); + that.getParameters().add(param); + } +} diff --git a/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java b/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java new file mode 100644 index 0000000000..cd805b4c4c --- /dev/null +++ b/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.wsdd; + +import javax.xml.namespace.QName; + +import junit.framework.TestCase; + +import org.apache.axis.deployment.wsdd.WSDDConstants; +import org.xml.sax.InputSource; + +public class DeprecationTest extends TestCase { + public void testLanguageSpecificType() throws Exception { + Deployment deployment = WSDDUtil.load(new InputSource(DeprecationTest.class.getResource("languageSpecificType.wsdd").toString())); + Service service = (Service)deployment.getServices().get(0); + BeanMapping beanMapping = (BeanMapping)service.getBeanMappings().get(0); + assertEquals(new QName(WSDDConstants.URI_WSDD_JAVA, "test.rpc.Bean"), beanMapping.getType()); + } +} diff --git a/axis-model/src/test/java/org/apache/axis/model/wsdd/LoadTest.java b/axis-model/src/test/java/org/apache/axis/model/wsdd/LoadTest.java new file mode 100644 index 0000000000..d1cad010ea --- /dev/null +++ b/axis-model/src/test/java/org/apache/axis/model/wsdd/LoadTest.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.model.wsdd; + +import java.io.File; + +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import org.xml.sax.InputSource; + +public class LoadTest extends TestCase { + private final File file; + + public LoadTest(File file) { + this.file = file; + setName(file.getName()); + } + + protected void runTest() throws Throwable { + assertNotNull(WSDDUtil.load(new InputSource(file.toURL().toString()))); + } + + public static TestSuite suite() { + TestSuite suite = new TestSuite(); + File[] files = new File("src/test/wsdd").listFiles(); + for (int i=0; i + + + + + + + \ No newline at end of file diff --git a/axis-model/src/test/wsdd/bidbuy.wsdd b/axis-model/src/test/wsdd/bidbuy.wsdd new file mode 100644 index 0000000000..603dbc5cb1 --- /dev/null +++ b/axis-model/src/test/wsdd/bidbuy.wsdd @@ -0,0 +1,23 @@ + + + + + + + + + + http://www.soapinterop.org/Bid + + + + + + + + + + + + + diff --git a/axis-model/src/test/wsdd/client-config.wsdd b/axis-model/src/test/wsdd/client-config.wsdd new file mode 100644 index 0000000000..6eb8f554f5 --- /dev/null +++ b/axis-model/src/test/wsdd/client-config.wsdd @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/axis-model/src/test/wsdd/schema2.wsdd b/axis-model/src/test/wsdd/schema2.wsdd new file mode 100644 index 0000000000..18e3dff89e --- /dev/null +++ b/axis-model/src/test/wsdd/schema2.wsdd @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-model/src/test/wsdd/server-config.wsdd b/axis-model/src/test/wsdd/server-config.wsdd new file mode 100644 index 0000000000..d250f46e74 --- /dev/null +++ b/axis-model/src/test/wsdd/server-config.wsdd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://xml.apache.org/axis/wsdd/ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-model/src/test/wsdd/stock.wsdd b/axis-model/src/test/wsdd/stock.wsdd new file mode 100644 index 0000000000..a4dc44ade7 --- /dev/null +++ b/axis-model/src/test/wsdd/stock.wsdd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-rt-compat/pom.xml b/axis-rt-compat/pom.xml new file mode 100644 index 0000000000..43defcbf24 --- /dev/null +++ b/axis-rt-compat/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-compat + Compatibility Classes + + Contains deprecated classes that are required for compatibility with older Axis versions. + + ${baseUrl}/compat + + + axis + ${baseSiteUrl}/compat + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + ${project.groupId} + axis-rt-management + ${project.version} + true + + + jetty + jetty + 5.1.10 + true + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/collections/LRUMap.java b/axis-rt-compat/src/main/java/org/apache/axis/collections/LRUMap.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/collections/LRUMap.java rename to axis-rt-compat/src/main/java/org/apache/axis/collections/LRUMap.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/collections/SequencedHashMap.java b/axis-rt-compat/src/main/java/org/apache/axis/collections/SequencedHashMap.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/collections/SequencedHashMap.java rename to axis-rt-compat/src/main/java/org/apache/axis/collections/SequencedHashMap.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/threadpool/ThreadPool.java b/axis-rt-compat/src/main/java/org/apache/axis/components/threadpool/ThreadPool.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/components/threadpool/ThreadPool.java rename to axis-rt-compat/src/main/java/org/apache/axis/components/threadpool/ThreadPool.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java b/axis-rt-compat/src/main/java/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java rename to axis-rt-compat/src/main/java/org/apache/axis/configuration/DefaultEngineConfigurationFactory.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/ServletEngineConfigurationFactory.java b/axis-rt-compat/src/main/java/org/apache/axis/configuration/ServletEngineConfigurationFactory.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/configuration/ServletEngineConfigurationFactory.java rename to axis-rt-compat/src/main/java/org/apache/axis/configuration/ServletEngineConfigurationFactory.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java b/axis-rt-compat/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java similarity index 85% rename from axis-rt-core/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java rename to axis-rt-compat/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java index 3b2983cc98..060162cdcd 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java +++ b/axis-rt-compat/src/main/java/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java @@ -1,7 +1,7 @@ package org.apache.axis.encoding; /** - * @author James M Snell + * @author James M Snell <jasnell@us.ibm.com> * @deprecated Please use DefaultSOAPEncodingTypeMappingImpl.java * @see org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/enum/Scope.java b/axis-rt-compat/src/main/java/org/apache/axis/enum/Scope.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/enum/Scope.java rename to axis-rt-compat/src/main/java/org/apache/axis/enum/Scope.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/enum/Style.java b/axis-rt-compat/src/main/java/org/apache/axis/enum/Style.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/enum/Style.java rename to axis-rt-compat/src/main/java/org/apache/axis/enum/Style.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/enum/Use.java b/axis-rt-compat/src/main/java/org/apache/axis/enum/Use.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/enum/Use.java rename to axis-rt-compat/src/main/java/org/apache/axis/enum/Use.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/JettyAxisServer.java b/axis-rt-compat/src/main/java/org/apache/axis/transport/http/JettyAxisServer.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/http/JettyAxisServer.java rename to axis-rt-compat/src/main/java/org/apache/axis/transport/http/JettyAxisServer.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/NonBlockingBufferedInputStream.java b/axis-rt-compat/src/main/java/org/apache/axis/transport/http/NonBlockingBufferedInputStream.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/http/NonBlockingBufferedInputStream.java rename to axis-rt-compat/src/main/java/org/apache/axis/transport/http/NonBlockingBufferedInputStream.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/SimpleAxisServer.java b/axis-rt-compat/src/main/java/org/apache/axis/transport/http/SimpleAxisServer.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/http/SimpleAxisServer.java rename to axis-rt-compat/src/main/java/org/apache/axis/transport/http/SimpleAxisServer.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/SimpleAxisWorker.java b/axis-rt-compat/src/main/java/org/apache/axis/transport/http/SimpleAxisWorker.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/http/SimpleAxisWorker.java rename to axis-rt-compat/src/main/java/org/apache/axis/transport/http/SimpleAxisWorker.java diff --git a/axis-rt-compat/src/site/site.xml b/axis-rt-compat/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-compat/src/site/site.xml @@ -0,0 +1,24 @@ + + + + +

+ + diff --git a/axis-rt-core/pom.xml b/axis-rt-core/pom.xml index 6620bf6cfc..254cdf0b03 100644 --- a/axis-rt-core/pom.xml +++ b/axis-rt-core/pom.xml @@ -48,7 +48,6 @@ javax.mail mail - 1.4.1 wsdl4j @@ -71,30 +70,6 @@ xmlParserAPIs 2.6.2 - - commons-httpclient - commons-httpclient - 3.0.1 - true - - - junit - junit - - - - - commons-net - commons-net - 1.0.0 - true - - - jetty - jetty - 5.1.10 - true - junit junit @@ -105,18 +80,17 @@ xmlunit test - - xalan - xalan - 2.6.0 - test - oro oro 2.0.6 test + + org.apache.ws.commons.axiom + testutils + test + @@ -129,7 +103,6 @@ org.codehaus.gmaven gmaven-plugin - 1.2 generate-timestamp @@ -148,28 +121,28 @@ - maven-dependency-plugin + com.github.veithen.alta + alta-maven-plugin - generate-resources - copy + generate-properties - - + compile.bootclasspath + %file% + ${path.separator} + + xerces xmlParserAPIs - - - ${project.groupId} + + + org.apache.axis axis-saaj ${project.version} - - - true - ${project.build.directory}/endorsed - true + + @@ -177,19 +150,9 @@ maven-compiler-plugin - - - org/apache/axis/components/image/JimiIO.java - - org/apache/axis/components/net/IBM*.java - - org/apache/axis/providers/ComProvider.java - - org/apache/axis/encoding/ser/xbeans/** - - -Xbootclasspath/p:${project.build.directory}/endorsed/xmlParserAPIs.jar${path.separator}${project.build.directory}/endorsed/axis-saaj.jar + -Xbootclasspath/p:${compile.bootclasspath} @@ -220,8 +183,6 @@ test/wsdd/TestXSD.java - - -Xbootclasspath/p:${project.build.directory}/endorsed/xmlParserAPIs.jar @@ -245,17 +206,6 @@ - - maven-project-info-reports-plugin - 2.4 - - - - dependencies - - - - org.codehaus.mojo jdepend-maven-plugin diff --git a/axis-rt-core/src/main/java/org/apache/axis/AxisProperties.java b/axis-rt-core/src/main/java/org/apache/axis/AxisProperties.java index 5427389c5b..056a8d7022 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/AxisProperties.java +++ b/axis-rt-core/src/main/java/org/apache/axis/AxisProperties.java @@ -45,8 +45,7 @@ /** - *

Configuration properties for AXIS. - *

+ * Configuration properties for AXIS. * *

Manage configuration properties according to a secure * scheme similar to that used by classloaders: @@ -70,7 +69,6 @@ * *

  • System properties take precedence over all other properties
  • * - *

    * * @author Richard A. Sitze */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/Constants.java b/axis-rt-core/src/main/java/org/apache/axis/Constants.java index f107539d35..4052ee8f93 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/Constants.java +++ b/axis-rt-core/src/main/java/org/apache/axis/Constants.java @@ -644,7 +644,7 @@ public static boolean isWSDLSOAP(String s) { /** * QName of exception Name element in an axis fault detail. - * Do not use - this is for pre-1.0 server->client exceptions. + * Do not use - this is for pre-1.0 server->client exceptions. */ public static final QName QNAME_FAULTDETAIL_EXCEPTIONNAME = new QName(NS_URI_AXIS, "exceptionName"); diff --git a/axis-rt-core/src/main/java/org/apache/axis/EngineConfigurationFactory.java b/axis-rt-core/src/main/java/org/apache/axis/EngineConfigurationFactory.java index a3bf698661..1b5ed098c7 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/EngineConfigurationFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/EngineConfigurationFactory.java @@ -27,7 +27,7 @@ * //If a factory cannot be created, return 'null'. * // * //The factory may return non-NULL only if: - * // - it knows what to do with the param (check type & process value) + * // - it knows what to do with the param (check type & process value) * // - it can find it's configuration information * // * //@see org.apache.axis.configuration.EngineConfigurationFactoryFinder diff --git a/axis-rt-core/src/main/java/org/apache/axis/Handler.java b/axis-rt-core/src/main/java/org/apache/axis/Handler.java index 4af62343a3..5604016d75 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/Handler.java +++ b/axis-rt-core/src/main/java/org/apache/axis/Handler.java @@ -69,7 +69,7 @@ public interface Handler extends Serializable { * Indicate if this handler can process qname. * * @param qname the QName to check - * @return true if this Handler can handle qname, + * @return true if this Handler can handle qname, * false otherwise */ public boolean canHandleBlock(QName qname); diff --git a/axis-rt-core/src/main/java/org/apache/axis/Part.java b/axis-rt-core/src/main/java/org/apache/axis/Part.java index 39f8ae57ba..04eebf7907 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/Part.java +++ b/axis-rt-core/src/main/java/org/apache/axis/Part.java @@ -32,7 +32,6 @@ public interface Part extends java.io.Serializable * "Content-Type" * @return a String array giving all the values for * the specified header - * @see #setMimeHeader(java.lang.String, java.lang.String) setMimeHeader(java.lang.String, java.lang.String) */ public String[] getMimeHeader(String name); diff --git a/axis-rt-core/src/main/java/org/apache/axis/SOAPPart.java b/axis-rt-core/src/main/java/org/apache/axis/SOAPPart.java index b14af1833f..a983f36c9d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/SOAPPart.java +++ b/axis-rt-core/src/main/java/org/apache/axis/SOAPPart.java @@ -827,7 +827,7 @@ public java.util.Iterator getNonMatchingMimeHeaders( final String[] match){ /** * Sets the content of the SOAPEnvelope object * with the data from the given Source object. - * @param source javax.xml.transform.Source object with the data to + * @param source javax.xml.transform.Source object with the data to * be set * @throws SOAPException if there is a problem in * setting the source @@ -950,7 +950,7 @@ public Iterator getAllMimeHeaders() { * current value(s) of the first header that is a match if * there is one. If there is no match, this value will be * the value for a new MimeHeader object. - * @ throws java.lang.IllegalArgumentException if + * @throws java.lang.IllegalArgumentException if * there was a problem with the specified mime header name * or value * @see #getMimeHeader(java.lang.String) getMimeHeader(java.lang.String) diff --git a/axis-rt-core/src/main/java/org/apache/axis/attachments/AttachmentPart.java b/axis-rt-core/src/main/java/org/apache/axis/attachments/AttachmentPart.java index 1d530e4cc4..bfa9ded08f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/attachments/AttachmentPart.java +++ b/axis-rt-core/src/main/java/org/apache/axis/attachments/AttachmentPart.java @@ -17,7 +17,6 @@ import org.apache.axis.Part; import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.components.image.ImageIOFactory; import org.apache.axis.transport.http.HTTPConstants; import org.apache.axis.utils.Messages; import org.apache.axis.utils.SessionUtils; @@ -25,6 +24,7 @@ import org.apache.commons.logging.Log; import javax.activation.DataHandler; +import javax.imageio.ImageIO; import javax.xml.soap.SOAPException; import javax.xml.transform.stream.StreamSource; import java.util.Iterator; @@ -343,7 +343,7 @@ public Object getContent() throws SOAPException { } else if (ds.getContentType().equals("image/gif") || ds.getContentType().equals("image/jpeg")) { try { - return ImageIOFactory.getImageIO().loadImage(is); + return ImageIO.read(is); } catch (Exception ex) { log.error(Messages.getMessage("javaIOException00"), ex); throw new SOAPException(ex); diff --git a/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java b/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java index 5d9c65d7f9..33020e07b8 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java +++ b/axis-rt-core/src/main/java/org/apache/axis/attachments/DimeBodyPart.java @@ -319,51 +319,60 @@ void send(java.io.OutputStream os, byte position, DataHandler dh, void send(java.io.OutputStream os, byte position, DynamicContentDataHandler dh, final long maxchunk) throws java.io.IOException { - - BufferedInputStream in = new BufferedInputStream(dh.getInputStream()); - - final int myChunkSize = dh.getChunkSize(); - - byte[] buffer1 = new byte[myChunkSize]; - byte[] buffer2 = new byte[myChunkSize]; - - int bytesRead1 = 0 , bytesRead2 = 0; - - bytesRead1 = in.read(buffer1); - - if(bytesRead1 < 0) { + + BufferedInputStream in = new BufferedInputStream(dh.getInputStream()); + + try { + final int myChunkSize = dh.getChunkSize(); + + byte[] buffer1 = new byte[myChunkSize]; + byte[] buffer2 = new byte[myChunkSize]; + + int bytesRead1 = 0 , bytesRead2 = 0; + + bytesRead1 = in.read(buffer1); + + if(bytesRead1 < 0) { sendHeader(os, position, 0, ONLY_CHUNK); os.write(pad, 0, dimePadding(0)); return; - } - byte chunkbyte = CHUNK; - do { - bytesRead2 = in.read(buffer2); - - if(bytesRead2 < 0) { - //last record...do not set the chunk bit. - //buffer1 contains the last chunked record!! - - //Need to distinguish if this is the first - //chunk to ensure the TYPE and ID are sent - if ( chunkbyte == CHUNK ){ - chunkbyte = ONLY_CHUNK; - } else { - chunkbyte = LAST_CHUNK; - } - sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte); - break; - } - - sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte); - //set chunk byte to next chunk flag to avoid - //sending TYPE and ID on subsequent chunks - chunkbyte = CHUNK_NEXT; - //now that we have written out buffer1, copy buffer2 into to buffer1 - System.arraycopy(buffer2,0,buffer1,0,myChunkSize); - bytesRead1 = bytesRead2; - - }while(bytesRead2 > 0); + } + byte chunkbyte = CHUNK; + do { + bytesRead2 = in.read(buffer2); + + if(bytesRead2 < 0) { + //last record...do not set the chunk bit. + //buffer1 contains the last chunked record!! + + //Need to distinguish if this is the first + //chunk to ensure the TYPE and ID are sent + if ( chunkbyte == CHUNK ){ + chunkbyte = ONLY_CHUNK; + } else { + chunkbyte = LAST_CHUNK; + } + sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte); + break; + } + + sendChunk(os, position, buffer1, 0, bytesRead1, chunkbyte); + //set chunk byte to next chunk flag to avoid + //sending TYPE and ID on subsequent chunks + chunkbyte = CHUNK_NEXT; + //now that we have written out buffer1, copy buffer2 into to buffer1 + System.arraycopy(buffer2,0,buffer1,0,myChunkSize); + bytesRead1 = bytesRead2; + + }while(bytesRead2 > 0); + } finally { + try { + in.close(); + } + catch (IOException e) { + // ignore + } + } } protected void sendChunk(java.io.OutputStream os, @@ -415,7 +424,7 @@ protected void sendHeader(java.io.OutputStream os, if ( MB || isFirstChunk ){ //If this is a follow on chunk dont send id again. fixedHeader[1] = (byte) ((dtnf.toByte() << 4) & 0xf0); } else { - fixedHeader[1] = (byte) 0x00; + fixedHeader[1] = (byte) 0x00; } //OPT_T @@ -430,7 +439,7 @@ protected void sendHeader(java.io.OutputStream os, fixedHeader[4] = (byte) ((id.length >>> 8) & 0xff); fixedHeader[5] = (byte) ((id.length) & 0xff); } else { - fixedHeader[4] = (byte) 0; + fixedHeader[4] = (byte) 0; fixedHeader[5] = (byte) 0; } @@ -439,7 +448,7 @@ protected void sendHeader(java.io.OutputStream os, fixedHeader[6] = (byte) ((type.length >>> 8) & 0xff); fixedHeader[7] = (byte) ((type.length) & 0xff); } else { - fixedHeader[6] = (byte) 0; + fixedHeader[6] = (byte) 0; fixedHeader[7] = (byte) 0; } diff --git a/axis-rt-core/src/main/java/org/apache/axis/attachments/ImageDataSource.java b/axis-rt-core/src/main/java/org/apache/axis/attachments/ImageDataSource.java index c0db11de72..c07958e828 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/attachments/ImageDataSource.java +++ b/axis-rt-core/src/main/java/org/apache/axis/attachments/ImageDataSource.java @@ -15,24 +15,29 @@ */ package org.apache.axis.attachments; -import org.apache.axis.components.image.ImageIOFactory; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.utils.Messages; import org.apache.commons.logging.Log; import javax.activation.DataSource; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriter; + import java.awt.*; +import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.Iterator; public class ImageDataSource implements DataSource { protected static Log log = LogFactory.getLog(ImageDataSource.class.getName()); - public static final String CONTENT_TYPE = "image/jpeg"; + public static final String CONTENT_TYPE = "image/png"; private final String name; private final String contentType; @@ -49,7 +54,25 @@ public ImageDataSource(String name, String contentType, Image data) { os = new ByteArrayOutputStream(); try { if (data != null) { - ImageIOFactory.getImageIO().saveImage(this.contentType, data, os); + ImageWriter writer = null; + Iterator iter = ImageIO.getImageWritersByMIMEType(contentType); + if (iter.hasNext()) { + writer = (ImageWriter) iter.next(); + } + writer.setOutput(ImageIO.createImageOutputStream(os)); + BufferedImage rendImage = null; + if (data instanceof BufferedImage) { + rendImage = (BufferedImage) data; + } else { + MediaTracker tracker = new MediaTracker(new Component() {}); + tracker.addImage(data, 0); + tracker.waitForAll(); + rendImage = new BufferedImage(data.getWidth(null), data.getHeight(null), 1); + Graphics g = rendImage.createGraphics(); + g.drawImage(data, 0, 0, null); + } + writer.write(new IIOImage(rendImage, null, null)); + writer.dispose(); } } catch (Exception e) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/attachments/MimeUtils.java b/axis-rt-core/src/main/java/org/apache/axis/attachments/MimeUtils.java index 3028d6efe2..e7061537da 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/attachments/MimeUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/attachments/MimeUtils.java @@ -249,7 +249,7 @@ public static javax.mail.internet.MimeMultipart createMP( if(sendType == Attachments.SEND_TYPE_MTOM) { multipart = new javax.mail.internet.MimeMultipart( - "related;type=\"application/xop+xml\"; start=\"<" + rootCID + ">\"; start-info=\"text/xml; charset=utf-8\""); + "related;type=\"application/xop+xml\"; start=\"<" + rootCID + ">\"; start-info=\"text/xml\"; charset=\"utf-8\""); } else { multipart = new javax.mail.internet.MimeMultipart( "related; type=\"text/xml\"; start=\"<" + rootCID + ">\""); diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/AdminClient.java b/axis-rt-core/src/main/java/org/apache/axis/client/AdminClient.java index 319d1459b3..39faaaace7 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/client/AdminClient.java +++ b/axis-rt-core/src/main/java/org/apache/axis/client/AdminClient.java @@ -107,7 +107,7 @@ private static String getUsageInfo() /** * Construct an admin client w/o a logger. * If the client cannot create a call object, then it does not throw an exception. - * Instead it prints a message to {@link System.err}. + * Instead it prints a message to {@link System#err}. * This is for 'historical reasons' */ public AdminClient() @@ -152,7 +152,7 @@ private void initAdminClient() throws ServiceException { /** - * External access to our CallCall object. * This will be null if the non-excepting constructor was used * and the construction failed. * @return the Call object this instance uses diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/AxisClient.java b/axis-rt-core/src/main/java/org/apache/axis/client/AxisClient.java index 1d64c9ee57..199fd8f766 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/client/AxisClient.java +++ b/axis-rt-core/src/main/java/org/apache/axis/client/AxisClient.java @@ -35,7 +35,7 @@ /** * Provides the equivalent of an "Axis engine" on the client side. - * Subclasses hardcode initialization & setup logic for particular + * Subclasses hardcode initialization & setup logic for particular * client-side transports. * * @author Rob Jellinghaus (robj@unrealities.com) diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/Call.java b/axis-rt-core/src/main/java/org/apache/axis/client/Call.java index 9a0ce97fa3..a71362ace6 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/client/Call.java +++ b/axis-rt-core/src/main/java/org/apache/axis/client/Call.java @@ -2340,7 +2340,7 @@ public void registerTypeMapping(Class javaType, * invoked method. If any of these objects are RPCParams, * Axis will use the embedded name of the RPCParam as the * name of the parameter. Otherwise, we will serialize - * each argument as an XML element called "arg". + * each argument as an XML element called "arg<n>". * @return a deserialized Java Object containing the return value * @exception AxisFault */ @@ -2382,7 +2382,7 @@ public Object invoke(String namespace, String method, Object[] args) * invoked method. If any of these objects are RPCParams, * Axis will use the embedded name of the RPCParam as the * name of the parameter. Otherwise, we will serialize - * each argument as an XML element called "arg". + * each argument as an XML element called "arg<n>". * @return a deserialized Java Object containing the return value * @exception AxisFault */ @@ -2893,7 +2893,7 @@ public Service getService() * * Set the service so that it defers missing property gets to the * Call. So when client-side Handlers get at the MessageContext, - * the property scoping will be MC -> SOAPService -> Call + * the property scoping will be MC -> SOAPService -> Call */ public void setSOAPService(SOAPService service) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java b/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java index 33054a557f..57d7694d85 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/client/ServiceFactory.java @@ -17,9 +17,11 @@ package org.apache.axis.client; import org.apache.axis.EngineConfiguration; +import org.apache.axis.components.logger.LogFactory; import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.Messages; +import org.apache.commons.logging.Log; import javax.naming.Context; import javax.naming.InitialContext; @@ -47,6 +49,9 @@ public class ServiceFactory extends javax.xml.rpc.ServiceFactory implements ObjectFactory { + protected static Log log = + LogFactory.getLog(ServiceFactory.class.getName()); + // Constants for RefAddrs in the Reference. public static final String SERVICE_CLASSNAME = "service classname"; public static final String WSDL_LOCATION = "WSDL location"; @@ -106,6 +111,11 @@ public static Service getService(Map environment) if (context != null) { String name = (String)environment.get("jndiName"); + + if(name!=null && (name.toUpperCase().indexOf("LDAP")!=-1 || name.toUpperCase().indexOf("RMI")!=-1 || name.toUpperCase().indexOf("JMS")!=-1 || name.toUpperCase().indexOf("JMX")!=-1 || name.toUpperCase().indexOf("JRMP")!=-1 || name.toUpperCase().indexOf("JAVA")!=-1 || name.toUpperCase().indexOf("DNS")!=-1 || name.toUpperCase().indexOf("IIOP")!=-1 || name.toUpperCase().indexOf("CORBANAME")!=-1)) { + log.warn("returning null, jndiName received by ServiceFactory.getService() is not supported by this method: " + name); + return null; + } if (name == null) { name = "axisServiceName"; } @@ -120,6 +130,7 @@ public static Service getService(Map environment) context.bind(name, service); } catch (NamingException e1) { // !!! Couldn't do it, what should we do here? + return null; } } } else { diff --git a/axis-rt-core/src/main/java/org/apache/axis/client/Stub.java b/axis-rt-core/src/main/java/org/apache/axis/client/Stub.java index 6af6438438..72df6dc7cc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/client/Stub.java +++ b/axis-rt-core/src/main/java/org/apache/axis/client/Stub.java @@ -432,11 +432,14 @@ public Service _getService() { * @return */ public Call _createCall() throws ServiceException { - _call = (Call) service.createCall(); + // A single stub instance may be used concurrently by multiple threads; therefore we need + // to return the value of the local call variable instead of reading the _call attribute. + Call call = (Call) service.createCall(); + _call = call; // TODO: There is a lot of code in the generated stubs that // can be moved here. - return _call; + return call; } /** diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/AbstractCompiler.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/AbstractCompiler.java deleted file mode 100644 index e159619204..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/AbstractCompiler.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.List; - -/** - * This class implements the functionality common to all Java compilers. - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ -public abstract class AbstractCompiler implements Compiler { - - /** - * The source program filenames - */ - protected ArrayList fileList = new ArrayList(); - - /** - * The name of the directory containing the source program file - */ - protected String srcDir; - - /** - * The name of the directory to contain the resulting object program file - */ - protected String destDir; - - /** - * The classpath to be used for compilation - */ - protected String classpath; - - /** - * The encoding of the source program or null to use the - * platform's default encoding - */ - protected String encoding = null; - - /** - * The input stream to output compilation errors - */ - protected InputStream errors; - - /** - * Add the name of the file containing the source program to the file list - * - * @param file The name of the file containing the source program - */ - public void addFile(String file) { - this.fileList.add(file); - } - - /** - * Set the name of the directory containing the source program file - * - * @param srcDir The name of the directory containing the source program file - */ - public void setSource(String srcDir) { - this.srcDir = srcDir; - } - - /** - * Set the name of the directory to contain the resulting object program file - * - * @param destDir The name of the directory to contain the resulting object - * program file - */ - public void setDestination(String destDir) { - this.destDir = destDir; - } - - /** - * Set the classpath to be used for this compilation - * - * @param classpath The classpath to be used for this compilation - */ - public void setClasspath(String classpath) { - this.classpath = classpath; - } - - /** - * Set the encoding of the input source file or null to use the - * platform's default encoding - * - * @param encoding The encoding of the input source file or null - * to use the platform's default encoding - */ - public void setEncoding(String encoding) { - this.encoding = encoding; - } - - /** - * Return the list of errors generated by this compilation - * - * @return The list of errors generated by this compilation - * @exception IOException If an error occurs during message collection - */ - public List getErrors() throws IOException { - return parseStream(new BufferedReader(new InputStreamReader(errors))); - } - - /** - * Parse the compiler error stream to produce a list of - * CompilerErrors - * - * @param errors The error stream - * @return The list of compiler error messages - * @exception IOException If an error occurs during message collection - */ - protected abstract List parseStream(BufferedReader errors) - throws IOException; - - /** - * Fill the arguments taken by the Java compiler - * - * @param arguments The list of compilation arguments - * @return The prepared list of compilation arguments - */ - protected List fillArguments(List arguments) { - // destination directory - arguments.add("-d"); - arguments.add(destDir); - - // classpath - arguments.add("-classpath"); - arguments.add(classpath); - - // sourcepath - if(srcDir != null) { - arguments.add("-sourcepath"); - arguments.add(srcDir); - } - - // add optimization (for what is worth) - arguments.add("-O"); - - // add debug option - arguments.add("-g"); - - // add encoding if set - if (encoding != null) { - arguments.add("-encoding"); - arguments.add(encoding); - } - - return arguments; - } - - /** - * Copy arguments to a string array - * - * @param arguments The compiler arguments - * @return A string array containing compilation arguments - */ - protected String[] toStringArray(List arguments) { - int i; - String[] args = new String[arguments.size() + fileList.size()]; - - for (i = 0; i < arguments.size(); i++) { - args[i] = (String) arguments.get(i); - } - - for (int j=0; j < fileList.size(); i++,j++) { - args[i] = (String)fileList.get(j); - } - return args; - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Compiler.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Compiler.java deleted file mode 100644 index 92f34f5a7c..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Compiler.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -import java.io.IOException; -import java.util.List; - -/** - * This interface defines a compiler's functionality for all - * (Java-based) compiled languages - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ -public interface Compiler { - /** - * Set the name of the file containing the source program - * - * @param file The name of the file containing the source program - */ - void addFile(String file); - - /** - * Set the name of the directory containing the source program file - * - * @param srcDir The name of the directory containing the source program file - */ - void setSource(String srcDir); - - /** - * Set the name of the directory to contain the resulting object program file - * - * @param destDir The name of the directory to contain the resulting object - * program file - */ - void setDestination(String destDir); - - /** - * Set the classpath to be used for this compilation - * - * @param classpath The classpath to be used for this compilation - */ - void setClasspath(String classpath); - - /** - * Set the encoding of the input source file or null to use the - * platform's default encoding - * - * @param encoding The encoding of the input source file or null - * to use the platform's default encoding - */ - void setEncoding(String encoding); - - /** - * Compile a source file yielding a loadable program file. - * - * @param filename The object program base file name - * @param baseDirectory The directory containing the object program file - * @param encoding The encoding expected in the source file or - * null if it is the platform's default encoding - * @exception LanguageException If an error occurs during compilation - */ - boolean compile() throws IOException; - - /** - * Return the list of errors generated by this compilation - * - * @return The list of errors generated by this compilation - * @exception IOException If an error occurs during message collection - */ - List getErrors() throws IOException; -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerError.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerError.java deleted file mode 100644 index bb006fd85f..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerError.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -/** - * This class encapsulates an error message produced by a programming language - * processor (whether interpreted or compiled) - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ - -public class CompilerError { - /** - * Is this a severe error or a warning? - */ - private boolean error; - /** - * The start line number of the offending program text - */ - private int startline; - /** - * The start column number of the offending program text - */ - private int startcolumn; - /** - * The end line number of the offending program text - */ - private int endline; - /** - * The end column number of the offending program text - */ - private int endcolumn; - /** - * The name of the file containing the offending program text - */ - private String file; - /** - * The actual error text produced by the language processor - */ - private String message; - - /** - * The error message constructor. - * - * @param file The name of the file containing the offending program text - * @param error The actual error text produced by the language processor - * @param startline The start line number of the offending program text - * @param startcolumn The start column number of the offending program text - * @param endline The end line number of the offending program text - * @param endcolumn The end column number of the offending program text - * @param message The actual error text produced by the language processor - */ - public CompilerError( - String file, - boolean error, - int startline, - int startcolumn, - int endline, - int endcolumn, - String message - ) - { - this.file = file; - this.error = error; - this.startline = startline; - this.startcolumn = startcolumn; - this.endline = endline; - this.endcolumn = endcolumn; - this.message = message; - } - - /** - * The error message constructor. - * - * @param message The actual error text produced by the language processor - */ - public CompilerError(String message) { - this.message = message; - } - - /** - * Return the filename associated with this compiler error. - * - * @return The filename associated with this compiler error - */ - public String getFile() { - return file; - } - - /** - * Assert whether this is a severe error or a warning - * - * @return Whether the error is severe - */ - public boolean isError() { - return error; - } - - /** - * Return the starting line number of the program text originating this error - * - * @return The starting line number of the program text originating this error - */ - public int getStartLine() { - return startline; - } - - /** - * Return the starting column number of the program text originating this - * error - * - * @return The starting column number of the program text originating this - * error - */ - public int getStartColumn() { - return startcolumn; - } - - /** - * Return the ending line number of the program text originating this error - * - * @return The ending line number of the program text originating this error - */ - public int getEndLine() { - return endline; - } - - /** - * Return the ending column number of the program text originating this - * error - * - * @return The ending column number of the program text originating this - * error - */ - public int getEndColumn() { - return endcolumn; - } - - /** - * Return the message produced by the language processor - * - * @return The message produced by the language processor - */ - public String getMessage() { - return message; - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerFactory.java deleted file mode 100644 index e2db8d8fb2..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/CompilerFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -import org.apache.axis.AxisProperties; -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.utils.Messages; -import org.apache.commons.logging.Log; - - -/** - * This class implements a factory to instantiate a Compiler. - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ -public class CompilerFactory { - protected static Log log = - LogFactory.getLog(CompilerFactory.class.getName()); - - static { - AxisProperties.setClassOverrideProperty(Compiler.class, "axis.Compiler"); - - AxisProperties.setClassDefault(Compiler.class, - "org.apache.axis.components.compiler.Javac"); - } - - public static Compiler getCompiler() { - Compiler compiler = (Compiler)AxisProperties.newInstance(Compiler.class); - - /** - * This shouldn't be needed, but seems to be a common feel-good: - */ - if (compiler == null) { - log.debug(Messages.getMessage("defaultCompiler")); - compiler = new Javac(); - } - - log.debug("axis.Compiler:" + compiler.getClass().getName()); - - return compiler; - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Javac.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Javac.java deleted file mode 100644 index db20ee0115..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Javac.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.utils.ClassUtils; -import org.apache.axis.utils.Messages; -import org.apache.commons.logging.Log; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.StringTokenizer; -import java.net.URL; -import java.net.MalformedURLException; -import java.net.URLClassLoader; - -/** - * This class wraps the Sun's Javac Compiler. - * - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ - -public class Javac extends AbstractCompiler -{ - protected static Log log = - LogFactory.getLog(Javac.class.getName()); - - public static final String CLASSIC_CLASS = "sun.tools.javac.Main"; - public static final String MODERN_CLASS = "com.sun.tools.javac.main.Main"; - - private boolean modern = false; - - public Javac() { - ClassLoader cl = getClassLoader(); - try { - ClassUtils.forName(MODERN_CLASS, true, cl); - modern = true; - } catch (ClassNotFoundException e) { - log.debug(Messages.getMessage("noModernCompiler")); - try { - ClassUtils.forName(CLASSIC_CLASS, true, cl); - modern = false; - } catch (Exception ex) { - log.error(Messages.getMessage("noCompiler00"), ex); - throw new RuntimeException(Messages.getMessage("noCompiler00")); - } - } - log.debug(Messages.getMessage("compilerClass", - (modern ? MODERN_CLASS : CLASSIC_CLASS))); - } - - private ClassLoader getClassLoader() { - // Use reflection to be able to build on all JDKs - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - - URL toolsURL = null; - String tools = System.getProperty("java.home"); - if (tools != null) { - File f = new File(tools + "/../lib/tools.jar"); - if (f.exists()) { - try { - toolsURL = f.toURL(); - cl = new URLClassLoader(new URL[]{toolsURL}, cl); - } catch (MalformedURLException e) { - } - } - } - - return cl; - } - - /** - * Compile a source file yielding a loadable class file. - * - * @exception IOException If an error occurs during compilation - */ - public boolean compile() throws IOException { - ByteArrayOutputStream err = new ByteArrayOutputStream(); - boolean result = false; - - try { - // Create an instance of the compiler, redirecting output to err - Class c = ClassUtils.forName(modern ? MODERN_CLASS : CLASSIC_CLASS, - true, - getClassLoader()); - - Constructor cons; - Object compiler; - if (modern) { - PrintWriter pw = new PrintWriter(new OutputStreamWriter(err)); - cons = - c.getConstructor(new Class[] { String.class, - PrintWriter.class}); - - compiler = cons.newInstance(new Object[] { "javac", pw }); - } - else { - cons = - c.getConstructor(new Class[] { OutputStream.class, - String.class }); - compiler = cons.newInstance(new Object[] { err, "javac" }); - - } - - // Call the compile() method - Method compile = c.getMethod("compile", - new Class [] { String[].class }); - - if (modern) { - int compilationResult = - ((Integer)compile.invoke(compiler, new Object[] - { - toStringArray(fillArguments - (new ArrayList()))})).intValue(); - - result = (compilationResult == 0); - log.debug("Compilation Returned: " - + Integer.toString(compilationResult)); - } - else { - Boolean ok = - (Boolean)compile.invoke(compiler, new Object[] - {toStringArray(fillArguments(new ArrayList()))}); - - result = ok.booleanValue(); - } - } catch (Exception cnfe){ - log.error(Messages.getMessage("noCompiler00"), cnfe); - throw new RuntimeException(Messages.getMessage("noCompiler00")); - } - - this.errors = new ByteArrayInputStream(err.toByteArray()); - return result; - } - - /** - * Parse the compiler error stream to produce a list of - * CompilerErrors - * - * @param input The error stream - * @return The list of compiler error messages - * @exception IOException If an error occurs during message collection - */ - protected List parseStream(BufferedReader input) throws IOException { - if (modern) { - return parseModernStream(input); - } else { - return parseClassicStream(input); - } - } - - /** - * Parse the compiler error stream to produce a list of - * CompilerErrors - * - * @param input The error stream - * @return The list of compiler error messages - * @exception IOException If an error occurs during message collection - */ - protected List parseModernStream(BufferedReader input) throws IOException { - List errors = new ArrayList(); - String line = null; - StringBuffer buffer = null; - - while (true) { - // cleanup the buffer - buffer = new StringBuffer(); // this is quicker than clearing it - - // most errors terminate with the '^' char - do { - if ((line = input.readLine()) == null) - { - if (buffer.length() > 0) { - // There's an error which doesn't end with a '^' - errors.add(new CompilerError("\n" + buffer.toString())); - } - return errors; - } - log.debug(line); - buffer.append(line); - buffer.append('\n'); - } while (!line.endsWith("^")); - - // add the error bean - errors.add(parseModernError(buffer.toString())); - } - } - - /** - * Parse an individual compiler error message with modern style. - * - * @param error The error text - * @return A messaged CompilerError - */ - private CompilerError parseModernError(String error) { - StringTokenizer tokens = new StringTokenizer(error, ":"); - try { - String file = tokens.nextToken(); - if (file.length() == 1) file = new StringBuffer(file).append(":").append(tokens.nextToken()).toString(); - int line = Integer.parseInt(tokens.nextToken()); - - String message = tokens.nextToken("\n").substring(1); - String context = tokens.nextToken("\n"); - String pointer = tokens.nextToken("\n"); - int startcolumn = pointer.indexOf("^"); - int endcolumn = context.indexOf(" ", startcolumn); - if (endcolumn == -1) endcolumn = context.length(); - return new CompilerError(file, false, line, startcolumn, line, endcolumn, message); - } catch(NoSuchElementException nse) { - return new CompilerError(Messages.getMessage("noMoreTokens", error)); - } catch(Exception nse) { - return new CompilerError(Messages.getMessage("cantParse", error)); - } - } - - /** - * Parse the compiler error stream to produce a list of - * CompilerErrors - * - * @param input The error stream - * @return The list of compiler error messages - * @exception IOException If an error occurs during message collection - */ - protected List parseClassicStream(BufferedReader input) throws IOException { - List errors = null; - String line = null; - StringBuffer buffer = null; - - while (true) { - // cleanup the buffer - buffer = new StringBuffer(); // this is faster than clearing it - - // each error has 3 lines - for (int i = 0; i < 3 ; i++) { - if ((line = input.readLine()) == null) return errors; - log.debug(line); - buffer.append(line); - buffer.append('\n'); - } - - // if error is found create the vector - if (errors == null) errors = new ArrayList(); - - // add the error bean - errors.add(parseClassicError(buffer.toString())); - } - } - - /** - * Parse an individual compiler error message with classic style. - * - * @param error The error text - * @return A messaged CompilerError - */ - private CompilerError parseClassicError(String error) { - StringTokenizer tokens = new StringTokenizer(error, ":"); - try { - String file = tokens.nextToken(); - if (file.length() == 1) { - file = new StringBuffer(file).append(":"). - append(tokens.nextToken()).toString(); - } - int line = Integer.parseInt(tokens.nextToken()); - - String last = tokens.nextToken(); - // In case the message contains ':', it should be reassembled - while (tokens.hasMoreElements()) { - last += tokens.nextToken(); - } - tokens = new StringTokenizer(last.trim(), "\n"); - String message = tokens.nextToken(); - String context = tokens.nextToken(); - String pointer = tokens.nextToken(); - int startcolumn = pointer.indexOf("^"); - int endcolumn = context.indexOf(" ", startcolumn); - if (endcolumn == -1) endcolumn = context.length(); - - return new CompilerError(srcDir + File.separator + file, true, - line, startcolumn, line, endcolumn, message); - } catch(NoSuchElementException nse) { - return new CompilerError(Messages.getMessage("noMoreTokens", - error)); - } catch(Exception nse) { - return new CompilerError(Messages.getMessage("cantParse", error)); - } - } - - public String toString() { - return Messages.getMessage("sunJavac"); - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Jikes.java b/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Jikes.java deleted file mode 100644 index d4937019be..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/compiler/Jikes.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.compiler; - -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.utils.Messages; -import org.apache.commons.logging.Log; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * This class wraps IBM's Jikes Java compiler - * NOTE: inspired by the Apache Jasper implementation. - * @author Davanum Srinivas - * @author Stefano Mazzocchi - * @since 2.0 - */ - -public class Jikes extends AbstractCompiler -{ - protected static Log log = - LogFactory.getLog(Jikes.class.getName()); - - static final int OUTPUT_BUFFER_SIZE = 1024; - static final int BUFFER_SIZE = 512; - - private class StreamPumper extends Thread { - - private BufferedInputStream stream; - private boolean endOfStream = false; - private boolean stopSignal = false; - private int SLEEP_TIME = 5; - private OutputStream out; - - public StreamPumper(BufferedInputStream is, OutputStream out) { - this.stream = is; - this.out = out; - } - - public void pumpStream() throws IOException { - byte[] buf = new byte[BUFFER_SIZE]; - if (!endOfStream) { - int bytesRead = stream.read(buf, 0, BUFFER_SIZE); - - if (bytesRead > 0) { - out.write(buf, 0, bytesRead); - } else if (bytesRead == -1) { - endOfStream = true; - } - } - } - - public void run() { - try { - while (!endOfStream) { - pumpStream(); - sleep(SLEEP_TIME); - } - } catch (Exception e) { - // getLogger().warn("Jikes.run()", e); - } - } - } - - /** - * Copy arguments to a string array - * - * @param arguments The compiler arguments - * @return A string array containing compilation arguments - */ - protected String[] toStringArray(List arguments) { - int i; - - for (i = 0; i < arguments.size(); i++) { - String arg = (String) arguments.get(i); - if (arg.equals("-sourcepath")) { - // Remove -sourcepath option. Jikes does not understand that. - arguments.remove(i); - arguments.remove(i); - break; - } - } - - String[] args = new String[arguments.size() + fileList.size()]; - for (i = 0; i < arguments.size(); i++) { - args[i] = (String) arguments.get(i); - } - - for (int j=0; j < fileList.size(); i++,j++) { - args[i] = (String)fileList.get(j); - } - - return args; - } - - /** - * Execute the compiler - */ - public boolean compile() throws IOException { - - List args = new ArrayList(); - // command line name - args.add("jikes"); - // indicate Emacs output mode must be used - args.add("+E"); - // avoid warnings - // Option nowarn with one hyphen only - args.add("-nowarn"); - - int exitValue; - ByteArrayOutputStream tmpErr = new ByteArrayOutputStream(OUTPUT_BUFFER_SIZE); - - try { - Process p = Runtime.getRuntime().exec(toStringArray(fillArguments(args))); - - BufferedInputStream compilerErr = new BufferedInputStream(p.getErrorStream()); - - StreamPumper errPumper = new StreamPumper(compilerErr, tmpErr); - - errPumper.start(); - - p.waitFor(); - exitValue = p.exitValue(); - - // Wait until the complete error stream has been read - errPumper.join(); - compilerErr.close(); - - p.destroy(); - - tmpErr.close(); - this.errors = new ByteArrayInputStream(tmpErr.toByteArray()); - - } catch (InterruptedException somethingHappened) { - log.debug("Jikes.compile():SomethingHappened", somethingHappened); - return false; - } - - // Jikes returns 0 even when there are some types of errors. - // Check if any error output as well - // Return should be OK when both exitValue and - // tmpErr.size() are 0 ?! - return ((exitValue == 0) && (tmpErr.size() == 0)); - } - - /** - * Parse the compiler error stream to produce a list of - * CompilerErrors - * - * @param input The error stream - * @return The list of compiler error messages - * @exception IOException If an error occurs during message collection - */ - protected List parseStream(BufferedReader input) throws IOException { - List errors = null; - String line = null; - StringBuffer buffer = null; - - while (true) { - // cleanup the buffer - buffer = new StringBuffer(); // this is faster than clearing it - - // first line is not space-starting - if (line == null) line = input.readLine(); - if (line == null) return errors; - log.debug(line); - buffer.append(line); - - // all other space-starting lines are one error - while (true) { - line = input.readLine(); - // EOF - if (line == null) - break; - // Continuation of previous error starts with ' ' - if (line.length() > 0 && line.charAt(0) != ' ') - break; - log.debug(line); - buffer.append('\n'); - buffer.append(line); - } - - // if error is found create the vector - if (errors == null) errors = new ArrayList(); - - // add the error bean - errors.add(parseError(buffer.toString())); - } - } - - /** - * Parse an individual compiler error message - * - * @param error The error text - * @return A mssaged CompilerError - */ - private CompilerError parseError(String error) { - StringTokenizer tokens = new StringTokenizer(error, ":"); - String file = tokens.nextToken(); - if (file.length() == 1) file = new StringBuffer(file).append(":").append(tokens.nextToken()).toString(); - StringBuffer message = new StringBuffer(); - String type = ""; - int startline = 0; - int startcolumn = 0; - int endline = 0; - int endcolumn = 0; - - try { - startline = Integer.parseInt(tokens.nextToken()); - startcolumn = Integer.parseInt(tokens.nextToken()); - endline = Integer.parseInt(tokens.nextToken()); - endcolumn = Integer.parseInt(tokens.nextToken()); - } catch (Exception e) { - // FIXME: VG: This is not needed anymore? - message.append(Messages.getMessage("compilerFail00")); - type="error"; - log.error(Messages.getMessage("compilerFail00"), e); - } - - if ("".equals(message)) { - type = tokens.nextToken().trim().toLowerCase(); - message.append(tokens.nextToken("\n").substring(1).trim()); - - while (tokens.hasMoreTokens()) - message.append("\n").append(tokens.nextToken()); - } - - return new CompilerError(file, type.equals("error"), startline, startcolumn, endline, endcolumn, message.toString()); - } - - public String toString() { - return Messages.getMessage("ibmJikes"); - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIO.java b/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIO.java deleted file mode 100644 index e76b3b7151..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIO.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.image; - -import java.awt.*; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * This interface defines a ImageIO modules functionality - * @author Davanum Srinivas - * @since 2.0 - */ -public interface ImageIO { - /** - * Save an image. - * @param id the mime-type of the format to save the image - * @param image the image to save - * @param os the output stream to write to - * @exception Exception if an error prevents image encoding - */ - - public void saveImage(String id, Image image, OutputStream os) - throws Exception; - - /** - * Load an Image. - * @param in the stream to load the image - * @return the Image - */ - public Image loadImage(InputStream in) - throws Exception; -} - diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIOFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIOFactory.java deleted file mode 100644 index 212b726c64..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/image/ImageIOFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.image; - -import org.apache.axis.AxisProperties; -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.utils.ClassUtils; -import org.apache.commons.logging.Log; - -/** - * This class implements a factory to instantiate an ImageIO component. - * @author Davanum Srinivas - * @since 2.0 - */ -public class ImageIOFactory { - protected static Log log = - LogFactory.getLog(ImageIOFactory.class.getName()); - - static { - AxisProperties.setClassOverrideProperty(ImageIO.class, "axis.ImageIO"); - - // If the imageIO is not configured look for the following: - // 1. Try the JDK 1.4 classes - // 2. Try the JIMI classes - // 3. If all else fails, try the JDK 1.3 classes - AxisProperties.setClassDefaults(ImageIO.class, - new String [] { - "org.apache.axis.components.image.MerlinIO", - "org.apache.axis.components.image.JimiIO", - "org.apache.axis.components.image.JDK13IO", - }); - } - - /** - * Get the ImageIO implementation. This method follows a precedence: - * 1. Use the class defined by the System property axis.ImageIO. - * 2. If that isn't set, try instantiating MerlinIO, the JDK 1.4 ImageIO implementation. - * 3. If that fails try JimiIO, the JIMI ImageIO implementation. - * 4. If that fails, instantiate the limited JDK13IO implementation. - */ - public static ImageIO getImageIO() { - ImageIO imageIO = (ImageIO)AxisProperties.newInstance(ImageIO.class); - - /** - * This shouldn't be needed, but seems to be a common feel-good: - */ - if (imageIO == null) { - try { - Class cls = ClassUtils.forName("org.apache.axis.components.image.JDK13IO"); - imageIO = (ImageIO)cls.newInstance(); - } catch (Exception e) { - log.debug("ImageIOFactory: No matching ImageIO found",e); - } - } - - log.debug("axis.ImageIO: " + imageIO.getClass().getName()); - return imageIO; - } -} - diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/image/JDK13IO.java b/axis-rt-core/src/main/java/org/apache/axis/components/image/JDK13IO.java deleted file mode 100644 index 5572ee82b0..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/image/JDK13IO.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.image; - -import org.apache.axis.utils.Messages; -import org.apache.axis.utils.IOUtils; -import sun.awt.image.codec.JPEGImageEncoderImpl; - -import java.awt.Component; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.MediaTracker; -import java.awt.Toolkit; -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * JDK1.3 based Image I/O - * - * @author Russell Butek - */ -public class JDK13IO extends Component implements ImageIO { - /** - * Save an image. - * @param mimeType the mime-type of the format to save the image - * @param image the image to save - * @param os the stream to write to - * @exception Exception if an error prevents image encoding - */ - public void saveImage(String mimeType, Image image, OutputStream os) - throws Exception { - - BufferedImage rendImage = null; - - // Create a BufferedImage - if (image instanceof BufferedImage) { - rendImage = (BufferedImage) image; - } else { - MediaTracker tracker = new MediaTracker(this); - tracker.addImage(image, 0); - tracker.waitForAll(); - rendImage = new BufferedImage(image.getWidth(null), image.getHeight(null), 1); - Graphics g = rendImage.createGraphics(); - g.drawImage(image, 0, 0, null); - } - - // Write the image to the output stream - if ("image/jpeg".equals(mimeType)) { - JPEGImageEncoderImpl j = new JPEGImageEncoderImpl(os); - j.encode(rendImage); - } - else { - throw new IOException(Messages.getMessage("jpegOnly", mimeType)); - } - } // saveImage - - /** - * Load an Image. - * @param in the stream to load the image - * @return the Image - */ - public Image loadImage(InputStream in) throws Exception { - if (in.available() <= 0) { - return null; - } - else { - byte[] bytes = new byte[in.available()]; - IOUtils.readFully(in,bytes); - return Toolkit.getDefaultToolkit().createImage(bytes); - } - } // loadImage -} - diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/image/JimiIO.java b/axis-rt-core/src/main/java/org/apache/axis/components/image/JimiIO.java deleted file mode 100644 index 9302f98b15..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/image/JimiIO.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.image; - -import com.sun.jimi.core.Jimi; - -import java.awt.*; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * JIMI based Image I/O - * @author Davanum Srinivas - * @since 2.0 - */ -public class JimiIO implements ImageIO { - /** - * Save an image. - * @param id the mime-type of the format to save the image - * @param image the image to save - * @param filename the file to write to - * @exception JimiException if an error prevents image encoding - */ - - public void saveImage(String id, Image image, OutputStream os) - throws Exception { - Jimi.putImage(id, image, os); - } - - /** - * Load an Image. - * @param in the stream to load the image - * @return the Image - */ - public Image loadImage(InputStream in) throws Exception { - return Jimi.getImage(in); - } -} - diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/image/MerlinIO.java b/axis-rt-core/src/main/java/org/apache/axis/components/image/MerlinIO.java deleted file mode 100644 index a0a883045a..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/image/MerlinIO.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.image; - -import javax.imageio.IIOImage; -import javax.imageio.ImageWriter; -import java.awt.*; -import java.awt.image.BufferedImage; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Iterator; - -/** - * JDK1.4 based Image I/O - * - * NOTE: NEEDS WORK!!!! NEEDS TO BE TESTED. - * - * @author Davanum Srinivas - * @since 2.0 - */ -public class MerlinIO extends Component implements ImageIO { - /** - * Save an image. - * @param mimeType the mime-type of the format to save the image - * @param image the image to save - * @param os the stream to write to - * @exception JimiException if an error prevents image encoding - */ - public void saveImage(String mimeType, Image image, OutputStream os) - throws Exception { - ImageWriter writer = null; - Iterator iter = javax.imageio.ImageIO.getImageWritersByMIMEType(mimeType); - if (iter.hasNext()) { - writer = (ImageWriter) iter.next(); - } - writer.setOutput(javax.imageio.ImageIO.createImageOutputStream(os)); - BufferedImage rendImage = null; - if (image instanceof BufferedImage) { - rendImage = (BufferedImage) image; - } else { - MediaTracker tracker = new MediaTracker(this); - tracker.addImage(image, 0); - tracker.waitForAll(); - rendImage = new BufferedImage(image.getWidth(null), image.getHeight(null), 1); - Graphics g = rendImage.createGraphics(); - g.drawImage(image, 0, 0, null); - } - writer.write(new IIOImage(rendImage, null, null)); - writer.dispose(); - } - - /** - * Load an Image. - * @param in the stream to load the image - * @return the Image - */ - public Image loadImage(InputStream in) throws Exception { - return javax.imageio.ImageIO.read(in); - } -} - diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPSTransportClientProperties.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPSTransportClientProperties.java index bcd6d6a06a..9c03eb8359 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPSTransportClientProperties.java +++ b/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPSTransportClientProperties.java @@ -47,7 +47,7 @@ public String getNonProxyHosts() { } /** - * @see org.apache.axis.components.net.TransportClientProperties#getPort() + * @see org.apache.axis.components.net.TransportClientProperties#getProxyPort() */ public String getProxyPort() { if (proxyPort == null) { @@ -58,7 +58,7 @@ public String getProxyPort() { } /** - * @see org.apache.axis.components.net.TransportClientProperties#getUser() + * @see org.apache.axis.components.net.TransportClientProperties#getProxyUser() */ public String getProxyUser() { if (proxyUser == null) { @@ -69,7 +69,7 @@ public String getProxyUser() { } /** - * @see org.apache.axis.components.net.TransportClientProperties#getPassword() + * @see org.apache.axis.components.net.TransportClientProperties#getProxyPassword() */ public String getProxyPassword() { if (proxyPassword == null) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPTransportClientProperties.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPTransportClientProperties.java index 45310bc1c1..44784bd1b9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPTransportClientProperties.java +++ b/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultHTTPTransportClientProperties.java @@ -58,7 +58,7 @@ public String getNonProxyHosts() { } /** - * @see org.apache.axis.components.net.TransportClientProperties#getPort() + * @see org.apache.axis.components.net.TransportClientProperties#getProxyPort() */ public String getProxyPort() { if (proxyPort == null) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMFakeTrustSocketFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMFakeTrustSocketFactory.java deleted file mode 100644 index b52de77676..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMFakeTrustSocketFactory.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.axis.components.net; - -import com.ibm.net.ssl.SSLContext; -import com.ibm.net.ssl.TrustManager; -import com.ibm.net.ssl.X509TrustManager; -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.utils.Messages; -import org.apache.commons.logging.Log; - -import java.util.Hashtable; - -/** - * Hook for Axis sender, allowing unsigned server certs - */ -public class IBMFakeTrustSocketFactory extends IBMJSSESocketFactory { - - /** Field log */ - protected static Log log = - LogFactory.getLog(IBMFakeTrustSocketFactory.class.getName()); - - /** - * Constructor FakeTrustSocketFactory - * - * @param attributes - */ - public IBMFakeTrustSocketFactory(Hashtable attributes) { - super(attributes); - } - - /** - * Method getContext - * - * @return - * - * @throws Exception - */ - protected SSLContext getContext() throws Exception { - - try { - SSLContext sc = SSLContext.getInstance("SSL"); - - sc.init(null, // we don't need no stinkin KeyManager - new TrustManager[]{new FakeX509TrustManager()}, - new java.security.SecureRandom()); - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("ftsf00")); - } - return sc; - } catch (Exception exc) { - log.error(Messages.getMessage("ftsf01"), exc); - throw new Exception(Messages.getMessage("ftsf02")); - } - } - - /** - * Class FakeX509TrustManager - */ - public static class FakeX509TrustManager implements X509TrustManager { - - /** Field log */ - protected static Log log = - LogFactory.getLog(FakeX509TrustManager.class.getName()); - - /** - * Method isClientTrusted - * - * @param chain - * - * @return - */ - public boolean isClientTrusted(java.security.cert - .X509Certificate[] chain) { - - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("ftsf03")); - } - return true; - } - - /** - * Method isServerTrusted - * - * @param chain - * - * @return - */ - public boolean isServerTrusted(java.security.cert - .X509Certificate[] chain) { - - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("ftsf04")); - } - return true; - } - - /** - * Method getAcceptedIssuers - * - * @return - */ - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("ftsf05")); - } - return null; - } - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMJSSESocketFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMJSSESocketFactory.java deleted file mode 100644 index 264de0cd44..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/IBMJSSESocketFactory.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.axis.components.net; - -import com.ibm.jsse.JSSEProvider; -import com.ibm.net.ssl.KeyManagerFactory; -import com.ibm.net.ssl.SSLContext; -import com.ibm.net.ssl.TrustManager; -import com.ibm.net.ssl.TrustManagerFactory; -import org.apache.axis.utils.Messages; -import org.apache.axis.utils.XMLUtils; - -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import java.io.BufferedWriter; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.Socket; -import java.security.KeyStore; -import java.security.Security; -import java.util.Hashtable; - -/** - * SSL socket factory. It _requires_ a valid RSA key and - * JSSE. (borrowed code from tomcat) - * - * @author Davanum Srinivas (dims@yahoo.com) - */ -public class IBMJSSESocketFactory extends JSSESocketFactory implements SecureSocketFactory { - - /** Field keystoreType */ - private String keystoreType; - - /** Field defaultKeystoreType */ - static String defaultKeystoreType = "JKS"; - - /** Field defaultProtocol */ - static String defaultProtocol = "TLS"; - - /** Field defaultAlgorithm */ - static String defaultAlgorithm = "IbmX509"; - - /** Field defaultClientAuth */ - static boolean defaultClientAuth = false; - - /** Field clientAuth */ - private boolean clientAuth = false; - - /** Field defaultKeystoreFile */ - static String defaultKeystoreFile = - System.getProperty("user.home") + "/.keystore"; - - /** Field defaultKeyPass */ - static String defaultKeyPass = "changeit"; - - /** - * Constructor IBMJSSESocketFactory - * - * @param attributes - */ - public IBMJSSESocketFactory(Hashtable attributes) { - super(attributes); - } - - /** - * Read the keystore, init the SSL socket factory - * - * @throws IOException - */ - protected void initFactory() throws IOException { - - try { - Security.addProvider(new com.ibm.jsse.JSSEProvider()); - Security.addProvider(new com.ibm.crypto.provider.IBMJCE()); - - if(attributes == null) { - //No configuration specified. Get the default. - sslFactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); - } else { - //Configuration specified in wsdd. - SSLContext context = getContext(); - sslFactory = context.getSocketFactory(); - } - } catch (Exception e) { - if (e instanceof IOException) { - throw (IOException) e; - } - throw new IOException(e.getMessage()); - } - } - - /** - * gets a SSL Context - * - * @return SSLContext - * @throws Exception - */ - protected SSLContext getContext() throws Exception { - // Please don't change the name of the attribute - other - // software may depend on it ( j2ee for sure ) - String keystoreFile = (String) attributes.get("keystore"); - if (keystoreFile == null) { - keystoreFile = defaultKeystoreFile; - } - - keystoreType = (String) attributes.get("keystoreType"); - if (keystoreType == null) { - keystoreType = defaultKeystoreType; - } - - // determine whether we want client authentication - // the presence of the attribute enables client auth - clientAuth = null != (String) attributes.get("clientauth"); - String keyPass = (String) attributes.get("keypass"); - if (keyPass == null) { - keyPass = defaultKeyPass; - } - - String keystorePass = (String) attributes.get("keystorePass"); - if (keystorePass == null) { - keystorePass = keyPass; - } - - // protocol for the SSL ie - TLS, SSL v3 etc. - String protocol = (String) attributes.get("protocol"); - if (protocol == null) { - protocol = defaultProtocol; - } - - // Algorithm used to encode the certificate ie - SunX509 - String algorithm = (String) attributes.get("algorithm"); - if (algorithm == null) { - algorithm = defaultAlgorithm; - } - - // You can't use ssl without a server certificate. - // Create a KeyStore ( to get server certs ) - KeyStore kstore = initKeyStore(keystoreFile, keystorePass); - - // Key manager will extract the server key - KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); - - kmf.init(kstore, keyPass.toCharArray()); - - // If client authentication is needed, set up TrustManager - TrustManager[] tm = null; - - if (clientAuth) { - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - - tmf.init(kstore); - tm = tmf.getTrustManagers(); - } - - // Create a SSLContext ( to create the ssl factory ) - // This is the only way to use server sockets with JSSE 1.0.1 - SSLContext context = SSLContext.getInstance(protocol); // SSL - - // init context with the key managers - context.init(kmf.getKeyManagers(), tm, - new java.security.SecureRandom()); - return context; - } - - /** - * intializes a keystore. - * - * @param keystoreFile - * @param keyPass - * - * @return keystore - * @throws IOException - */ - private KeyStore initKeyStore(String keystoreFile, String keyPass) - throws IOException { - try { - KeyStore kstore = KeyStore.getInstance(keystoreType); - - InputStream istream = new FileInputStream(keystoreFile); - kstore.load(istream, keyPass.toCharArray()); - return kstore; - } catch (FileNotFoundException fnfe) { - throw fnfe; - } catch (IOException ioe) { - throw ioe; - } catch (Exception ex) { - ex.printStackTrace(); - throw new IOException("Exception trying to load keystore " - + keystoreFile + ": " + ex.getMessage()); - } - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/JSSESocketFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/JSSESocketFactory.java index dd3f991fb5..abffcdd06f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/JSSESocketFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/components/net/JSSESocketFactory.java @@ -15,12 +15,6 @@ */ package org.apache.axis.components.net; -import org.apache.axis.utils.Messages; -import org.apache.axis.utils.XMLUtils; -import org.apache.axis.utils.StringUtils; - -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; @@ -28,7 +22,33 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.Socket; +import java.security.cert.Certificate; +import java.security.cert.CertificateParsingException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Hashtable; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.regex.Pattern; + +import javax.naming.InvalidNameException; +import javax.naming.NamingException; +import javax.naming.directory.Attribute; +import javax.naming.directory.Attributes; +import javax.naming.ldap.LdapName; +import javax.naming.ldap.Rdn; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; + +import org.apache.axis.utils.Messages; +import org.apache.axis.utils.StringUtils; +import org.apache.axis.utils.XMLUtils; /** @@ -41,6 +61,10 @@ */ public class JSSESocketFactory extends DefaultSocketFactory implements SecureSocketFactory { + // This is a a sorted list, if you insert new elements do it orderdered. + private final static String[] BAD_COUNTRY_2LDS = + {"ac", "co", "com", "ed", "edu", "go", "gouv", "gov", "info", + "lg", "ne", "net", "or", "org"}; /** Field sslFactory */ protected SSLSocketFactory sslFactory = null; @@ -187,6 +211,279 @@ public Socket create( if (log.isDebugEnabled()) { log.debug(Messages.getMessage("createdSSL00")); } + verifyHostName(host, (SSLSocket) sslSocket); return sslSocket; } + /** + * Verifies that the given hostname in certicifate is the hostname we are trying to connect to. + * This resolves CVE-2012-5784 and CVE-2014-3596 + * @param host + * @param ssl + * @throws IOException + */ + + private static void verifyHostName(String host, SSLSocket ssl) + throws IOException { + if (host == null) { + throw new IllegalArgumentException("host to verify was null"); + } + + SSLSession session = ssl.getSession(); + if (session == null) { + // In our experience this only happens under IBM 1.4.x when + // spurious (unrelated) certificates show up in the server's chain. + // Hopefully this will unearth the real problem: + InputStream in = ssl.getInputStream(); + in.available(); + /* + If you're looking at the 2 lines of code above because you're + running into a problem, you probably have two options: + + #1. Clean up the certificate chain that your server + is presenting (e.g. edit "/etc/apache2/server.crt" or + wherever it is your server's certificate chain is + defined). + + OR + + #2. Upgrade to an IBM 1.5.x or greater JVM, or switch to a + non-IBM JVM. + */ + + // If ssl.getInputStream().available() didn't cause an exception, + // maybe at least now the session is available? + session = ssl.getSession(); + if (session == null) { + // If it's still null, probably a startHandshake() will + // unearth the real problem. + ssl.startHandshake(); + + // Okay, if we still haven't managed to cause an exception, + // might as well go for the NPE. Or maybe we're okay now? + session = ssl.getSession(); + } + } + + Certificate[] certs = session.getPeerCertificates(); + verifyHostName(host.trim().toLowerCase(Locale.US), (X509Certificate) certs[0]); + } + /** + * Extract the names from the certificate and tests host matches one of them + * @param host + * @param cert + * @throws SSLException + */ + + private static void verifyHostName(final String host, X509Certificate cert) + throws SSLException { + // I'm okay with being case-insensitive when comparing the host we used + // to establish the socket to the hostname in the certificate. + // Don't trim the CN, though. + + String[] cns = getCNs(cert); + String[] subjectAlts = getDNSSubjectAlts(cert); + verifyHostName(host, cns, subjectAlts); + + } + + /** + * Extract all alternative names from a certificate. + * @param cert + * @return + */ + private static String[] getDNSSubjectAlts(X509Certificate cert) { + LinkedList subjectAltList = new LinkedList(); + Collection c = null; + try { + c = cert.getSubjectAlternativeNames(); + } catch (CertificateParsingException cpe) { + // Should probably log.debug() this? + cpe.printStackTrace(); + } + if (c != null) { + Iterator it = c.iterator(); + while (it.hasNext()) { + List list = (List) it.next(); + int type = ((Integer) list.get(0)).intValue(); + // If type is 2, then we've got a dNSName + if (type == 2) { + String s = (String) list.get(1); + subjectAltList.add(s); + } + } + } + if (!subjectAltList.isEmpty()) { + String[] subjectAlts = new String[subjectAltList.size()]; + subjectAltList.toArray(subjectAlts); + return subjectAlts; + } else { + return new String[0]; + } + + } + /** + * Verifies + * @param host + * @param cn + * @param subjectAlts + * @throws SSLException + */ + + private static void verifyHostName(final String host, String[] cns, String[] subjectAlts)throws SSLException{ + StringBuffer cnTested = new StringBuffer(); + + for (int i = 0; i < subjectAlts.length; i++){ + String name = subjectAlts[i]; + if (name != null) { + name = name.toLowerCase(Locale.US); + if (verifyHostName(host, name)){ + return; + } + cnTested.append("/").append(name); + } + } + for (int i = 0; i < cns.length; i++) { + String cn = cns[i]; + if (cn != null) { + cn = cn.toLowerCase(Locale.US); + if (verifyHostName(host, cn)) { + return; + } + cnTested.append("/").append(cn); + } + } + throw new SSLException("hostname in certificate didn't match: <" + + host + "> != <" + cnTested + ">"); + } + + private static boolean verifyHostName(final String host, final String cn){ + if (doWildCard(cn) && !isIPAddress(host)) { + return matchesWildCard(cn, host); + } + return host.equalsIgnoreCase(cn); + } + private static boolean doWildCard(String cn) { + // Contains a wildcard + // wildcard in the first block + // not an ipaddress (ip addres must explicitily be equal) + // not using 2nd level common tld : ex: not for *.co.uk + String parts[] = cn.split("\\."); + return parts.length >= 3 && + parts[0].endsWith("*") && + acceptableCountryWildcard(cn) && + !isIPAddress(cn); + } + + private static final Pattern IPV4_PATTERN = + Pattern.compile("^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$"); + + private static final Pattern IPV6_STD_PATTERN = + Pattern.compile("^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$"); + + private static final Pattern IPV6_HEX_COMPRESSED_PATTERN = + Pattern.compile("^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$"); + + + private static boolean isIPAddress(final String hostname) { + return hostname != null + && ( + IPV4_PATTERN.matcher(hostname).matches() + || IPV6_STD_PATTERN.matcher(hostname).matches() + || IPV6_HEX_COMPRESSED_PATTERN.matcher(hostname).matches() + ); + + } + + private static boolean acceptableCountryWildcard(final String cn) { + // The CN better have at least two dots if it wants wildcard action, + // but can't be [*.co.uk] or [*.co.jp] or [*.org.uk], etc... + // The [*.co.uk] problem is an interesting one. Should we just + // hope that CA's would never foolishly allow such a + // certificate to happen? + + String[] parts = cn.split("\\."); + // Only checks for 3 levels, with country code of 2 letters. + if (parts.length > 3 || parts[parts.length - 1].length() != 2) { + return true; + } + String countryCode = parts[parts.length - 2]; + return Arrays.binarySearch(BAD_COUNTRY_2LDS, countryCode) < 0; + } + + private static boolean matchesWildCard(final String cn, + final String hostName) { + String parts[] = cn.split("\\."); + boolean match = false; + String firstpart = parts[0]; + if (firstpart.length() > 1) { + // server∗ + // e.g. server + String prefix = firstpart.substring(0, firstpart.length() - 1); + // skipwildcard part from cn + String suffix = cn.substring(firstpart.length()); + // skip wildcard part from host + String hostSuffix = hostName.substring(prefix.length()); + match = hostName.startsWith(prefix) && hostSuffix.endsWith(suffix); + } else { + match = hostName.endsWith(cn.substring(1)); + } + if (match) { + // I f we ’ r e i n s t r i c t mode , + // [ ∗.foo.com] is not allowed to match [a.b.foo.com] + match = countDots(hostName) == countDots(cn); + } + return match; + } + + private static int countDots(final String data) { + int dots = 0; + for (int i = 0; i < data.length(); i++) { + if (data.charAt(i) == '.') { + dots += 1; + } + } + return dots; + } + + + private static String[] getCNs(X509Certificate cert) { + // Note: toString() seems to do a better job than getName() + // + // For example, getName() gives me this: + // 1.2.840.113549.1.9.1=#16166a756c6975736461766965734063756362632e636f6d + // + // whereas toString() gives me this: + // EMAILADDRESS=juliusdavies@cucbc.com + String subjectPrincipal = cert.getSubjectX500Principal().toString(); + + return getCNs(subjectPrincipal); + + } + private static String[] getCNs(String subjectPrincipal) { + if (subjectPrincipal == null) { + return null; + } + final List cns = new ArrayList(); + try { + final LdapName subjectDN = new LdapName(subjectPrincipal); + final List rdns = subjectDN.getRdns(); + for (int i = rdns.size() - 1; i >= 0; i--) { + final Rdn rds = (Rdn) rdns.get(i); + final Attributes attributes = rds.toAttributes(); + final Attribute cn = attributes.get("cn"); + if (cn != null) { + try { + final Object value = cn.get(); + if (value != null) { + cns.add(value.toString()); + } + } + catch (NamingException ignore) {} + } + } + } + catch (InvalidNameException ignore) { } + return cns.isEmpty() ? null : (String[]) cns.toArray(new String[ cns.size() ]); + } + } diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/SecureSocketFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/SecureSocketFactory.java index d90e38ffa3..d91fd886d8 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/SecureSocketFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/components/net/SecureSocketFactory.java @@ -19,7 +19,7 @@ /** * Secure Socket factory. * This has a separate interface to allow discovery (by interface) - * and runtime distinction to be made between Socket & SecureSockets. + * and runtime distinction to be made between Socket & SecureSockets. * * @author Richard A. Sitze * @author Davanum Srinivas (dims@yahoo.com) diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/SocketFactoryFactory.java b/axis-rt-core/src/main/java/org/apache/axis/components/net/SocketFactoryFactory.java index 9de2796fe8..0d50f73472 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/SocketFactoryFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/components/net/SocketFactoryFactory.java @@ -56,7 +56,7 @@ public class SocketFactoryFactory { /** * Returns a copy of the environment's default socket factory. * - * @param protocol Today this only supports "http" & "https". + * @param protocol Today this only supports "http" & "https". * @param attributes * * @return diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/DefaultConfiguration.java b/axis-rt-core/src/main/java/org/apache/axis/configuration/DefaultConfiguration.java new file mode 100644 index 0000000000..dffa3a0230 --- /dev/null +++ b/axis-rt-core/src/main/java/org/apache/axis/configuration/DefaultConfiguration.java @@ -0,0 +1,158 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.configuration; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Enumeration; + +import org.apache.axis.AxisEngine; +import org.apache.axis.ConfigurationException; +import org.apache.axis.components.logger.LogFactory; +import org.apache.axis.deployment.wsdd.WSDDDeployment; +import org.apache.axis.deployment.wsdd.WSDDDocument; +import org.apache.axis.utils.XMLUtils; +import org.apache.commons.logging.Log; + +/** + * Configuration provider that loads the default Axis configuration. It first loads the + * org/apache/axis/<type>/<type>-config.wsdd resource and then searches for resources + * with name META-INF/axis/default-<type>-config.wsdd. All the discovered WSDD documents + * are merged into a single configuration. <type> identifies the engine type for which + * the configuration is to be built; it is either client or server. + *

    + * This class looks up the resources using the thread context class loader, except if it determines + * that the context class loader is not set correctly, in which case it falls back to the class + * loader that loaded the {@link DefaultConfiguration} class. To determine if the context class + * loader is set correctly, the code checks that the {@link DefaultConfiguration} class is visible + * to the context class loader. + *

    + * The algorithm implemented by this class is designed to support the modularized artifacts + * introduced in Axis 1.4.1. It allows individual JARs to contribute items (transports, handlers, + * etc.) to the default configuration. The naming convention for the base configuration file + * (org/apache/axis/<type>/<type>-config.wsdd) was chosen for consistency with Axis + * 1.4, while META-INF/axis/default-<type>-config.wsdd is new in Axis 1.4.1. + *

    + * {@link DefaultConfiguration} is also used by {@link FileProvider} to build the configuration if + * no existing configuration file is found. + * + * @author Andreas Veithen + */ +public class DefaultConfiguration extends DelegatingWSDDEngineConfiguration { + private static final Log log = LogFactory.getLog(DefaultConfiguration.class.getName()); + + private final String type; + private WSDDDeployment deployment; + + /** + * Constructor. + * + * @param type + * the engine type to load the default configuration for; this should be + * client or server (although any value is supported) + */ + public DefaultConfiguration(String type) { + this.type = type; + } + + public void configureEngine(AxisEngine engine) throws ConfigurationException { + ClassLoader classLoader; + try { + classLoader = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + // We can only get a SecurityException if "the caller's class loader is not the same as + // or an ancestor of the context class loader". In this case we are not interested in + // the class loader anyway. + classLoader = null; + } + if (classLoader != null) { + // Check if we are visible to the thread context class loader. If this is not the case, + // then the context class loader is likely not set correctly and we ignore it. + try { + classLoader.loadClass(DefaultConfiguration.class.getName()); + } catch (ClassNotFoundException ex) { + log.debug(DefaultConfiguration.class.getName() + " not visible to thread context class loader"); + classLoader = null; + } + } + if (classLoader == null) { + log.debug("Not using thread context class loader"); + classLoader = DefaultConfiguration.class.getClassLoader(); + } else { + log.debug("Using thread context class loader"); + } + + // Load the base configuration + String resourceName = "org/apache/axis/" + type + "/" + type + "-config.wsdd"; + if (log.isDebugEnabled()) { + log.debug("Loading resource " + resourceName); + } + InputStream in = classLoader.getResourceAsStream(resourceName); + if (in == null) { + throw new ConfigurationException("Resource " + resourceName + " not found"); + } + try { + try { + deployment = new WSDDDocument(XMLUtils.newDocument(in)).getDeployment(); + } finally { + in.close(); + } + } catch (Exception ex) { + // TODO: refactor ConfigurationException to support exception chaining + throw new ConfigurationException(/*"Failed to process resource " + baseConfigResource,*/ ex); + } + + // Discover and load additional default configuration fragments + resourceName = "META-INF/axis/default-" + type + "-config.wsdd"; + Enumeration resources; + try { + resources = classLoader.getResources(resourceName); + } catch (IOException ex) { + // TODO: refactor ConfigurationException to support exception chaining + throw new ConfigurationException(/*"Failed to discover resources with name " + resourceName,*/ ex); + } + while (resources.hasMoreElements()) { + URL url = (URL)resources.nextElement(); + if (log.isDebugEnabled()) { + log.debug("Loading " + url); + } + try { + in = url.openStream(); + try { + new WSDDDocument(XMLUtils.newDocument(in)).deploy(deployment); + } finally { + in.close(); + } + } catch (Exception ex) { + // TODO: refactor ConfigurationException to support exception chaining + throw new ConfigurationException(/*"Failed to process " + url,*/ ex); + } + } + deployment.configureEngine(engine); + } + + public WSDDDeployment getDeployment() { + return deployment; + } + + public void writeEngineConfig(AxisEngine engine) throws ConfigurationException { + // Default configuration is read-only + } +} diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/DelegatingWSDDEngineConfiguration.java b/axis-rt-core/src/main/java/org/apache/axis/configuration/DelegatingWSDDEngineConfiguration.java new file mode 100644 index 0000000000..a361238086 --- /dev/null +++ b/axis-rt-core/src/main/java/org/apache/axis/configuration/DelegatingWSDDEngineConfiguration.java @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.configuration; + +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; + +import javax.xml.namespace.QName; + +import org.apache.axis.ConfigurationException; +import org.apache.axis.Handler; +import org.apache.axis.WSDDEngineConfiguration; +import org.apache.axis.deployment.wsdd.WSDDDeployment; +import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration; +import org.apache.axis.encoding.TypeMappingRegistry; +import org.apache.axis.handlers.soap.SOAPService; +import org.apache.axis.utils.Messages; + +/** + * {@link WSDDEngineConfiguration} implementation that delegates to the {@link WSDDDeployment} + * returned by {@link WSDDEngineConfiguration#getDeployment()}. + */ +public abstract class DelegatingWSDDEngineConfiguration implements WSDDEngineConfiguration { + /** + * retrieve an instance of the named handler + * @param qname XXX + * @return XXX + * @throws ConfigurationException XXX + */ + public final Handler getHandler(QName qname) throws ConfigurationException { + return getDeployment().getHandler(qname); + } + + /** + * retrieve an instance of the named service + * @param qname XXX + * @return XXX + * @throws ConfigurationException XXX + */ + public final SOAPService getService(QName qname) throws ConfigurationException { + SOAPService service = getDeployment().getService(qname); + if (service == null) { + throw new ConfigurationException(Messages.getMessage("noService10", + qname.toString())); + } + return service; + } + + /** + * Get a service which has been mapped to a particular namespace + * + * @param namespace a namespace URI + * @return an instance of the appropriate Service, or null + */ + public final SOAPService getServiceByNamespaceURI(String namespace) + throws ConfigurationException { + return getDeployment().getServiceByNamespaceURI(namespace); + } + + /** + * retrieve an instance of the named transport + * @param qname XXX + * @return XXX + * @throws ConfigurationException XXX + */ + public final Handler getTransport(QName qname) throws ConfigurationException { + return getDeployment().getTransport(qname); + } + + public final TypeMappingRegistry getTypeMappingRegistry() + throws ConfigurationException { + return getDeployment().getTypeMappingRegistry(); + } + + /** + * Returns a global request handler. + */ + public final Handler getGlobalRequest() throws ConfigurationException { + return getDeployment().getGlobalRequest(); + } + + /** + * Returns a global response handler. + */ + public final Handler getGlobalResponse() throws ConfigurationException { + return getDeployment().getGlobalResponse(); + } + + /** + * Returns the global configuration options. + */ + public final Hashtable getGlobalOptions() throws ConfigurationException { + WSDDGlobalConfiguration globalConfig + = getDeployment().getGlobalConfiguration(); + + if (globalConfig != null) + return globalConfig.getParametersTable(); + + return null; + } + + /** + * Get an enumeration of the services deployed to this engine + */ + public final Iterator getDeployedServices() throws ConfigurationException { + return getDeployment().getDeployedServices(); + } + + /** + * Get a list of roles that this engine plays globally. Services + * within the engine configuration may also add additional roles. + * + * @return a List of the roles for this engine + */ + public final List getRoles() { + return getDeployment().getRoles(); + } +} diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/DirProvider.java b/axis-rt-core/src/main/java/org/apache/axis/configuration/DirProvider.java index 15772abc30..54cf4a8b09 100755 --- a/axis-rt-core/src/main/java/org/apache/axis/configuration/DirProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/configuration/DirProvider.java @@ -22,29 +22,19 @@ import java.io.FileFilter; import java.io.IOException; import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; import org.apache.axis.AxisEngine; import org.apache.axis.ConfigurationException; -import org.apache.axis.Handler; -import org.apache.axis.WSDDEngineConfiguration; import org.apache.axis.deployment.wsdd.WSDDDeployment; import org.apache.axis.deployment.wsdd.WSDDDocument; import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration; -import org.apache.axis.encoding.TypeMappingRegistry; -import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.utils.Messages; import org.apache.axis.utils.XMLUtils; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; -import org.w3c.dom.Document; - -public class DirProvider implements WSDDEngineConfiguration { +public class DirProvider extends DelegatingWSDDEngineConfiguration { protected static Log log = LogFactory.getLog(DirProvider.class.getName()); @@ -135,99 +125,4 @@ public void writeEngineConfig(AxisEngine engine) throws ConfigurationException { // this is not implemented } - - /** - * retrieve an instance of the named handler - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public Handler getHandler(QName qname) throws ConfigurationException { - return this.deployment.getHandler(qname); - } - - /** - * retrieve an instance of the named service - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public SOAPService getService(QName qname) throws ConfigurationException { - SOAPService service = this.deployment.getService(qname); - if (service == null) { - throw new ConfigurationException(Messages.getMessage("noService10", - qname.toString())); - } - return service; - } - - /** - * Get a service which has been mapped to a particular namespace - * - * @param namespace a namespace URI - * @return an instance of the appropriate Service, or null - */ - public SOAPService getServiceByNamespaceURI(String namespace) - throws ConfigurationException { - return this.deployment.getServiceByNamespaceURI(namespace); - } - - /** - * retrieve an instance of the named transport - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public Handler getTransport(QName qname) throws ConfigurationException { - return this.deployment.getTransport(qname); - } - - public TypeMappingRegistry getTypeMappingRegistry() - throws ConfigurationException { - return this.deployment.getTypeMappingRegistry(); - } - - /** - * Returns a global request handler. - */ - public Handler getGlobalRequest() throws ConfigurationException { - return this.deployment.getGlobalRequest(); - } - - /** - * Returns a global response handler. - */ - public Handler getGlobalResponse() throws ConfigurationException { - return this.deployment.getGlobalResponse(); - } - - /** - * Returns the global configuration options. - */ - public Hashtable getGlobalOptions() throws ConfigurationException { - WSDDGlobalConfiguration globalConfig - = this.deployment.getGlobalConfiguration(); - - if (globalConfig != null) - return globalConfig.getParametersTable(); - - return null; - } - - /** - * Get an enumeration of the services deployed to this engine - */ - public Iterator getDeployedServices() throws ConfigurationException { - return this.deployment.getDeployedServices(); - } - - /** - * Get a list of roles that this engine plays globally. Services - * within the engine configuration may also add additional roles. - * - * @return a List of the roles for this engine - */ - public List getRoles() { - return this.deployment.getRoles(); - } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/FileProvider.java b/axis-rt-core/src/main/java/org/apache/axis/configuration/FileProvider.java index 57354951aa..7d4559491e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/configuration/FileProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/configuration/FileProvider.java @@ -24,22 +24,12 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; import org.apache.axis.AxisEngine; import org.apache.axis.ConfigurationException; -import org.apache.axis.Handler; -import org.apache.axis.WSDDEngineConfiguration; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.deployment.wsdd.WSDDDeployment; import org.apache.axis.deployment.wsdd.WSDDDocument; -import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration; -import org.apache.axis.encoding.TypeMappingRegistry; -import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.utils.Admin; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.Messages; @@ -54,7 +44,7 @@ * @author Glen Daniels (gdaniels@apache.org) * @author Glyn Normington (glyn@apache.org) */ -public class FileProvider implements WSDDEngineConfiguration { +public class FileProvider extends DelegatingWSDDEngineConfiguration { protected static Log log = LogFactory.getLog(FileProvider.class.getName()); @@ -162,25 +152,44 @@ public void setSearchClasspath(boolean searchClasspath) { public void configureEngine(AxisEngine engine) throws ConfigurationException { try { - if (getInputStream() == null) { + InputStream configFileInputStream = getInputStream(); + if (configFileInputStream == null) { try { - setInputStream(new FileInputStream(configFile)); + configFileInputStream = new FileInputStream(configFile); } catch (Exception e) { - if (searchClasspath) - setInputStream(ClassUtils.getResourceAsStream(engine.getClass(), filename, true)); + // Ignore and continue } } - - if (getInputStream() == null) { - throw new ConfigurationException( - Messages.getMessage("noConfigFile")); + if (configFileInputStream == null && searchClasspath) { + // Attempt to load the file from the classpath + configFileInputStream = ClassUtils.getResourceAsStream(filename, engine.getClass().getClassLoader()); } - WSDDDocument doc = new WSDDDocument(XMLUtils. - newDocument(getInputStream())); - deployment = doc.getDeployment(); - - deployment.configureEngine(engine); + if (configFileInputStream == null) { + // Load the default configuration. This piece of code provides compatibility with Axis 1.4, + // which ends up loading org/apache/axis/(client|server)/(client|server)-config.wsdd if + // (1) filename is (client|server)-config.wsdd; + // (2) the runtime type of the engine is AxisClient or AxisServer; + // (3) the file is not found on the file system or in the classpath. + String type; + if (filename.equals(EngineConfigurationFactoryDefault.CLIENT_CONFIG_FILE)) { + type = "client"; + } else if (filename.equals(EngineConfigurationFactoryDefault.SERVER_CONFIG_FILE)) { + type = "server"; + } else { + throw new ConfigurationException( + Messages.getMessage("noConfigFile")); + } + DefaultConfiguration defaultConfig = new DefaultConfiguration(type); + defaultConfig.configureEngine(engine); + deployment = defaultConfig.getDeployment(); + } else { + WSDDDocument doc = new WSDDDocument(XMLUtils. + newDocument(configFileInputStream)); + deployment = doc.getDeployment(); + + deployment.configureEngine(engine); + } engine.refreshGlobalOptions(); setInputStream(null); @@ -210,99 +219,4 @@ public void writeEngineConfig(AxisEngine engine) } } } - - /** - * retrieve an instance of the named handler - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public Handler getHandler(QName qname) throws ConfigurationException { - return deployment.getHandler(qname); - } - - /** - * retrieve an instance of the named service - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public SOAPService getService(QName qname) throws ConfigurationException { - SOAPService service = deployment.getService(qname); - if (service == null) { - throw new ConfigurationException(Messages.getMessage("noService10", - qname.toString())); - } - return service; - } - - /** - * Get a service which has been mapped to a particular namespace - * - * @param namespace a namespace URI - * @return an instance of the appropriate Service, or null - */ - public SOAPService getServiceByNamespaceURI(String namespace) - throws ConfigurationException { - return deployment.getServiceByNamespaceURI(namespace); - } - - /** - * retrieve an instance of the named transport - * @param qname XXX - * @return XXX - * @throws ConfigurationException XXX - */ - public Handler getTransport(QName qname) throws ConfigurationException { - return deployment.getTransport(qname); - } - - public TypeMappingRegistry getTypeMappingRegistry() - throws ConfigurationException { - return deployment.getTypeMappingRegistry(); - } - - /** - * Returns a global request handler. - */ - public Handler getGlobalRequest() throws ConfigurationException { - return deployment.getGlobalRequest(); - } - - /** - * Returns a global response handler. - */ - public Handler getGlobalResponse() throws ConfigurationException { - return deployment.getGlobalResponse(); - } - - /** - * Returns the global configuration options. - */ - public Hashtable getGlobalOptions() throws ConfigurationException { - WSDDGlobalConfiguration globalConfig - = deployment.getGlobalConfiguration(); - - if (globalConfig != null) - return globalConfig.getParametersTable(); - - return null; - } - - /** - * Get an enumeration of the services deployed to this engine - */ - public Iterator getDeployedServices() throws ConfigurationException { - return deployment.getDeployedServices(); - } - - /** - * Get a list of roles that this engine plays globally. Services - * within the engine configuration may also add additional roles. - * - * @return a List of the roles for this engine - */ - public List getRoles() { - return deployment.getRoles(); - } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/configuration/XMLStringProvider.java b/axis-rt-core/src/main/java/org/apache/axis/configuration/XMLStringProvider.java index 6c0a33c91c..b30aa4b29c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/configuration/XMLStringProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/configuration/XMLStringProvider.java @@ -28,14 +28,14 @@ * This provider does not write configuration to persistent storage. * * Example of usage: - * new XMLStringProvider(""); + * ".MsgProvider\"/></handlers><services><service name=\"Adm" + + * "inService\" pivot=\"MsgDispatcher\"><option name=\"class" + + * "Name\" value=\"org.apache.axis.utils.Admin\"/><option na" + + * "me=\"allowedMethods\" value=\"AdminService\"/><option na" + + * "me=\"enableRemoteAdmin\" value=\"false\"/></service></se" + + * "rvices></engineConfig>"); * * @author Glen Daniels (gdaniels@apache.org) */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDArrayMapping.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDArrayMapping.java index 135de69717..7ce6289672 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDArrayMapping.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDArrayMapping.java @@ -21,6 +21,8 @@ import org.w3c.dom.Element; import org.xml.sax.helpers.AttributesImpl; import org.apache.axis.encoding.SerializationContext; +import org.apache.axis.encoding.SerializerFactory; +import org.apache.axis.encoding.ser.ArraySerializerFactory; import org.apache.axis.utils.XMLUtils; @@ -82,6 +84,12 @@ public void writeToContext(SerializationContext context) throws IOException { context.startElement(QNAME_ARRAYMAPPING, attrs); context.endElement(); } + + void setupSerializer(SerializerFactory ser) { + if (ser instanceof ArraySerializerFactory) { + ((ArraySerializerFactory)ser).setComponentType(getInnerType()); + } + } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDDeployment.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDDeployment.java index 89e4f497dc..f196120562 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDDeployment.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDDeployment.java @@ -21,15 +21,10 @@ import org.apache.axis.Handler; import org.apache.axis.WSDDEngineConfiguration; import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.encoding.DeserializerFactory; import org.apache.axis.encoding.SerializationContext; -import org.apache.axis.encoding.SerializerFactory; import org.apache.axis.encoding.TypeMapping; import org.apache.axis.encoding.TypeMappingRegistry; import org.apache.axis.encoding.TypeMappingRegistryImpl; -import org.apache.axis.encoding.ser.ArraySerializerFactory; -import org.apache.axis.encoding.ser.BaseDeserializerFactory; -import org.apache.axis.encoding.ser.BaseSerializerFactory; import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.utils.Messages; import org.apache.commons.logging.Log; @@ -62,7 +57,7 @@ public class WSDDDeployment private HashMap typeMappings = new HashMap(); private WSDDGlobalConfiguration globalConfig = null; /** - * Mapping of namespaces -> services + * Mapping of namespaces -> services */ private HashMap namespaceToServices = new HashMap(); private AxisEngine engine; @@ -264,53 +259,11 @@ public void deployToRegistry(WSDDDeployment target) private void deployMapping(WSDDTypeMapping mapping) throws WSDDException { - try { - String encodingStyle = mapping.getEncodingStyle(); - if (encodingStyle == null) { - encodingStyle = Constants.URI_DEFAULT_SOAP_ENC; - } - TypeMapping tm = tmr.getOrMakeTypeMapping(encodingStyle); - SerializerFactory ser = null; - DeserializerFactory deser = null; - // Try to construct a serializerFactory by introspecting for the - // following: - // public static create(Class javaType, QName xmlType) - // public (Class javaType, QName xmlType) - // public () - // - // The BaseSerializerFactory createFactory() method is a utility - // that does this for us. - //log.debug("start creating sf and df"); - if (mapping.getSerializerName() != null && - !mapping.getSerializerName().equals("")) { - ser = BaseSerializerFactory.createFactory(mapping.getSerializer(), - mapping.getLanguageSpecificType(), - mapping.getQName()); - } - - if ((mapping instanceof WSDDArrayMapping) && (ser instanceof ArraySerializerFactory)) { - WSDDArrayMapping am = (WSDDArrayMapping) mapping; - ArraySerializerFactory factory = (ArraySerializerFactory) ser; - factory.setComponentType(am.getInnerType()); - } - - //log.debug("set ser factory"); - - if (mapping.getDeserializerName() != null && - !mapping.getDeserializerName().equals("")) { - deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(), - mapping.getLanguageSpecificType(), - mapping.getQName()); - } - //log.debug("set dser factory"); - tm.register(mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser); - //log.debug("registered"); - } catch (ClassNotFoundException e) { - log.error(Messages.getMessage("unabletoDeployTypemapping00", mapping.getQName().toString()), e); - throw new WSDDNonFatalException(e); - } catch (Exception e) { - throw new WSDDException(e); + String encodingStyle = mapping.getEncodingStyle(); + if (encodingStyle == null) { + encodingStyle = Constants.URI_DEFAULT_SOAP_ENC; } + mapping.registerTo(tmr.getOrMakeTypeMapping(encodingStyle)); } public void writeToContext(SerializationContext context) @@ -523,7 +476,7 @@ public void registerNamespaceForService(String namespace, } /** - * Remove a namespace -> WSDDService mapping. + * Remove a namespace -> WSDDService mapping. * * @param namespace the namespace URI to unmap */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDOperation.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDOperation.java index be39d96359..db6b774d7e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDOperation.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDOperation.java @@ -35,9 +35,9 @@ * Parse the WSDD operation elements. * * Example: - * - * - * + * <operation name="name" qname="element QName" returnQName="QName"> + * <parameter ... /> + * </operation> * */ public class WSDDOperation extends WSDDElement @@ -55,7 +55,7 @@ public WSDDOperation(OperationDesc desc) { /** * Constructor from XML * - * @param e (Element) the element + * @param e (Element) the <operation> element * @param parent our ServiceDesc. * @throws WSDDException XXX */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDService.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDService.java index c770e1a7e1..372c50a991 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDService.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDService.java @@ -29,15 +29,10 @@ import org.apache.axis.constants.Use; import org.apache.axis.description.JavaServiceDesc; import org.apache.axis.description.ServiceDesc; -import org.apache.axis.encoding.DeserializerFactory; import org.apache.axis.encoding.SerializationContext; -import org.apache.axis.encoding.SerializerFactory; import org.apache.axis.encoding.TypeMapping; import org.apache.axis.encoding.TypeMappingRegistry; import org.apache.axis.encoding.TypeMappingRegistryImpl; -import org.apache.axis.encoding.ser.ArraySerializerFactory; -import org.apache.axis.encoding.ser.BaseDeserializerFactory; -import org.apache.axis.encoding.ser.BaseSerializerFactory; import org.apache.axis.handlers.HandlerInfoChainFactory; import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.providers.java.JavaProvider; @@ -515,53 +510,16 @@ public void deployTypeMapping(WSDDTypeMapping mapping) if (tmr == null) { createTMR(); } - try { - // Get the encoding style from the mapping, if it isn't set - // use the use of the service to map doc/lit or rpc/enc - String encodingStyle = mapping.getEncodingStyle(); - if (encodingStyle == null) { - encodingStyle = use.getEncoding(); - } - TypeMapping tm = tmr.getOrMakeTypeMapping(encodingStyle); - desc.setTypeMappingRegistry(tmr); - desc.setTypeMapping(tm); - - SerializerFactory ser = null; - DeserializerFactory deser = null; - - // Try to construct a serializerFactory by introspecting for the - // following: - // public static create(Class javaType, QName xmlType) - // public (Class javaType, QName xmlType) - // public () - // - // The BaseSerializerFactory createFactory() method is a utility - // that does this for us. - if (mapping.getSerializerName() != null && - !mapping.getSerializerName().equals("")) { - ser = BaseSerializerFactory.createFactory(mapping.getSerializer(), - mapping.getLanguageSpecificType(), - mapping.getQName()); - } - if (mapping instanceof WSDDArrayMapping && ser instanceof ArraySerializerFactory) { - WSDDArrayMapping am = (WSDDArrayMapping) mapping; - ArraySerializerFactory factory = (ArraySerializerFactory) ser; - factory.setComponentType(am.getInnerType()); - } - - if (mapping.getDeserializerName() != null && - !mapping.getDeserializerName().equals("")) { - deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(), - mapping.getLanguageSpecificType(), - mapping.getQName()); - } - tm.register( mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser); - } catch (ClassNotFoundException e) { - log.error(Messages.getMessage("unabletoDeployTypemapping00", mapping.getQName().toString()), e); - throw new WSDDNonFatalException(e); - } catch (Exception e) { - throw new WSDDException(e); + // Get the encoding style from the mapping, if it isn't set + // use the use of the service to map doc/lit or rpc/enc + String encodingStyle = mapping.getEncodingStyle(); + if (encodingStyle == null) { + encodingStyle = use.getEncoding(); } + TypeMapping tm = tmr.getOrMakeTypeMapping(encodingStyle); + desc.setTypeMappingRegistry(tmr); + desc.setTypeMapping(tm); + mapping.registerTo(tm); } /** diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java index 2730061783..30777300d8 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTargetedChain.java @@ -136,7 +136,6 @@ public void setPivotQName(QName pivotQName) { /** * - * @param pivot XXX * @param registry XXX * @return XXX * @throws ConfigurationException XXX diff --git a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java index e2d6af3bd3..4b314193cc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java +++ b/axis-rt-core/src/main/java/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java @@ -16,11 +16,18 @@ package org.apache.axis.deployment.wsdd; import org.apache.axis.Constants; +import org.apache.axis.components.logger.LogFactory; +import org.apache.axis.encoding.DeserializerFactory; import org.apache.axis.encoding.SerializationContext; +import org.apache.axis.encoding.SerializerFactory; +import org.apache.axis.encoding.TypeMapping; +import org.apache.axis.encoding.ser.BaseDeserializerFactory; +import org.apache.axis.encoding.ser.BaseSerializerFactory; import org.apache.axis.utils.ClassUtils; import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Messages; import org.apache.axis.utils.XMLUtils; +import org.apache.commons.logging.Log; import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.xml.sax.helpers.AttributesImpl; @@ -28,18 +35,18 @@ import javax.xml.namespace.QName; import java.io.IOException; - /** * */ public class WSDDTypeMapping extends WSDDElement { + private static final Log log = LogFactory.getLog(WSDDTypeMapping.class.getName()); + protected QName qname = null; protected String serializer = null; protected String deserializer = null; protected QName typeQName = null; - protected String ref = null; protected String encodingStyle = null; /** @@ -107,24 +114,6 @@ protected QName getElementName() { return QNAME_TYPEMAPPING; } - /** - * - * @return XXX - */ - public String getRef() - { - return ref; - } - - /** - * - * @param ref XXX - */ - public void setRef(String ref) - { - this.ref = ref; - } - /** * * @return XXX @@ -280,6 +269,46 @@ public void setDeserializer(String deser) { deserializer = deser; } + + void registerTo(TypeMapping tm) throws WSDDException { + try { + SerializerFactory ser = null; + DeserializerFactory deser = null; + + // Try to construct a serializerFactory by introspecting for the + // following: + // public static create(Class javaType, QName xmlType) + // public (Class javaType, QName xmlType) + // public () + // + // The BaseSerializerFactory createFactory() method is a utility + // that does this for us. + if (getSerializerName() != null && + !getSerializerName().equals("")) { + ser = BaseSerializerFactory.createFactory(getSerializer(), + getLanguageSpecificType(), + getQName()); + } + + setupSerializer(ser); + + if (getDeserializerName() != null && + !getDeserializerName().equals("")) { + deser = BaseDeserializerFactory.createFactory(getDeserializer(), + getLanguageSpecificType(), + getQName()); + } + tm.register(getLanguageSpecificType(), getQName(), ser, deser); + } catch (ClassNotFoundException e) { + log.error(Messages.getMessage("unabletoDeployTypemapping00", getQName().toString()), e); + throw new WSDDNonFatalException(e); + } catch (Exception e) { + throw new WSDDException(e); + } + } + + void setupSerializer(SerializerFactory ser) { + } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/description/JavaServiceDesc.java b/axis-rt-core/src/main/java/org/apache/axis/description/JavaServiceDesc.java index b5c0b40fb2..2d03bc9eec 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/description/JavaServiceDesc.java +++ b/axis-rt-core/src/main/java/org/apache/axis/description/JavaServiceDesc.java @@ -36,12 +36,13 @@ import javax.xml.namespace.QName; import javax.xml.rpc.holders.Holder; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; @@ -140,7 +141,7 @@ public class JavaServiceDesc implements ServiceDesc { /** Method names for which we have completed any introspection necessary */ private ArrayList completedNames = new ArrayList(); - /** Our typemapping for resolving Java<->XML type issues */ + /** Our typemapping for resolving Java<->XML type issues */ private TypeMapping tm = null; private TypeMappingRegistry tmr = null; @@ -520,11 +521,15 @@ public OperationDesc getOperationByElementQName(QName qname) getSyncedOperationsForName(implClass, ((OperationDesc)overloads.get(0)).getName()); + // Convert to array before sorting to avoid concurrency issues + OperationDesc[] array = (OperationDesc[])overloads.toArray( + new OperationDesc[overloads.size()]); + // Sort the overloads by number of arguments - prevents us calling methods // with more parameters than supplied in the request (with missing parameters // defaulted to null) when a perfectly good method exists with exactly the // supplied parameters. - Collections.sort(overloads, + Arrays.sort(array, new Comparator() { public int compare(Object o1, Object o2) { @@ -535,8 +540,7 @@ public int compare(Object o1, Object o2) } }); - OperationDesc [] array = new OperationDesc [overloads.size()]; - return (OperationDesc[])overloads.toArray(array); + return array; } private synchronized void initQNameMap() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/description/OperationDesc.java b/axis-rt-core/src/main/java/org/apache/axis/description/OperationDesc.java index ebc9441945..0e280443a2 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/description/OperationDesc.java +++ b/axis-rt-core/src/main/java/org/apache/axis/description/OperationDesc.java @@ -398,7 +398,7 @@ else if ( qname.equals(returnDesc.getQName())) { /** * Return a list of ALL "in" params (including INOUTs) * - * Note: if we were sure the order went IN->INOUT->OUT, we could optimize + * Note: if we were sure the order went IN->INOUT->OUT, we could optimize * this. * * @return @@ -417,7 +417,7 @@ public ArrayList getAllInParams() { /** * Return a list of ALL "out" params (including INOUTs) * - * Note: if we were sure the order went IN->INOUT->OUT, we could optimize + * Note: if we were sure the order went IN->INOUT->OUT, we could optimize * this. * * @return diff --git a/axis-rt-core/src/main/java/org/apache/axis/description/TypeDesc.java b/axis-rt-core/src/main/java/org/apache/axis/description/TypeDesc.java index 93d6c775b2..f44ae27d82 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/description/TypeDesc.java +++ b/axis-rt-core/src/main/java/org/apache/axis/description/TypeDesc.java @@ -30,12 +30,11 @@ import java.lang.reflect.Method; import java.util.Collections; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import java.util.WeakHashMap; /** - * A TypeDesc represents a Java<->XML data binding. It is essentially + * A TypeDesc represents a Java<->XML data binding. It is essentially * a collection of FieldDescs describing how to map each field in a Java * class to XML. * diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializationContext.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializationContext.java index dc7b9af450..dccf3dba7e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializationContext.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializationContext.java @@ -346,7 +346,7 @@ public String getNamespaceURI(String prefix) } /** - * Construct a QName from a string of the form : + * Construct a QName from a string of the form <prefix>:<localName> * @param qNameStr is the prefixed name from the xml text * @return QName */ @@ -670,8 +670,8 @@ public void addObjectById(String id, Object obj) } /** - * During deserialization, an element with an href=#id - * may be encountered before the element defining id=id is + * During deserialization, an element with an href=#id<int> + * may be encountered before the element defining id=id<int> is * read. In these cases, the getObjectByRef method above will * return null. The deserializer is placed in a table keyed * by href (a fixup table). After the element id is processed, diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializerFactory.java index dbfd6fdf53..f2c6195155 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/DeserializerFactory.java @@ -24,8 +24,8 @@ * of the following methods: * * public static create(Class javaType, QName xmlType) - * public (Class javaType, QName xmlType) - * public () + * public <constructor>(Class javaType, QName xmlType) + * public <constructor>() * * The deployment code will attempt to invoke these methods in the above order. * The xmlType, javaType arguments are filled in with the values supplied during the diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializationContext.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializationContext.java index 9c39adda33..f33ec28dfc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializationContext.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializationContext.java @@ -79,7 +79,7 @@ * and element stacks. * * @author Glen Daniels (gdaniels@apache.org) - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class SerializationContext implements javax.xml.rpc.encoding.SerializationContext { @@ -406,7 +406,7 @@ public TypeMappingRegistry getTypeMappingRegistry() { * return a valid prefix - if the given URI is already mapped in this * serialization, we return the previous prefix. If it is not mapped, * we will add a new mapping and return a generated prefix of the form - * "ns". + * "ns<num>". * @param uri is the namespace uri * @return prefix */ @@ -419,7 +419,7 @@ public String getPrefixForURI(String uri) * Get a prefix for the given namespace URI. If one has already been * defined in this serialization, use that. Otherwise, map the passed * default prefix to the URI, and return that. If a null default prefix - * is passed, use one of the form "ns" + * is passed, use one of the form "ns<num>" */ public String getPrefixForURI(String uri, String defaultPrefix) { @@ -430,7 +430,7 @@ public String getPrefixForURI(String uri, String defaultPrefix) * Get a prefix for the given namespace URI. If one has already been * defined in this serialization, use that. Otherwise, map the passed * default prefix to the URI, and return that. If a null default prefix - * is passed, use one of the form "ns" + * is passed, use one of the form "ns<num>" */ public String getPrefixForURI(String uri, String defaultPrefix, boolean attribute) { @@ -522,7 +522,7 @@ public boolean isEncoded() { } /** - * Convert QName to a string of the form : + * Convert QName to a string of the form <prefix>:<localpart> * @param qName * @return prefixed qname representation for serialization. */ @@ -571,7 +571,7 @@ public String qName2String(QName qName) } /** - * Convert attribute QName to a string of the form : + * Convert attribute QName to a string of the form <prefix>:<localpart> * There are slightly different rules for attributes: * - There is no default namespace * - any attribute in a namespace must have a prefix @@ -819,7 +819,7 @@ public void serialize(QName elemQName, * @param attributes are additional attributes * @param value is the object to serialize * @param xmlType is the qname of the type or null. - * @param javaType is the java type of the value + * @param javaClass is the java type of the value * @param sendNull determines whether to send null values. * @param sendType determines whether to set xsi:type attribute. */ @@ -1181,12 +1181,13 @@ public void startElement(QName qName, Attributes attributes) sb.append(':'); sb.append(map.getPrefix()); } - if ((vecQNames==null) || (vecQNames.indexOf(sb.toString())==-1)) { + String qname = sb.toString(); + if ((vecQNames==null) || (vecQNames.indexOf(qname)==-1)) { writer.write(' '); - sb.append("=\""); - sb.append(map.getNamespaceURI()); - sb.append('"'); - writer.write(sb.toString()); + writer.write(qname); + writer.write("=\""); + getEncoder().writeEncoded(writer, map.getNamespaceURI()); + writer.write('"'); } } } @@ -1276,7 +1277,7 @@ public void writeString(String string) /** * Convenience operation to write out (to Writer) the String - * properly encoded with xml entities (like &) + * properly encoded with xml entities (like &amp;) * @param string is the String to write. */ public void writeSafeString(String string) diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/Serializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/Serializer.java index 9bbc961ab6..53b6d95412 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/Serializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/Serializer.java @@ -29,8 +29,8 @@ * An Axis compliant Serializer must provide one or more * of the following methods: * - * public (Class javaType, QName xmlType) - * public () + * public <constructor>(Class javaType, QName xmlType) + * public <constructor>() * * This will allow for construction of generic factories that introspect the class * to determine how to construct a deserializer. diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializerFactory.java index f49560d9cb..590e2f4981 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/SerializerFactory.java @@ -24,8 +24,8 @@ * of the following methods: * * public static create(Class javaType, QName xmlType) - * public (Class javaType, QName xmlType) - * public () + * public <constructor>(Class javaType, QName xmlType) + * public <constructor>() * * The deployment code will attempt to invoke these methods in the above order. * The xmlType, javaType arguments are filled in with the values supplied during the diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingDelegate.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingDelegate.java index 5e20912f97..72f430d3f9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingDelegate.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingDelegate.java @@ -17,8 +17,6 @@ package org.apache.axis.encoding; import org.apache.axis.utils.Messages; -import org.apache.axis.Constants; - import javax.xml.namespace.QName; import javax.xml.rpc.JAXRPCException; diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingRegistryImpl.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingRegistryImpl.java index 37e99a2189..0d44d90c02 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingRegistryImpl.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/TypeMappingRegistryImpl.java @@ -22,44 +22,39 @@ import java.util.HashMap; /** - *

    * The TypeMappingRegistry keeps track of the individual TypeMappings. - *

    *

    * The TypeMappingRegistry for axis contains a default type mapping * that is set for either SOAP 1.1 or SOAP 1.2 * The default type mapping is a singleton used for the entire * runtime and should not have anything new registered in it. - *

    *

    * Instead the new TypeMappings for the deploy and service are * made in a separate TypeMapping which is identified by * the soap encoding. These new TypeMappings delegate back to * the default type mapping when information is not found. - *

    *

    * So logically we have: *

      *         TMR
      *         | |  
    - *         | +---------------> DefaultTM 
    + *         | +---------------> DefaultTM 
      *         |                      ^
      *         |                      |
    - *         +----> TM --delegate---+
    + *         +----> TM --delegate---+
      * 
    * * But in the implementation, the TMR references * "delegate" TypeMappings (TM') which then reference the actual TM's - *

    *

    * So the picture is really: *

      *         TMR
      *         | |  
    - *         | +-----------TM'------> DefaultTM 
    + *         | +-----------TM'------> DefaultTM 
      *         |              ^
      *         |              |
    - *         +-TM'-> TM ----+
    + *         +-TM'-> TM ----+
      * 
    * * This extra indirection is necessary because the user may want to @@ -71,8 +66,8 @@ * | | * | +-----------TM'--+ DefaultTM * | ^ | - * | | +---> New User Defined Default TM - * +-TM'-> TM ----+ + * | | +---> New User Defined Default TM + * +-TM'-> TM ----+ * * * The other reason that it is necessary is when a deploy @@ -82,26 +77,26 @@ *
      *       Deploy TMR
      *         | |  
    - *         | +-----------TM'------> DefaultTM 
    + *         | +-----------TM'------> DefaultTM 
      *         |              ^
      *         |              |
    - *         +-TM'-> TM ----+
    + *         +-TM'-> TM ----+
      *
      *       Service TMR
      *         | |  
    - *         | +-----------TM'------> DefaultTM 
    + *         | +-----------TM'------> DefaultTM 
      *         |              ^
      *         |              |
    - *         +-TM'-> TM ----+
    + *         +-TM'-> TM ----+
      *
      *    ServiceTMR.delegate(DeployTMR)
      *
      *       Deploy TMR
      *         | |  
    - *         | +------------TM'------> DefaultTM 
    + *         | +------------TM'------> DefaultTM 
      *         |              ^ ^ 
      *         |              | |
    - *         +-TM'-> TM ----+ |
    + *         +-TM'-> TM ----+ |
      *           ^              |
      *   +-------+              |
      *   |                      |
    @@ -110,7 +105,7 @@
      *   |     | +----------TM'-+               
      *   |     |              
      *   |     |              
    - *   |     +-TM'-> TM +
    + *   |     +-TM'-> TM +
      *   |                |
      *   +----------------+
      * 
    @@ -118,12 +113,11 @@ * So now the service uses the DefaultTM of the Deploy TMR, and * the Service TM properly delegates to the deploy's TM. And * if either the deploy defaultTM or TMs change, the links are not broken. - *

    * * @author James Snell (jasnell@us.ibm.com) * @author Sam Ruby (rubys@us.ibm.com) * Re-written for JAX-RPC Compliance by - * @author Rich Scheuerle (scheu@us.ibm.com + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class TypeMappingRegistryImpl implements TypeMappingRegistry { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializer.java index cdb690f641..6f2ad0666f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializer.java @@ -66,7 +66,7 @@ public class ArrayDeserializer extends DeserializerImpl /** * This method is invoked after startElement when the element requires - * deserialization (i.e. the element is not an href & the value is not nil) + * deserialization (i.e. the element is not an href & the value is not nil) * DeserializerImpl provides default behavior, which simply * involves obtaining a correct Deserializer and plugging its handler. * @param namespace is the namespace of the element diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializerFactory.java index 4dc2ab17e7..710a6109e0 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArrayDeserializerFactory.java @@ -22,7 +22,7 @@ /** * DeserializerFactory for arrays * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class ArrayDeserializerFactory extends BaseDeserializerFactory { private QName componentXmlType; diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArraySerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArraySerializerFactory.java index 163670e145..53a38e5f72 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArraySerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ArraySerializerFactory.java @@ -25,7 +25,7 @@ /** * SerializerFactory for arrays * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class ArraySerializerFactory extends BaseSerializerFactory { public ArraySerializerFactory() { @@ -75,7 +75,7 @@ public QName getComponentType() { return componentType; } /** - * Obtains a serializer by invoking (javaType, xmlType) + * Obtains a serializer by invoking <constructor>(javaType, xmlType) * on the serClass. */ protected Serializer getGeneralPurpose(String mechanismType) diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Deserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Deserializer.java index 33d31b7cd3..ae7f827e32 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Deserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Deserializer.java @@ -23,8 +23,8 @@ /** * Deserializer for Base64 * - * @author Sam Ruby - * Modified by @author Rich scheuerle + * @author Sam Ruby (rubys@us.ibm.com) + * Modified by @author Rich scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class Base64Deserializer extends SimpleDeserializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64DeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64DeserializerFactory.java index deaf4f3bba..bc24c270d1 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64DeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64DeserializerFactory.java @@ -20,7 +20,7 @@ /** * DeserializerFactory for hexBinary. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class Base64DeserializerFactory extends BaseDeserializerFactory { public Base64DeserializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Serializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Serializer.java index 7a585f146e..7ade201c63 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Serializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64Serializer.java @@ -30,8 +30,8 @@ /** * Serializer for Base64 * - * @author Sam Ruby - * Modified by @author Rich Scheuerle + * @author Sam Ruby (rubys@us.ibm.com) + * Modified by @author Rich Scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class Base64Serializer implements SimpleValueSerializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64SerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64SerializerFactory.java index 6d74b1ede6..fdb51328be 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64SerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/Base64SerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for hexBinary. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class Base64SerializerFactory extends BaseSerializerFactory { public Base64SerializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseDeserializerFactory.java index 76bd709828..9409b8b9c4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseDeserializerFactory.java @@ -34,7 +34,7 @@ /** * Base class for Axis Deserialization Factory classes for code reuse * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public abstract class BaseDeserializerFactory extends BaseFactory implements DeserializerFactory { @@ -101,7 +101,7 @@ public BaseDeserializerFactory(Class deserClass, } /** - * Obtains a deserializer by invoking (javaType, xmlType) + * Obtains a deserializer by invoking <constructor>(javaType, xmlType) * on the deserClass. */ protected Deserializer getGeneralPurpose(String mechanismType) { @@ -188,8 +188,8 @@ public Iterator getSupportedMechanismTypes() { * Utility method that intospects on a factory class to decide how to * create the factory. Tries in the following order: * public static create(Class javaType, QName xmlType) - * public (Class javaType, QName xmlType) - * public () + * public <constructor>(Class javaType, QName xmlType) + * public <constructor>() * @param factory class * @param javaType * @param xmlType diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseFactory.java index 1ab5889d19..ee5ded0f7c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseFactory.java @@ -25,7 +25,7 @@ * Base Factory for BaseDeserializerFactory and BaseSerializerFactory. * Code Reuse for the method cache * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public abstract class BaseFactory { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseSerializerFactory.java index a9efc6632c..68ba4e8ac4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BaseSerializerFactory.java @@ -34,7 +34,7 @@ /** * Base class for Axis Serialization Factory classes for code reuse * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public abstract class BaseSerializerFactory extends BaseFactory implements SerializerFactory { @@ -111,7 +111,7 @@ protected Serializer getSerializerAsInternal(String mechanismType) } /** - * Obtains a serializer by invoking (javaType, xmlType) + * Obtains a serializer by invoking <constructor>(javaType, xmlType) * on the serClass. */ protected Serializer getGeneralPurpose(String mechanismType) { @@ -217,8 +217,8 @@ public Class getJavaType() { * Utility method that intospects on a factory class to decide how to * create the factory. Tries in the following order: * public static create(Class javaType, QName xmlType) - * public (Class javaType, QName xmlType) - * public () + * public <constructor>(Class javaType, QName xmlType) + * public <constructor>() * @param factory class * @param xmlType * @param javaType diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializer.java index 44e518b34b..42f6293edd 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializer.java @@ -45,9 +45,9 @@ /** * General purpose deserializer for an arbitrary java bean. * - * @author Sam Ruby - * @author Rich Scheuerle - * @author Tom Jordahl + * @author Sam Ruby (rubys@us.ibm.com) + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Tom Jordahl (tomj@macromedia.com) */ public class BeanDeserializer extends DeserializerImpl implements Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializerFactory.java index d39f0cd846..dd5e99c024 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanDeserializerFactory.java @@ -30,8 +30,8 @@ /** * DeserializerFactory for Bean * - * @author Rich Scheuerle - * @author Sam Ruby + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Sam Ruby (rubys@us.ibm.com) */ public class BeanDeserializerFactory extends BaseDeserializerFactory { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializer.java index 62150eba08..8501edb7c5 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializer.java @@ -48,9 +48,9 @@ /** * General purpose serializer/deserializerFactory for an arbitrary java bean. * - * @author Sam Ruby - * @author Rich Scheuerle - * @author Tom Jordahl + * @author Sam Ruby (rubys@us.ibm.com) + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Tom Jordahl (tomj@macromedia.com) */ public class BeanSerializer implements Serializer, Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializerFactory.java index 9a28aaa0a1..4e415d3d41 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/BeanSerializerFactory.java @@ -30,7 +30,7 @@ /** * SerializerFactory for Bean * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class BeanSerializerFactory extends BaseSerializerFactory { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializer.java index a5e8ef87b3..b8cc8e28ac 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializer.java @@ -33,8 +33,8 @@ /** * Serializer for dateTime (Calendar). * - * @author Sam Ruby - * Modified by @author Rich scheuerle + * @author Sam Ruby (rubys@us.ibm.com) + * Modified by @author Rich scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class CalendarSerializer implements SimpleValueSerializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializerFactory.java index dfa095f583..4fc9d3932a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/CalendarSerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for Calendar(dateTime) primitives * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class CalendarSerializerFactory extends BaseSerializerFactory { public CalendarSerializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializer.java index c5a313b5e8..7205ed00f8 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializer.java @@ -33,8 +33,8 @@ /** * Serializer for Dates. * - * @author Sam Ruby - * Modified by @author Rich scheuerle + * @author Sam Ruby (rubys@us.ibm.com) + * Modified by @author Rich scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class DateSerializer implements SimpleValueSerializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializerFactory.java index 33e0517b41..35e4d56dd2 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DateSerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for Date primitives * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class DateSerializerFactory extends BaseSerializerFactory { public DateSerializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializer.java index 81fa0d15e9..dd9f57c355 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializer.java @@ -30,7 +30,7 @@ /** * Deserializer for DOM Document * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class DocumentDeserializer extends DeserializerImpl { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializerFactory.java index 6acdc57317..77ee73b9ff 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentDeserializerFactory.java @@ -21,7 +21,7 @@ /** * DeserializerFactory for DOM Document. * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class DocumentDeserializerFactory extends BaseDeserializerFactory { public DocumentDeserializerFactory() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializer.java index e805a8b917..6627e32bf7 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializer.java @@ -31,7 +31,7 @@ /** * Serializer for DOM Document * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class DocumentSerializer implements Serializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializerFactory.java index dda6a81965..8b11d167bf 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/DocumentSerializerFactory.java @@ -21,7 +21,7 @@ /** * SerializerFactory for DOM Document * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class DocumentSerializerFactory extends BaseSerializerFactory { public DocumentSerializerFactory() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializer.java index 7d61e9a1d4..e939ee2ee9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializer.java @@ -31,7 +31,7 @@ * Deserializer for DOM elements * * @author Glen Daniels (gdaniels@apache.org) - * Modified by @author Rich scheuerle + * Modified by @author Rich scheuerle (scheu@us.ibm.com) */ public class ElementDeserializer extends DeserializerImpl { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializerFactory.java index 40f79aa1a1..8248a4e4a8 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementDeserializerFactory.java @@ -20,7 +20,7 @@ /** * DeserializerFactory for Element. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class ElementDeserializerFactory extends BaseDeserializerFactory { public ElementDeserializerFactory() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializer.java index 2e91676e2e..28cd467314 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializer.java @@ -32,7 +32,7 @@ * Serializer for DOM elements * * @author Glen Daniels (gdaniels@apache.org) - * Modified by @author Rich scheuerle + * Modified by @author Rich scheuerle (scheu@us.ibm.com) */ public class ElementSerializer implements Serializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializerFactory.java index 7afa42d32d..e080e45835 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ElementSerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for Element * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class ElementSerializerFactory extends BaseSerializerFactory { public ElementSerializerFactory() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializer.java index 364d399c14..c28628049e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializer.java @@ -25,8 +25,8 @@ /** * Deserializer for a JAX-RPC enum. * - * @author Rich Scheuerle - * @author Sam Ruby + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Sam Ruby (rubys@us.ibm.com) */ public class EnumDeserializer extends SimpleDeserializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializerFactory.java index 722384c766..9367d59896 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumDeserializerFactory.java @@ -20,7 +20,7 @@ /** * DeserializerFactory for Enumeration. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class EnumDeserializerFactory extends BaseDeserializerFactory { public EnumDeserializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializer.java index 217f982138..f5f3541c7f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializer.java @@ -30,8 +30,8 @@ /** * Serializer for a JAX-RPC enum. * - * @author Rich Scheuerle - * @author Sam Ruby + * @author Rich Scheuerle (scheu@us.ibm.com) + * @author Sam Ruby (rubys@us.ibm.com) */ public class EnumSerializer extends SimpleSerializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializerFactory.java index dc9c339cea..20dbefaaab 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/EnumSerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for Enum * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class EnumSerializerFactory extends BaseSerializerFactory { public EnumSerializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializer.java index a1e76d5403..740de2f7c3 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializer.java @@ -23,8 +23,8 @@ /** * Deserializer for hexBinary. * - * @author Davanum Srinivas - * Modified by @author Rich scheuerle + * @author Davanum Srinivas (dims@yahoo.com) + * Modified by @author Rich scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class HexDeserializer extends SimpleDeserializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializerFactory.java index c7eb9d0ba4..ea55961cc2 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexDeserializerFactory.java @@ -20,7 +20,7 @@ /** * DeserializerFactory for hexBinary. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class HexDeserializerFactory extends BaseDeserializerFactory { public HexDeserializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializer.java index 32414e08b8..08197d6efb 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializer.java @@ -30,8 +30,8 @@ /** * Serializer for hexBinary. * - * @author Davanum Srinivas - * Modified by @author Rich scheuerle + * @author Davanum Srinivas (dims@yahoo.com) + * Modified by @author Rich scheuerle (scheu@us.ibm.com) * @see XML Schema 3.2.16 */ public class HexSerializer implements SimpleValueSerializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializerFactory.java index 4ff02c8c11..f1b9987336 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/HexSerializerFactory.java @@ -20,7 +20,7 @@ /** * SerializerFactory for hexBinary. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) */ public class HexSerializerFactory extends BaseSerializerFactory { public HexSerializerFactory(Class javaType, QName xmlType) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ImageDataHandlerDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ImageDataHandlerDeserializer.java index 47f93737d9..e27427d3a2 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ImageDataHandlerDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/ImageDataHandlerDeserializer.java @@ -16,7 +16,6 @@ package org.apache.axis.encoding.ser; -import org.apache.axis.components.image.ImageIOFactory; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.encoding.DeserializationContext; import org.apache.commons.logging.Log; @@ -24,12 +23,14 @@ import org.xml.sax.SAXException; import javax.activation.DataHandler; +import javax.imageio.ImageIO; + import java.awt.*; import java.io.InputStream; /** * ImageDataHandler Deserializer - * Modified by Russell Butek + * Modified by Russell Butek (butek@us.ibm.com) */ public class ImageDataHandlerDeserializer extends JAFDataHandlerDeserializer { protected static Log log = @@ -47,7 +48,7 @@ public void startElement(String namespace, String localName, DataHandler dh = (DataHandler) getValue(); InputStream is = dh.getInputStream(); - Image image = ImageIOFactory.getImageIO().loadImage(is); + Image image = ImageIO.read(is); setValue(image); } catch (Exception e) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java index 5b9d9e2c7e..d223a19ea4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerDeserializer.java @@ -17,7 +17,6 @@ package org.apache.axis.encoding.ser; import org.apache.axis.attachments.AttachmentUtils; -import org.apache.axis.attachments.Attachments; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.encoding.DeserializationContext; import org.apache.axis.encoding.DeserializerImpl; @@ -35,7 +34,7 @@ /** * JAFDataHandler Serializer * @author Rick Rineholt - * Modified by Rich Scheuerle + * Modified by Rich Scheuerle (scheu@us.ibm.com) */ public class JAFDataHandlerDeserializer extends DeserializerImpl { protected static Log log = diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java index eb9bd24dc3..e59544f245 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java @@ -38,7 +38,7 @@ /** * JAFDataHandler Serializer * @author Rick Rineholt - * Modified by Rich Scheuerle + * Modified by Rich Scheuerle (scheu@us.ibm.com) */ public class JAFDataHandlerSerializer implements Serializer { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapDeserializer.java index 3794b443fd..d510fb9ddc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapDeserializer.java @@ -31,13 +31,13 @@ import java.util.HashMap; import java.util.Map; -/* +/** * A MapSerializer is be used to deserialize * deserialize Maps using the SOAP-ENC * encoding style.

    * * @author Glen Daniels (gdaniels@apache.org) - * Modified by @author Rich scheuerle + * Modified by @author Rich scheuerle (scheu@us.ibm.com) */ public class MapDeserializer extends DeserializerImpl { @@ -135,7 +135,7 @@ public void setChildValue(Object value, Object hint) throws SAXException } /** - * A deserializer for an . Handles getting the key and + * A deserializer for an <item>. Handles getting the key and * value objects from their own deserializers, and then putting * the values into the HashMap we're building. * diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapSerializer.java index e4dbb16db0..22eb4c7415 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/MapSerializer.java @@ -55,7 +55,7 @@ public class MapSerializer implements Serializer /** Serialize a Map * * Walk the collection of keys, serializing each key/value pair - * inside an element. + * inside an <item> element. * * @param name the desired QName for the element * @param attributes the desired attributes for the element diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/OctetStreamDataHandlerDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/OctetStreamDataHandlerDeserializer.java index 9a7080fa2d..2093a02289 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/OctetStreamDataHandlerDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/OctetStreamDataHandlerDeserializer.java @@ -30,7 +30,7 @@ /** * application/octet-stream DataHandler Deserializer - * Modified by Davanum Srinivas + * Modified by Davanum Srinivas (dims@yahoo.com) */ public class OctetStreamDataHandlerDeserializer extends JAFDataHandlerDeserializer { protected static Log log = diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/PlainTextDataHandlerDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/PlainTextDataHandlerDeserializer.java index f79d202827..8e7a36aa0c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/PlainTextDataHandlerDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/PlainTextDataHandlerDeserializer.java @@ -27,7 +27,7 @@ /** * text/plain DataHandler Deserializer - * Modified by Russell Butek + * Modified by Russell Butek (butek@us.ibm.com) */ public class PlainTextDataHandlerDeserializer extends JAFDataHandlerDeserializer { protected static Log log = diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializer.java index 8d00c947ab..f230f50d8d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializer.java @@ -40,9 +40,9 @@ /** * Deserializer for - * - * - * + * <xsd:simpleType ...> + * <xsd:list itemType="..."> + * </xsd:simpleType> * based on SimpleDeserializer * * @author Ias (iasandcb@tmax.co.kr) diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializerFactory.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializerFactory.java index 1c209e0a2e..fdff4d955b 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializerFactory.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListDeserializerFactory.java @@ -25,9 +25,9 @@ /** * DeserializerFactory for - * - * - * + * <xsd:simpleType ...> + * <xsd:list itemType="..."> + * </xsd:simpleType> * based on SimpleDeserializerFactory * * @author Ias (iasandcb@tmax.co.kr) diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListSerializer.java index 706465691a..da2c3b3803 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleListSerializer.java @@ -36,12 +36,12 @@ /** * Serializer for - * - * - * + * <xsd:simpleType ...> + * <xsd:list itemType="..."> + * </xsd:simpleType> * based on SimpleSerializer * - * @author Ias + * @author Ias (iasandcb@tmax.co.kr) */ public class SimpleListSerializer implements SimpleValueSerializer { public QName xmlType; diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleSerializer.java index c067ce4141..9bc1606d1f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SimpleSerializer.java @@ -38,7 +38,7 @@ /** * Serializer for primitives and anything simple whose value is obtained with toString() * - * @author Rich Scheuerle + * @author Rich Scheuerle (dims@yahoo.com) */ public class SimpleSerializer implements SimpleValueSerializer { public QName xmlType; diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java index 69daa4d661..4b35219c6a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java @@ -25,11 +25,10 @@ import javax.activation.DataHandler; import javax.xml.transform.stream.StreamSource; import java.io.IOException; -import java.io.StringReader; /** * SourceDataHandler Deserializer - * Modified by Russell Butek + * Modified by Russell Butek (butek@us.ibm.com) */ public class SourceDataHandlerDeserializer extends JAFDataHandlerDeserializer { protected static Log log = diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorDeserializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorDeserializer.java index 64c88d4529..91a2e4890c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorDeserializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorDeserializer.java @@ -34,7 +34,7 @@ * Deserializer for SOAP Vectors for compatibility with SOAP 2.2. * * @author Carsten Ziegeler (cziegeler@apache.org) - * Modified by @author Rich scheuerle + * Modified by @author Rich scheuerle (scheu@us.ibm.com) */ public class VectorDeserializer extends DeserializerImpl { diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorSerializer.java b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorSerializer.java index 3b8a47de89..ade227f040 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorSerializer.java +++ b/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/VectorSerializer.java @@ -48,7 +48,7 @@ public class VectorSerializer implements Serializer /** Serialize a Vector * * Walk the collection of keys, serializing each key/value pair - * inside an element. + * inside an <item> element. * * @param name the desired QName for the element * @param attributes the desired attributes for the element diff --git a/axis-rt-core/src/main/java/org/apache/axis/handlers/soap/SOAPService.java b/axis-rt-core/src/main/java/org/apache/axis/handlers/soap/SOAPService.java index 85be58e4da..44a9e7033c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/handlers/soap/SOAPService.java +++ b/axis-rt-core/src/main/java/org/apache/axis/handlers/soap/SOAPService.java @@ -28,7 +28,6 @@ import org.apache.axis.description.JavaServiceDesc; import org.apache.axis.description.ServiceDesc; import org.apache.axis.encoding.TypeMappingRegistry; -import org.apache.axis.encoding.TypeMapping; import org.apache.axis.constants.Style; import org.apache.axis.constants.Use; import org.apache.axis.handlers.HandlerChainImpl; diff --git a/axis-rt-core/src/main/java/org/apache/axis/holders/SchemaHolder.java b/axis-rt-core/src/main/java/org/apache/axis/holders/SchemaHolder.java index acbdc89fb2..5906fdc233 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/holders/SchemaHolder.java +++ b/axis-rt-core/src/main/java/org/apache/axis/holders/SchemaHolder.java @@ -19,7 +19,7 @@ /** * Custom class for supporting XSD schema * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public final class SchemaHolder implements javax.xml.rpc.holders.Holder { public org.apache.axis.types.Schema value; diff --git a/axis-rt-core/src/main/java/org/apache/axis/i18n/MessageBundle.java b/axis-rt-core/src/main/java/org/apache/axis/i18n/MessageBundle.java index 4d86e2e928..64b3c2658a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/i18n/MessageBundle.java +++ b/axis-rt-core/src/main/java/org/apache/axis/i18n/MessageBundle.java @@ -89,9 +89,9 @@ public String getMessage(String key) throws MissingResourceException *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @return The message @@ -105,9 +105,9 @@ public String getMessage(String key, String arg0) throws MissingResourceExceptio *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -122,9 +122,9 @@ public String getMessage(String key, String arg0, String arg1) throws MissingRes *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -140,9 +140,9 @@ public String getMessage(String key, String arg0, String arg1, String arg2) thro *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -159,9 +159,9 @@ public String getMessage(String key, String arg0, String arg1, String arg2, Stri *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -179,9 +179,9 @@ public String getMessage(String key, String arg0, String arg1, String arg2, Stri *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param array An array of objects to place in corresponding variables * @return The message diff --git a/axis-rt-core/src/main/java/org/apache/axis/i18n/ProjectResourceBundle.java b/axis-rt-core/src/main/java/org/apache/axis/i18n/ProjectResourceBundle.java index aa47c48663..dc4ee7d3ae 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/i18n/ProjectResourceBundle.java +++ b/axis-rt-core/src/main/java/org/apache/axis/i18n/ProjectResourceBundle.java @@ -115,10 +115,6 @@ public Enumeration getKeys() { * @param projectName The name of the project to which the class belongs. * It must be a proper prefix of the caller's package. * - * @param caller The calling class. - * This is used to get the package name to further construct - * the basename as well as to get the proper ClassLoader. - * * @param resourceName The name of the resource without the * ".properties" extension * @@ -170,10 +166,6 @@ public static ProjectResourceBundle getBundle(String projectName, * @param projectName The name of the project to which the class belongs. * It must be a proper prefix of the caller's package. * - * @param caller The calling class. - * This is used to get the package name to further construct - * the basename as well as to get the proper ClassLoader. - * * @param resourceName The name of the resource without the * ".properties" extension * @@ -236,10 +228,6 @@ public static ProjectResourceBundle getBundle(String projectName, * @param projectName The name of the project to which the class belongs. * It must be a proper prefix of the caller's package. * - * @param caller The calling class. - * This is used to get the package name to further construct - * the basename as well as to get the proper ClassLoader. - * * @param resourceName The name of the resource without the * ".properties" extension * diff --git a/axis-rt-core/src/main/java/org/apache/axis/i18n/RB.java b/axis-rt-core/src/main/java/org/apache/axis/i18n/RB.java index f9079085ed..f26a7d6157 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/i18n/RB.java +++ b/axis-rt-core/src/main/java/org/apache/axis/i18n/RB.java @@ -43,7 +43,7 @@ * (as returned by Local.getDefault()). As property files are found the * property values are merged so that inheritance is preserved.

    *

    The order of searching is:

    - * + *
      * basename + "_" + langage + "_" + country + "_" + variant
      * basename + "_" + langage + "_" + country
      * basename + "_" + langage
    @@ -51,7 +51,7 @@
      * basename + "_" + defaultLanguage + "_" + defaultCountry
      * basename + "_" + defaultLanguage
      * basename
    - * 
    + * *

    The basename is the name of the property file without the ".properties" * extension.

    *

    Properties will be cached for performance.

    @@ -106,7 +106,7 @@ public RB(Object caller, String name) throws MissingResourceException * @param caller The calling object. This is used to get the package name * to further construct the basename as well as to get the proper ClassLoader * @param name The name of the property file without the ".properties" extension - * @param local The local + * @param locale The locale */ public RB(Object caller, String name, Locale locale) throws MissingResourceException { @@ -170,9 +170,9 @@ public String getString(String key) throws MissingResourceException *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @return The message @@ -188,9 +188,9 @@ public String getString(String key, Object arg0) throws MissingResourceException *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -208,9 +208,9 @@ public String getString(String key, Object arg0, Object arg1) throws MissingReso *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -230,9 +230,9 @@ public String getString(String key, Object arg0, Object arg1, Object arg2) throw *

    Gets a string message from the resource bundle for the given key. The * message may contain variables that will be substituted with the given * arguments. Variables have the format:

    - * + *
           * This message has two variables: {0} and {1}
    -      * 
    + * * @param key The resource key * @param array An array of objects to place in corresponding variables * @return The message @@ -515,7 +515,7 @@ public static String getString(Object caller, String key, Object arg0, Object ar * Get a message from resource.properties from the package of the given object. * @param caller The calling object, used to get the package name and class loader * @param key The resource key - * @param array An array of objects to place in corresponding variables + * @param args An array of objects to place in corresponding variables * @return The formatted message */ public static String getString(Object caller, String key, Object[] args) @@ -642,7 +642,7 @@ public static String getString(Object caller, Locale locale, String key, Object * @param caller The calling object, used to get the package name and class loader * @param locale The locale * @param key The resource key - * @param array An array of objects to place in corresponding variables + * @param args An array of objects to place in corresponding variables * @return The formatted message */ public static String getString(Object caller, Locale locale, String key, Object[] args) diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/Registrar.java b/axis-rt-core/src/main/java/org/apache/axis/management/Registrar.java deleted file mode 100644 index 5e9fec04a0..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/management/Registrar.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2003,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.axis.management; - -import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.i18n.Messages; -import org.apache.commons.logging.Log; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * class to act as a dynamic loading registrar to commons-modeler, so - * as to autoregister stuff - * - * @link http://www.webweavertech.com/costin/archives/000168.html#000168 - */ -public class Registrar { - /** - * our log - */ - protected static Log log = LogFactory.getLog(Registrar.class.getName()); - - /** - * register using reflection. The perf hit is moot as jmx is - * all reflection anyway - * - * @param objectToRegister - * @param name - * @param context - */ - public static boolean register(Object objectToRegister, - String name, String context) { - if (isBound()) { - if (log.isDebugEnabled()) { - log.debug("Registering " + objectToRegister + " as " - + name); - } - return modelerBinding.register(objectToRegister, name, context); - } else { - return false; - } - } - - /** - * Check for being bound to a modeler -this will force - * a binding if none existed. - * - * @return - */ - - public static boolean isBound() { - createModelerBinding(); - return modelerBinding.canBind(); - } - - /** - * create the modeler binding if it is needed - * At the end of this call, modelerBinding != null - */ - private static void createModelerBinding() { - if (modelerBinding == null) { - modelerBinding = new ModelerBinding(); - } - } - - /** - * the inner class that does the binding - */ - private static ModelerBinding modelerBinding = null; - - /** - * This class provides a dynamic binding to the - * commons-modeler registry at run time - */ - static class ModelerBinding { - /** - * the constructor binds - */ - public ModelerBinding() { - bindToModeler(); - } - - /** - * can the binding bind? - * - * @return true iff the classes are bound - */ - public boolean canBind() { - return registry != null; - } - - /** - * log - */ - protected static Log log = LogFactory.getLog(ModelerBinding.class.getName()); - /** - * registry object - */ - Object registry; - /** - * method to call - */ - Method registerComponent; - - /** - * register using reflection. The perf hit is moot as jmx is - * all reflection anyway - * - * @param objectToRegister - * @param name - * @param context - */ - public boolean register(Object objectToRegister, String name, String context) { - if (registry != null) { - Object args[] = new Object[]{objectToRegister, name, context}; - try { - registerComponent.invoke(registry, args); - if (log.isDebugEnabled()) { - log.debug("Registered " + name + " in " + context); - } - } catch (IllegalAccessException e) { - log.error(e); - return false; - } catch (IllegalArgumentException e) { - log.error(e); - return false; - } catch (InvocationTargetException e) { - log.error(e); - return false; - } - return true; - } else { - return false; - } - } - - /** - * bind to the modeler; return success/failure flag - * - * @return true if the binding worked - */ - private boolean bindToModeler() { - Exception ex = null; - Class clazz; - try { - clazz = Class.forName("org.apache.commons.modeler.Registry"); - } catch (ClassNotFoundException e) { - // just ignore it silently if we don't have commons-modeler.jar around - registry = null; - return false; - } - try { - Class[] getRegistryArgs = new Class[]{Object.class, Object.class,}; - Method getRegistry = clazz.getMethod("getRegistry", getRegistryArgs); - Object[] getRegistryOptions = new Object[]{null, null}; - registry = getRegistry.invoke(null, getRegistryOptions); - Class[] registerArgs = new Class[]{Object.class, - String.class, - String.class}; - registerComponent = clazz.getMethod("registerComponent", registerArgs); - } catch (IllegalAccessException e) { - ex = e; - } catch (IllegalArgumentException e) { - ex = e; - } catch (InvocationTargetException e) { - ex = e; - } catch (NoSuchMethodException e) { - ex = e; - } - // handle any of these exceptions - if (ex != null) { - //log the error - log.warn(Messages.getMessage("Registrar.cantregister"), ex); - //mark the registration as a failure - registry = null; - //and fail - return false; - } else { - //success - return true; - } - } - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/EnvelopeBuilder.java b/axis-rt-core/src/main/java/org/apache/axis/message/EnvelopeBuilder.java index efd53fd7d7..7572763bc6 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/EnvelopeBuilder.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/EnvelopeBuilder.java @@ -25,7 +25,6 @@ import org.apache.axis.MessageContext; import javax.xml.namespace.QName; -import javax.xml.soap.SOAPException; /** * The EnvelopeBuilder is responsible for parsing the top-level diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/MessageElement.java b/axis-rt-core/src/main/java/org/apache/axis/message/MessageElement.java index 9e20fcb5e7..e6f59b95f4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/MessageElement.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/MessageElement.java @@ -68,8 +68,8 @@ * * Note: it was made Serializable to help users of Apache SOAP who had * exploited the serializability of the DOM tree to migrate to Axis. - * @todo implement the NodeList methods properly, with tests. */ +// TODO: implement the NodeList methods properly, with tests. public class MessageElement extends NodeImpl implements SOAPElement, Serializable, org.w3c.dom.NodeList, // ADD Nodelist Interfaces for SAAJ 1.2 @@ -378,7 +378,7 @@ public void setEndIndex(int endIndex) /** * get the attributes - * @return attributes. If this equals {@link NullAttributes.singleton} it is null + * @return attributes. If this equals {@link NullAttributes#singleton} it is null * */ public Attributes getAttributesEx() { return attributes; } @@ -1283,9 +1283,9 @@ public String toString() { /** * add a new namespace/prefix mapping * @param map new mapping to add - * @todo: this code does not verify that the mapping does not exist already; it - * is possible to create duplicate mappings. */ + // TODO: this code does not verify that the mapping does not exist already; it + // is possible to create duplicate mappings. public void addMapping(Mapping map) { if (namespaces == null) { namespaces = new ArrayList(); @@ -1421,11 +1421,11 @@ public SOAPElement addAttribute(Name attrName, String value) * @param uri * @return * @throws SOAPException for any {@link RuntimeException} caught - * @todo for some reason this logic catches all rutime exceptions and - * rethrows them as SOAPExceptions. This is unusual behavio, and should - * be looked at closely. * @see javax.xml.soap.SOAPElement#addNamespaceDeclaration(String, String) */ + // TODO: for some reason this logic catches all rutime exceptions and + // rethrows them as SOAPExceptions. This is unusual behavio, and should + // be looked at closely. public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException { @@ -1741,10 +1741,10 @@ public boolean hasAttributeNS(String namespace, String localName) { * @see org.w3c.dom.Element#getAttributeNode(String) * @param attrName * @return null, always. - * @todo Fix this for SAAJ 1.2 Implementation. marked as deprecated to warn people - * it is broken * @deprecated this is not implemented */ + // TODO: Fix this for SAAJ 1.2 Implementation. marked as deprecated to warn people + // it is broken public Attr getAttributeNode(String attrName) { return null; } @@ -1769,8 +1769,8 @@ public Attr removeAttributeNode(Attr oldAttr) throws DOMException { * @return newAttr * @throws DOMException * @deprecated this is not implemented - * @todo implement */ + // TODO: implement public Attr setAttributeNode(Attr newAttr) throws DOMException { return newAttr; } @@ -1778,11 +1778,11 @@ public Attr setAttributeNode(Attr newAttr) throws DOMException { /** * set an attribute as a node * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr) - * @todo implement properly. * @param newAttr * @return null * @throws DOMException */ + // TODO: implement properly. public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { //attributes. AttributesImpl attributes = makeAttributesEditable(); @@ -1826,8 +1826,8 @@ public NodeList getElementsByTagName(String tagName) { * @param namespaceURI namespace * @param localName name * @return string value or null if not found - * @todo: this could be refactored to use getAttributeValue() */ + // TODO: this could be refactored to use getAttributeValue() public String getAttributeNS(String namespaceURI, String localName) { if(namespaceURI == null) { namespaceURI = ""; diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/NodeListImpl.java b/axis-rt-core/src/main/java/org/apache/axis/message/NodeListImpl.java index a0cc282482..5d80772ed5 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/NodeListImpl.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/NodeListImpl.java @@ -20,7 +20,6 @@ import org.w3c.dom.NodeList; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/NullAttributes.java b/axis-rt-core/src/main/java/org/apache/axis/message/NullAttributes.java index 0e3074edf7..4398301449 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/NullAttributes.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/NullAttributes.java @@ -6,7 +6,7 @@ * Null implementation of the Attributes interface. * * @author David Megginson - * @author Sam Ruby + * @author Sam Ruby (rubys@us.ibm.com) */ public class NullAttributes implements Attributes { diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/RPCHandler.java b/axis-rt-core/src/main/java/org/apache/axis/message/RPCHandler.java index db918a6ae5..4ce33fb31b 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/RPCHandler.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/RPCHandler.java @@ -46,12 +46,14 @@ * deserializing the XML for a method call or return. In other words for * this XML: * - * - * Hello! - * 3.14159 - * + *
    + * <methodName>
    + *   <param1 xsi:type="xsd:string">Hello!</param1>
    + *   <param2>3.14159</param2>
    + * </methodName>
    + * 
    * - * ...we'll get onStartChild() events for and . + * ...we'll get onStartChild() events for <param1> and <param2>. * * @author Glen Daniels (gdaniels@apache.org) */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/SAXOutputter.java b/axis-rt-core/src/main/java/org/apache/axis/message/SAXOutputter.java index 0d47c6e8b1..cd99bbbb74 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/SAXOutputter.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/SAXOutputter.java @@ -17,7 +17,6 @@ import org.apache.axis.components.logger.LogFactory; import org.apache.axis.encoding.SerializationContext; -import org.apache.axis.utils.XMLUtils; import org.apache.commons.logging.Log; import org.xml.sax.Attributes; import org.xml.sax.SAXException; diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/SOAPDocumentImpl.java b/axis-rt-core/src/main/java/org/apache/axis/message/SOAPDocumentImpl.java index 85e4b10833..2be9d1154d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/SOAPDocumentImpl.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/SOAPDocumentImpl.java @@ -44,9 +44,9 @@ * SOAPDcoumentImpl implements the Document API for SOAPPART. At the moment, it * again delgate the XERCES DOM Implementation Here is my argument on it: I * guess that there is 3 way to implement this. - fully implement the DOM API - * here myself. => This is too much and duplicated work. - extends XERCES - * Implementation => this makes we are fixed to one Implementation - choose - * delgate depends on the user's parser preference => This is the practically + * here myself. => This is too much and duplicated work. - extends XERCES + * Implementation => this makes we are fixed to one Implementation - choose + * delgate depends on the user's parser preference => This is the practically * best solution I have now * * @author Heejune Ahn (cityboy@tmax.co.kr) @@ -75,7 +75,7 @@ public SOAPDocumentImpl(SOAPPart sp) { } /** - * @todo : link with SOAP + * TODO: link with SOAP * * @return */ @@ -100,7 +100,7 @@ public Element getDocumentElement() { * based on the tagName, we will make different kind SOAP Elements Instance * Is really we can determine the Type by the Tagname??? * - * @todo : verify this method + * TODO: verify this method * * @param tagName * @return @throws @@ -147,11 +147,11 @@ public org.w3c.dom.Element createElement(String tagName) /** * - * Creates an empty DocumentFragment object. @todo not - * implemented yet + * Creates an empty DocumentFragment object. * * @return A new DocumentFragment. */ + // TODO: not implemented yet public DocumentFragment createDocumentFragment() { return delegate.createDocumentFragment(); } @@ -219,7 +219,7 @@ public ProcessingInstruction createProcessingInstruction( } /** - * @todo: How Axis will maintain the Attribute representation ? + * TODO: How Axis will maintain the Attribute representation ? */ public Attr createAttribute(String name) throws DOMException { return delegate.createAttribute(name); @@ -634,7 +634,7 @@ public boolean hasChildNodes() { } /** - * @todo: Study it more.... to implement the deep mode correctly. + * TODO: Study it more.... to implement the deep mode correctly. * */ public Node cloneNode(boolean deep) { @@ -642,7 +642,7 @@ public Node cloneNode(boolean deep) { } /** - * @todo: is it OK to simply call the superclass? + * TODO: is it OK to simply call the superclass? * */ public void normalize() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/message/SOAPEnvelope.java b/axis-rt-core/src/main/java/org/apache/axis/message/SOAPEnvelope.java index b48e7feb7f..9f6cc45ba6 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/message/SOAPEnvelope.java +++ b/axis-rt-core/src/main/java/org/apache/axis/message/SOAPEnvelope.java @@ -31,7 +31,6 @@ import org.apache.commons.logging.Log; import org.w3c.dom.DOMException; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; diff --git a/axis-rt-core/src/main/java/org/apache/axis/providers/BasicProvider.java b/axis-rt-core/src/main/java/org/apache/axis/providers/BasicProvider.java index 30181552f4..2aac1f7256 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/providers/BasicProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/providers/BasicProvider.java @@ -27,7 +27,6 @@ import org.apache.axis.components.logger.LogFactory; import org.apache.axis.description.ServiceDesc; import org.apache.axis.description.JavaServiceDesc; -import org.apache.axis.encoding.TypeMapping; import org.apache.axis.handlers.BasicHandler; import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.utils.Messages; diff --git a/axis-rt-core/src/main/java/org/apache/axis/providers/ComProvider.java b/axis-rt-core/src/main/java/org/apache/axis/providers/ComProvider.java deleted file mode 100644 index 8bbded6411..0000000000 --- a/axis-rt-core/src/main/java/org/apache/axis/providers/ComProvider.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.providers; - -import org.apache.axis.AxisFault; -import org.apache.axis.Constants; -import org.apache.axis.Message; -import org.apache.axis.MessageContext; -import org.apache.axis.components.bridge.COMBridge; -import org.apache.axis.deployment.wsdd.providers.WSDDComProvider; -import org.apache.axis.description.OperationDesc; -import org.apache.axis.description.ParameterDesc; -import org.apache.axis.handlers.soap.SOAPService; -import org.apache.axis.message.RPCElement; -import org.apache.axis.message.RPCHeaderParam; -import org.apache.axis.message.RPCParam; -import org.apache.axis.message.SOAPBodyElement; -import org.apache.axis.message.SOAPEnvelope; -import org.apache.axis.soap.SOAPConstants; -import org.apache.axis.utils.JavaUtils; -import org.apache.axis.utils.Messages; - -import javax.xml.namespace.QName; -import java.util.Hashtable; -import java.util.Vector; - -public class ComProvider extends BasicProvider { - - - public void invoke(MessageContext msgContext) throws AxisFault { - try { - SOAPService service = msgContext.getService(); - String progID = (String) service.getOption(WSDDComProvider.OPTION_PROGID); - String threadingModel = (String) service.getOption(WSDDComProvider.OPTION_THREADING_MODEL); - - if (log.isDebugEnabled()) { - log.debug("Enter: COMProvider.processMessage()"); - } - - OperationDesc operation = msgContext.getOperation(); - - Vector bodies = msgContext.getRequestMessage().getSOAPEnvelope().getBodyElements(); - if (log.isDebugEnabled()) { - log.debug(Messages.getMessage("bodyElems00", "" + bodies.size())); - log.debug(Messages.getMessage("bodyIs00", "" + bodies.get(0))); - } - - RPCElement body = null; - - // Find the first "root" body element, which is the RPC call. - for (int bNum = 0; body == null && bNum < bodies.size(); bNum++) { - // If this is a regular old SOAPBodyElement, and it's a root, - // we're probably a non-wrapped doc/lit service. In this case, - // we deserialize the element, and create an RPCElement "wrapper" - // around it which points to the correct method. - // FIXME : There should be a cleaner way to do this... - if (!(bodies.get(bNum) instanceof RPCElement)) { - SOAPBodyElement bodyEl = (SOAPBodyElement) bodies.get(bNum); - // igors: better check if bodyEl.getID() != null - // to make sure this loop does not step on SOAP-ENC objects - // that follow the parameters! FIXME? - if (bodyEl.isRoot() && operation != null && bodyEl.getID() == null) { - ParameterDesc param = operation.getParameter(bNum); - // at least do not step on non-existent parameters! - if (param != null) { - Object val = bodyEl.getValueAsType(param.getTypeQName()); - body = new RPCElement("", - operation.getName(), - new Object[]{val}); - } - } - } else { - body = (RPCElement) bodies.get(bNum); - } - } - - String methodName = body.getMethodName(); - Vector args = body.getParams(); - int numArgs = args.size(); - - Vector argValues = new Vector(); - - // Put the values contained in the RPCParams into an array - // suitable for passing to java.lang.reflect.Method.invoke() - // Make sure we respect parameter ordering if we know about it - // from metadata, and handle whatever conversions are necessary - // (values -> Holders, etc) - for (int i = 0; i < numArgs; i++) { - RPCParam rpcParam = (RPCParam) args.get(i); - Object value = rpcParam.getObjectValue(); - - // first check the type on the paramter - ParameterDesc paramDesc = rpcParam.getParamDesc(); - - // if we found some type info try to make sure the value type is - // correct. For instance, if we deserialized a xsd:dateTime in - // to a Calendar and the service takes a Date, we need to convert - if (paramDesc != null && paramDesc.getJavaType() != null) { - - // Get the type in the signature (java type or its holder) - Class sigType = paramDesc.getJavaType(); - - // Convert the value into the expected type in the signature - value = JavaUtils.convert(value, - sigType); - - rpcParam.setObjectValue(value); - } - argValues.add(value); - } - - COMBridge bridge = new COMBridge(); - Hashtable props = new Hashtable(); - props.put("progid", progID); - if (threadingModel != null) - props.put("threadmodel", threadingModel); - - Object result = bridge.execute(methodName, argValues, props); - - RPCElement resBody = new RPCElement(methodName + "Response"); - resBody.setPrefix(body.getPrefix()); - resBody.setNamespaceURI(body.getNamespaceURI()); - resBody.setEncodingStyle(msgContext.getEncodingStyle()); - - Message resMsg = msgContext.getResponseMessage(); - SOAPEnvelope resEnv; - - // If we didn't have a response message, make sure we set one up - if (resMsg == null) { - resEnv = new SOAPEnvelope(msgContext.getSOAPConstants()); - - resMsg = new Message(resEnv); - msgContext.setResponseMessage(resMsg); - } else { - resEnv = resMsg.getSOAPEnvelope(); - } - - QName returnQName = operation.getReturnQName(); - if (returnQName == null) { - returnQName = new QName("", methodName + "Return"); - } - - // For SOAP 1.2, add a result - if (msgContext.getSOAPConstants() == - SOAPConstants.SOAP12_CONSTANTS) { - returnQName = Constants.QNAME_RPC_RESULT; - } - - RPCParam param = new RPCParam(returnQName, result); - param.setParamDesc(operation.getReturnParamDesc()); - if (!operation.isReturnHeader()) { - resBody.addParam(param); - } else { - resEnv.addHeader(new RPCHeaderParam(param)); - } - - resEnv.addBodyElement(resBody); - - } catch (Exception e) { - entLog.debug(Messages.getMessage("toAxisFault00"), e); - throw AxisFault.makeFault(e); - } catch (Throwable t) { - entLog.debug(Messages.getMessage("toAxisFault00")); - throw new AxisFault(Messages.getMessage("toAxisFault00"), t); - } - } - - public void initServiceDesc(SOAPService service, MessageContext msgContext) - throws AxisFault { - } -} diff --git a/axis-rt-core/src/main/java/org/apache/axis/providers/java/EJBProvider.java b/axis-rt-core/src/main/java/org/apache/axis/providers/java/EJBProvider.java index 5a27d3dba1..1511a4f1e5 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/providers/java/EJBProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/providers/java/EJBProvider.java @@ -444,11 +444,10 @@ protected Object getEJBHome(InitialContext context, String beanJndiName) /** * Override the default implementation such that we can include * special handling for {@link java.rmi.ServerException}. - *

    + *

    * Converts {@link java.rmi.ServerException} exceptions to * {@link InvocationTargetException} exceptions with the same cause. * This allows the axis framework to create a SOAP fault. - *

    * * @see org.apache.axis.providers.java.RPCProvider#invokeMethod(org.apache.axis.MessageContext, java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/security/servlet/ServletSecurityProvider.java b/axis-rt-core/src/main/java/org/apache/axis/security/servlet/ServletSecurityProvider.java index 68679aca6c..f0107c331f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/security/servlet/ServletSecurityProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/security/servlet/ServletSecurityProvider.java @@ -48,8 +48,6 @@ public class ServletSecurityProvider implements SecurityProvider { /** Authenticate a user from a username/password pair. * - * @param username the user name to check - * @param password the password to check * @return an AuthenticatedUser or null */ public AuthenticatedUser authenticate(MessageContext msgContext) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/security/simple/SimpleSecurityProvider.java b/axis-rt-core/src/main/java/org/apache/axis/security/simple/SimpleSecurityProvider.java index c9717a4681..9e13842900 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/security/simple/SimpleSecurityProvider.java +++ b/axis-rt-core/src/main/java/org/apache/axis/security/simple/SimpleSecurityProvider.java @@ -93,8 +93,6 @@ private synchronized void initialize(MessageContext msgContext) /** Authenticate a user from a username/password pair. * - * @param username the user name to check - * @param password the password to check * @return an AuthenticatedUser or null */ public AuthenticatedUser authenticate(MessageContext msgContext) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AdminServlet.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AdminServlet.java index 77527692e6..7cfc2a598a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AdminServlet.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AdminServlet.java @@ -41,9 +41,6 @@ * * @author Glen Daniels (gdaniels@apache.org) * @author Steve Loughran - * xdoclet tags are not active yet; keep web.xml in sync - * @web.servlet name="AdminServlet" display-name="Axis Admin Servlet" load-on-startup="100" - * @web.servlet-mapping url-pattern="/servlet/AdminServlet" */ public class AdminServlet extends AxisServletBase { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AutoRegisterServlet.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AutoRegisterServlet.java index ad02cfdbae..745b5d4a9a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AutoRegisterServlet.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AutoRegisterServlet.java @@ -41,8 +41,6 @@ /** * Servlet that autoregisters * @author Steve Loughran - * xdoclet tags are not active yet; keep web.xml in sync - * @web.servlet name="AutoRegisterServlet" display-name="Axis Autoregister Servlet" load-on-startup="30" */ public class AutoRegisterServlet extends AxisServletBase { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisHTTPSessionListener.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisHTTPSessionListener.java index 4d7a8e82d7..f91d67e046 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisHTTPSessionListener.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisHTTPSessionListener.java @@ -26,7 +26,6 @@ /** * A simple listener for Servlet 2.3 session lifecycle events. - * @web.listener * @author Glen Daniels (gdaniels@apache.org) */ public class AxisHTTPSessionListener implements HttpSessionListener { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServlet.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServlet.java index d1dd0d7bd5..8e2515485c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServlet.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServlet.java @@ -44,8 +44,6 @@ import org.apache.axis.Message; import org.apache.axis.MessageContext; import org.apache.axis.SimpleTargetedChain; -import org.apache.axis.client.Service; -import org.apache.axis.management.ServiceAdmin; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ServiceDesc; @@ -65,11 +63,6 @@ * To change the location of the services, change url-pattern in web.xml and * set parameter axis.servicesPath in server-config.wsdd. For more information see * Axis Reference Guide. - * - * @web.servlet name="AxisServlet" display-name="Apache-Axis Servlet" - * @web.servlet-mapping url-pattern="/servlet/AxisServlet" - * @web.servlet-mapping url-pattern="*.jws" - * @web.servlet-mapping url-pattern="/services/*" */ public class AxisServlet extends AxisServletBase { protected static Log log = @@ -198,14 +191,6 @@ public void init() throws javax.servlet.ServletException { } initQueryStringHandlers(); - - // Setup the service admin - try { - ServiceAdmin.setEngine(this.getEngine(), context.getServerInfo()); - } catch (AxisFault af) { - exceptionLog.info("Exception setting AxisEngine on ServiceAdmin " + - af); - } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServletBase.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServletBase.java index 6444af61a3..573a53d576 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServletBase.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/AxisServletBase.java @@ -19,7 +19,6 @@ import java.io.File; import java.io.IOException; -import java.util.Enumeration; import java.util.HashMap; import java.util.Map; @@ -118,7 +117,7 @@ public void init() throws javax.servlet.ServletException { * Destroy method is called when the servlet is going away. Pass this * down to the AxisEngine to let it clean up... But don't create the * engine if it hasn't already been created. - * @todo Fixme for multiple servlets. + * TODO: Fixme for multiple servlets. * This has always been slightly broken * (the context's copy stayed around), but now we have extracted it into * a superclass it is blatantly broken. @@ -156,7 +155,7 @@ public AxisServer getEngine() throws AxisFault { /** * This is a uniform method of initializing AxisServer in a servlet * context. - * @todo add catch for not being able to cast the context attr to an + * TODO: add catch for not being able to cast the context attr to an * engine and reinit the engine if so. */ public static AxisServer getEngine(HttpServlet servlet) throws AxisFault diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/HTTPSender.java b/axis-rt-core/src/main/java/org/apache/axis/transport/http/HTTPSender.java index 3e4cdb892e..206a4038b2 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/HTTPSender.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/http/HTTPSender.java @@ -47,7 +47,6 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.ArrayList; -import java.util.Collection; /** * This is meant to be used on a SOAP Client to call a SOAP server. diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalSender.java b/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalSender.java index 1e9cec04ce..d39d156152 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalSender.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalSender.java @@ -34,7 +34,7 @@ /** * This is meant to be used on a SOAP Client to call a SOAP server. * - * @author Sam Ruby + * @author Sam Ruby (rubys@us.ibm.com) */ public class LocalSender extends BasicHandler { protected static Log log = diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalTransport.java b/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalTransport.java index 891f9377bc..28d0303e52 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalTransport.java +++ b/axis-rt-core/src/main/java/org/apache/axis/transport/local/LocalTransport.java @@ -81,8 +81,8 @@ public void setRemoteService(String remoteServiceName) { /** * Set up any transport-specific derived properties in the message context. - * @param context the context to set up - * @param message the client service instance + * @param mc the context to set up + * @param call the client service instance * @param engine the engine containing the registries */ public void setupMessageContextImpl(MessageContext mc, diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Day.java b/axis-rt-core/src/main/java/org/apache/axis/types/Day.java index e3db2be371..06fbe53519 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Day.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Day.java @@ -22,7 +22,7 @@ /** * Implementation of the XML Schema type gDay * - * @author Tom Jordahl + * @author Tom Jordahl (tomj@macromedia.com) * @see XML Schema 3.2.13 */ public class Day implements java.io.Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Duration.java b/axis-rt-core/src/main/java/org/apache/axis/types/Duration.java index e726d7edd2..2ab0443ae4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Duration.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Duration.java @@ -24,7 +24,7 @@ * Implementation of the XML Schema type duration. Duration supports a minimum * fractional second precision of milliseconds. * - * @author Wes Moulder + * @author Wes Moulder (wes@themindelectric.com) * @author Dominik Kacprzak (dominik@opentoolbox.com) * @see XML Schema 3.2.6 */ @@ -68,7 +68,7 @@ public Duration(boolean negative, int aYears, int aMonths, int aDays, * PnYnMnDTnHnMnS. * * @param duration String - * @throws SchemaException if the string doesn't parse correctly. + * @throws IllegalArgumentException if the string doesn't parse correctly. */ public Duration(String duration) throws IllegalArgumentException { int position = 1; diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Entities.java b/axis-rt-core/src/main/java/org/apache/axis/types/Entities.java index 1b78005377..0ce90f617b 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Entities.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Entities.java @@ -20,7 +20,7 @@ /** * Custom class for supporting XSD data type Entities * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) * @see XML Schema 3.3.12 ENTITIES */ public class Entities extends NCName { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Entity.java b/axis-rt-core/src/main/java/org/apache/axis/types/Entity.java index 07e1746db9..0bb4f854f4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Entity.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Entity.java @@ -20,7 +20,7 @@ /** * Custom class for supporting XSD data type Entity * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) * @see XML Schema 3.3.11 ENTITY */ public class Entity extends NCName { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/HexBinary.java b/axis-rt-core/src/main/java/org/apache/axis/types/HexBinary.java index 55aef0392e..39ea253b64 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/HexBinary.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/HexBinary.java @@ -22,7 +22,7 @@ /** * Custom class for supporting primitive XSD data type hexBinary. * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class HexBinary extends Object implements java.io.Serializable{ diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/IDRef.java b/axis-rt-core/src/main/java/org/apache/axis/types/IDRef.java index e7b9ab6a8a..de26b503e9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/IDRef.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/IDRef.java @@ -20,7 +20,7 @@ /** * Custom class for supporting XSD data type IDRef * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) * @see XML Schema 3.3.10 IDREFS */ public class IDRef extends NCName { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/IDRefs.java b/axis-rt-core/src/main/java/org/apache/axis/types/IDRefs.java index 5572967570..c483e43d48 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/IDRefs.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/IDRefs.java @@ -23,7 +23,7 @@ /** * Custom class for supporting XSD data type IDRefs * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) * @see XML Schema 3.3.10 IDREFS */ public class IDRefs extends NCName { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Id.java b/axis-rt-core/src/main/java/org/apache/axis/types/Id.java index 7bfb1ddcce..e8b3e8f7e9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Id.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Id.java @@ -21,7 +21,7 @@ * Custom class for supporting XSD data type ID * The base type of Id is NCName. * - * @author Eddie Pick + * @author Eddie Pick (eddie@pick.eu.org) * @see XML Schema 3.3.8 */ public class Id extends NCName { @@ -49,7 +49,7 @@ public Id(String stValue) throws IllegalArgumentException { /** * * validates the data and sets the value for the object. - * @param Token String value + * @param stValue String value * @throws IllegalArgumentException if invalid format */ public void setValue(String stValue) throws IllegalArgumentException { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Language.java b/axis-rt-core/src/main/java/org/apache/axis/types/Language.java index b24a1b6307..fb0e0339a1 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Language.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Language.java @@ -26,7 +26,7 @@ * as defined in the language identification section of [XML 1.0 (Second Edition)]. * The base type of language is token. * - * @author Eddie Pick + * @author Eddie Pick (eddie@pick.eu.org) * @see XML Schema 3.3.3 */ public class Language extends Token { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Month.java b/axis-rt-core/src/main/java/org/apache/axis/types/Month.java index b1125d07fa..a73d7fc18c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Month.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Month.java @@ -22,7 +22,7 @@ /** * Implementation of the XML Schema type gMonth * - * @author Tom Jordahl + * @author Tom Jordahl (tomj@macromedia.com) * @see XML Schema 3.2.14 */ public class Month implements java.io.Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/MonthDay.java b/axis-rt-core/src/main/java/org/apache/axis/types/MonthDay.java index c23fc7dc57..c3ed7468eb 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/MonthDay.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/MonthDay.java @@ -22,7 +22,7 @@ /** * Implementation of the XML Schema type gMonthDay * - * @author Tom Jordahl + * @author Tom Jordahl (tomj@macromedia.com) * @see XML Schema 3.2.12 */ public class MonthDay implements java.io.Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NCName.java b/axis-rt-core/src/main/java/org/apache/axis/types/NCName.java index d011c947f2..cea8b93596 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NCName.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NCName.java @@ -24,7 +24,7 @@ * NCName represents XML "non-colonized" Names * The base type of NCName is Name. * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.7 * @see NCName Production */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NMToken.java b/axis-rt-core/src/main/java/org/apache/axis/types/NMToken.java index ed9ffd252a..f4cffd8c27 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NMToken.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NMToken.java @@ -26,7 +26,7 @@ * is the set of tokens that match the Nmtoken production * in [XML 1.0 (Second Edition)]. * The base type of NMTOKEN is token. - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.4 */ public class NMToken extends Token { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NMTokens.java b/axis-rt-core/src/main/java/org/apache/axis/types/NMTokens.java index 14f2932551..7cb5b7f7d1 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NMTokens.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NMTokens.java @@ -23,7 +23,7 @@ /** * Custom class for supporting XSD data type NMTokens * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class NMTokens extends NCName { private NMToken[] tokens; diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Name.java b/axis-rt-core/src/main/java/org/apache/axis/types/Name.java index ed80c81cff..4fc1d6fb24 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Name.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Name.java @@ -25,7 +25,7 @@ * the set of all strings which match the Name production * of [XML 1.0 (Second Edition)]. * The base type of Name is token. - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.6 */ public class Name extends Token { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NegativeInteger.java b/axis-rt-core/src/main/java/org/apache/axis/types/NegativeInteger.java index a09eb1550c..6ff352f79f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NegativeInteger.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NegativeInteger.java @@ -30,7 +30,7 @@ * negativeInteger is the infinite set {...,-2,-1}. * The base type of negativeInteger is nonPositiveInteger. * - * @author Chris Haddad + * @author Chris Haddad (haddadc@apache.org) * @see XML Schema 3.3.15 */ public class NegativeInteger extends NonPositiveInteger { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NonNegativeInteger.java b/axis-rt-core/src/main/java/org/apache/axis/types/NonNegativeInteger.java index 691e602fbf..56087c87f4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NonNegativeInteger.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NonNegativeInteger.java @@ -24,7 +24,7 @@ /** * Custom class for supporting primitive XSD data type nonNegativeInteger * - * @author Russell Butek + * @author Russell Butek (butek@us.ibm.com) * @see XML Schema 3.3.20 */ public class NonNegativeInteger extends BigInteger { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NonPositiveInteger.java b/axis-rt-core/src/main/java/org/apache/axis/types/NonPositiveInteger.java index 069e7ee369..d1bb293430 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NonPositiveInteger.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NonPositiveInteger.java @@ -29,7 +29,7 @@ * concept of the non-positive integers. The value space of * nonPositiveInteger is the infinite set {...,-2,-1,0}. * - * @author Chris Haddad XML Schema 3.3.14 */ public class NonPositiveInteger extends BigInteger { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/NormalizedString.java b/axis-rt-core/src/main/java/org/apache/axis/types/NormalizedString.java index 6831a1e817..c80577975a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/NormalizedString.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/NormalizedString.java @@ -22,7 +22,7 @@ * normalizedString represents white space normalized strings. * The base type of normalizedString is string. * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema Part 2: Datatypes 3.3.1 */ public class NormalizedString extends Object implements java.io.Serializable { @@ -76,7 +76,7 @@ public int hashCode(){ * nor tab (#x9) characters. * * @param stValue the String to test - * @returns true if valid normalizedString + * @return true if valid normalizedString */ public static boolean isValid(String stValue) { int scan; diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Notation.java b/axis-rt-core/src/main/java/org/apache/axis/types/Notation.java index 256d079a8d..53c531d350 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Notation.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Notation.java @@ -24,7 +24,7 @@ /** * Custom class for supporting XSD data type NOTATION. * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) * @see XML Schema Part 1: 3.12 Notation Declarations */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/PositiveInteger.java b/axis-rt-core/src/main/java/org/apache/axis/types/PositiveInteger.java index e63d773759..dc98b7f2e0 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/PositiveInteger.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/PositiveInteger.java @@ -28,7 +28,7 @@ * This results in the standard mathematical concept of the positive integer numbers. The value space * of positiveInteger is the infinite set {1,2,...}. * - * @author Chris Haddad + * @author Chris Haddad (haddadc@apache.org) * @see XML Schema 3.3.25 */ public class PositiveInteger extends NonNegativeInteger { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Schema.java b/axis-rt-core/src/main/java/org/apache/axis/types/Schema.java index 69dcd7cc7d..7a20aa2c6b 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Schema.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Schema.java @@ -19,7 +19,7 @@ /** * Custom class for supporting XSD schema * - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class Schema implements java.io.Serializable { private org.apache.axis.message.MessageElement[] _any; diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Token.java b/axis-rt-core/src/main/java/org/apache/axis/types/Token.java index 821bf8a5a2..d530e30305 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Token.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Token.java @@ -22,7 +22,7 @@ * token represents tokenized strings. * The base type of token is normalizedString. * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.2 */ public class Token extends NormalizedString { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/URI.java b/axis-rt-core/src/main/java/org/apache/axis/types/URI.java index bec9df887b..86cceec94d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/URI.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/URI.java @@ -1682,7 +1682,7 @@ public boolean equals(Object p_test) { /** * Returns a hash-code value for this URI. The hash code is based upon all * of the URI's components, and satisfies the general contract of the - * {@link java.lang.Object#hashCode() Object.hashCode} method.

    + * {@link java.lang.Object#hashCode() Object.hashCode} method. * * @return A hash-code value for this URI */ @@ -1765,7 +1765,7 @@ public static boolean isConformantSchemeName(String p_scheme) { * '.'. Each group must consist of one to three digits. See RFC 2732 Section 3, * and RFC 2373 Section 2.2, for the definition of IPv6 references. A hostname * consists of domain labels (each of which must begin and end with an alphanumeric - * but may contain '-') separated & by a '.'. See RFC 2396 Section 3.2.2. + * but may contain '-') separated & by a '.'. See RFC 2396 Section 3.2.2. * * @return true if the string is a syntactically valid IPv4 address, * IPv6 reference or hostname diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedByte.java b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedByte.java index d42361cf64..4050b98f78 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedByte.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedByte.java @@ -21,7 +21,7 @@ /** * Custom class for supporting primitive XSD data type UnsignedByte * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.24 */ public class UnsignedByte extends UnsignedShort { @@ -33,7 +33,7 @@ public UnsignedByte() { /** * ctor for UnsignedByte - * @exception Exception will be thrown if validation fails + * @exception NumberFormatException will be thrown if validation fails */ public UnsignedByte(long sValue) throws NumberFormatException { setValue(sValue); diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedInt.java b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedInt.java index 58bb908d06..9b53d3992e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedInt.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedInt.java @@ -22,7 +22,7 @@ /** * Custom class for supporting primitive XSD data type UnsignedInt * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.22 */ public class UnsignedInt extends java.lang.Number implements java.lang.Comparable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedLong.java b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedLong.java index a545ce5c40..4332d0644d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedLong.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedLong.java @@ -22,7 +22,7 @@ /** * Custom class for supporting primitive XSD data type UnsignedLong * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.21 */ public class UnsignedLong extends java.lang.Number diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedShort.java b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedShort.java index 3939be065e..9da91264cc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedShort.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/UnsignedShort.java @@ -20,7 +20,7 @@ /** * Custom class for supporting primitive XSD data type UnsignedShort * - * @author Chris Haddad + * @author Chris Haddad (chaddad@cobia.net) * @see XML Schema 3.3.23 */ public class UnsignedShort extends UnsignedInt { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/Year.java b/axis-rt-core/src/main/java/org/apache/axis/types/Year.java index 70aae5df01..94669a094b 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/Year.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/Year.java @@ -22,7 +22,7 @@ /** * Implementation of the XML Schema type gYear * - * @author Tom Jordahl + * @author Tom Jordahl (tomj@macromedia.com) * @see XML Schema 3.2.11 */ public class Year implements java.io.Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/types/YearMonth.java b/axis-rt-core/src/main/java/org/apache/axis/types/YearMonth.java index 2e77698579..e76db1e825 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/types/YearMonth.java +++ b/axis-rt-core/src/main/java/org/apache/axis/types/YearMonth.java @@ -22,7 +22,7 @@ /** * Implementation of the XML Schema type gYearMonth * - * @author Tom Jordahl + * @author Tom Jordahl (tomj@macromedia.com) * @see XML Schema 3.2.10 */ public class YearMonth implements java.io.Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/BeanPropertyDescriptor.java b/axis-rt-core/src/main/java/org/apache/axis/utils/BeanPropertyDescriptor.java index f7edf1d041..8efd8609aa 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/BeanPropertyDescriptor.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/BeanPropertyDescriptor.java @@ -38,7 +38,7 @@ * concerned, mostly involving the fact that we manage the arrays here * rather than relying on the value type class to do it itself. * - * @author Rich Scheuerle + * @author Rich Scheuerle (scheu@us.ibm.com) * @author Glen Daniels (gdaniels@apache.org) **/ public class BeanPropertyDescriptor diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/ByteArrayOutputStream.java b/axis-rt-core/src/main/java/org/apache/axis/utils/ByteArrayOutputStream.java index d80deac16a..3901a4359c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/ByteArrayOutputStream.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/ByteArrayOutputStream.java @@ -25,14 +25,14 @@ * This class implements an output stream in which the data is * written into a byte array. The buffer automatically grows as data * is written to it. - *

    + *

    * The data can be retrieved using toByteArray() and * toString(). - *

    + *

    * Closing a ByteArrayOutputStream has no effect. The methods in * this class can be called after the stream has been closed without * generating an IOException. - *

    + *

    * This is an alternative implementation of the java.io.ByteArrayOutputStream * class. The original implementation only allocates 32 bytes at the beginning. * As this class is designed for heavy duty it starts at 1024 bytes. In contrast diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/ClassUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/ClassUtils.java index 709a626538..d0ae7c1ad1 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/ClassUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/ClassUtils.java @@ -161,30 +161,33 @@ public Object run() { * Get an input stream from a named resource. * Tries *

      - *
    1. the classloader that loaded "clazz" first, + *
    2. the thread context class loader + *
    3. the given fallback classloader *
    4. the system classloader - *
    5. the class "clazz" itself *
    - * @param clazz class to use in the lookups * @param resource resource string to look for - * @param checkThreadContextFirst check the thread context first? + * @param fallbackClassLoader the class loader to use if the resource could not be loaded from + * the thread context class loader * @return input stream if found, or null */ - public static InputStream getResourceAsStream(Class clazz, String resource, boolean checkThreadContextFirst) { - InputStream myInputStream = null; + public static InputStream getResourceAsStream(String resource, ClassLoader fallbackClassLoader) { + InputStream is = null; - if (checkThreadContextFirst && - Thread.currentThread().getContextClassLoader() != null) { + ClassLoader tccl = Thread.currentThread().getContextClassLoader(); + if (tccl != null) { // try the context class loader. - myInputStream = - Thread.currentThread().getContextClassLoader() - .getResourceAsStream(resource); + is = tccl.getResourceAsStream(resource); } - if (myInputStream == null) { + if (is == null) { // if not found in context class loader fall back to default - myInputStream = getResourceAsStream(clazz, resource); + if (fallbackClassLoader != null) { + is = fallbackClassLoader.getResourceAsStream(resource); + } else { + // Try the system class loader. + is = ClassLoader.getSystemClassLoader().getResourceAsStream(resource); + } } - return myInputStream; + return is; } /** diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/IOUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/IOUtils.java index 411b1f9aaf..84075d7bca 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/IOUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/IOUtils.java @@ -44,7 +44,7 @@ public static int readFully(InputStream in, byte[] b) * Same as the normal in.read(b, off, len), but tries to ensure that * the entire len number of bytes is read. *

    - * @returns the number of bytes read, or -1 if the end of file is + * @return the number of bytes read, or -1 if the end of file is * reached before any bytes are read */ public static int readFully(InputStream in, byte[] b, int off, int len) diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/IdentityHashMap.java b/axis-rt-core/src/main/java/org/apache/axis/utils/IdentityHashMap.java index 50099c7fdd..264bbafda9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/IdentityHashMap.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/IdentityHashMap.java @@ -12,7 +12,7 @@ /** * IdentityHashMap similar to JDK1.4's java.util.IdentityHashMap - * @author Davanum Srinivas + * @author Davanum Srinivas (dims@yahoo.com) */ public class IdentityHashMap extends HashMap { diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/JavaUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/JavaUtils.java index 4fbb501644..7375d9eb3a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/JavaUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/JavaUtils.java @@ -18,13 +18,12 @@ import org.apache.axis.attachments.AttachmentPart; import org.apache.axis.attachments.OctetStream; -import org.apache.axis.components.image.ImageIO; -import org.apache.axis.components.image.ImageIOFactory; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.types.HexBinary; import org.apache.commons.logging.Log; import javax.activation.DataHandler; +import javax.imageio.ImageIO; import javax.xml.soap.SOAPException; import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; @@ -32,7 +31,6 @@ import java.beans.Introspector; import java.io.IOException; import java.io.InputStream; -import java.io.StringReader; import java.io.ByteArrayOutputStream; import java.lang.reflect.Array; import java.lang.reflect.Field; @@ -227,8 +225,8 @@ public interface ConvertCache { /** Utility function to convert an Object to some desired Class. * * Right now this works for: - * arrays <-> Lists, - * Holders <-> held values + * arrays <-> Lists, + * Holders <-> held values * @param arg the array to convert * @param destClass the actual class we want */ @@ -322,14 +320,7 @@ else if (arg instanceof DataHandler) { return null; } else { - ImageIO imageIO = ImageIOFactory.getImageIO(); - if (imageIO != null) { - return getImageFromStream(is); - } - else { - log.info(Messages.getMessage("needImageIO")); - return arg; - } + return ImageIO.read(is); } } else if (destClass == javax.xml.transform.Source.class) { @@ -678,9 +669,12 @@ public static boolean isConvertable(Object obj, Class dest, boolean isEncoded) return false; } + /** + * @deprecated Use {@link ImageIO#read(InputStream)} instead. + */ public static Image getImageFromStream(InputStream is) { try { - return ImageIOFactory.getImageIO().loadImage(is); + return ImageIO.read(is); } catch (Throwable t) { return null; diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/Messages.java b/axis-rt-core/src/main/java/org/apache/axis/utils/Messages.java index 8dcfc6ac61..3d1610635a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/Messages.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/Messages.java @@ -55,8 +55,6 @@ public class Messages { /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @return The formatted message */ @@ -68,8 +66,6 @@ public static String getMessage(String key) /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @param arg0 The argument to place in variable {0} * @return The formatted message @@ -82,8 +78,6 @@ public static String getMessage(String key, String arg0) /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -97,8 +91,6 @@ public static String getMessage(String key, String arg0, String arg1) /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -113,8 +105,6 @@ public static String getMessage(String key, String arg0, String arg1, String arg /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -130,8 +120,6 @@ public static String getMessage(String key, String arg0, String arg1, String arg /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key * @param arg0 The argument to place in variable {0} * @param arg1 The argument to place in variable {1} @@ -148,10 +136,8 @@ public static String getMessage(String key, String arg0, String arg1, String arg /** * Get a message from resource.properties from the package of the given object. - * @param caller The calling object, used to get the package name and class loader - * @param locale The locale * @param key The resource key - * @param array An array of objects to place in corresponding variables + * @param args An array of objects to place in corresponding variables * @return The formatted message */ public static String getMessage(String key, String[] args) diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/NSStack.java b/axis-rt-core/src/main/java/org/apache/axis/utils/NSStack.java index 819685482f..6fcc6829e7 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/NSStack.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/NSStack.java @@ -16,8 +16,6 @@ package org.apache.axis.utils; import org.apache.axis.components.logger.LogFactory; -import org.apache.axis.AxisProperties; -import org.apache.axis.Constants; import org.apache.commons.logging.Log; import java.util.ArrayList; @@ -202,11 +200,13 @@ public void add(String namespaceURI, String prefix) { * up the stack IF the prefix which was used has been repeated further * down the stack. I.e.: * - * - * + *

    +     * <pre:outer xmlns:pre="namespace">
    +     *   <pre:inner xmlns:pre="otherNamespace">
          *      *here's where we're looking*
    -     *   
    -     * 
    +     *   </pre:inner>
    +     * </pre:outer>
    +     * 
    * * If we look for a prefix for "namespace" at the indicated spot, we won't * find one because "pre" is actually mapped to "otherNamespace" diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/StringUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/StringUtils.java index 383fd37dbe..e5fc76a62f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/StringUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/StringUtils.java @@ -19,6 +19,8 @@ import org.apache.axis.InternalException; import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; import java.util.List; import java.io.Writer; import java.io.IOException; @@ -120,6 +122,30 @@ public static String[] split(String str, char separatorChar) { return (String[]) list.toArray(new String[list.size()]); } + /** + * Joins the elements of the provided collection into a single string using + * the given separator. + * + * @param items + * the collection of strings to join together + * @param separatorChar + * the separator character to use + * @return the joined string + */ + public static String join(Collection items, char separatorChar) { + StringBuffer buffer = new StringBuffer(); + boolean first = true; + for (Iterator it = items.iterator(); it.hasNext(); ) { + if (first) { + first = false; + } else { + buffer.append(separatorChar); + } + buffer.append((String)it.next()); + } + return buffer.toString(); + } + // Empty checks //----------------------------------------------------------------------- /** @@ -361,7 +387,7 @@ public static void escapeNumericChar(Writer out, String str) *

    Unescapes numeric character referencs found in the String.

    * *

    For example, it will return a unicode string which means the specified numeric - * character references looks like "ようこそ".

    + * character references looks like "&#x3088;&#x3046;&#x3053;&#x305d;".

    * * @param str the String to unescape, may be null * @return a new unescaped String, null if null string input @@ -386,7 +412,7 @@ public static String unescapeNumericChar(String str) { * Writer.

    * *

    For example, it will return a unicode string which means the specified numeric - * character references looks like "ようこそ".

    + * character references looks like "&#x3088;&#x3046;&#x3053;&#x305d;".

    * *

    A null string input has no effect.

    * diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/WSDLUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/WSDLUtils.java index 4886fdcc1d..2f0f0a9380 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/WSDLUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/WSDLUtils.java @@ -31,7 +31,7 @@ public class WSDLUtils { LogFactory.getLog(WSDLUtils.class.getName()); /** - * Return the endpoint address from a tag + * Return the endpoint address from a <soap:address location="..."> tag */ public static String getAddressFromPort(Port p) { // Get the endpoint for a port diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/XMLUtils.java b/axis-rt-core/src/main/java/org/apache/axis/utils/XMLUtils.java index 62bd888182..027935443c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/XMLUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/XMLUtils.java @@ -819,7 +819,7 @@ private static InputSource getInputSourceFromURI(String uri, uconn.setDefaultUseCaches(false); uconn.setDoInput(true); uconn.setDoOutput(false); - uconn.setInstanceFollowRedirects(true); + uconn.setInstanceFollowRedirects(false); uconn.setUseCaches(false); // username/password info in the URL overrides passed in values diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/bytecode/ClassReader.java b/axis-rt-core/src/main/java/org/apache/axis/utils/bytecode/ClassReader.java index 73c218dca0..2cc0a1d99c 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/bytecode/ClassReader.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/bytecode/ClassReader.java @@ -59,6 +59,16 @@ public class ClassReader extends ByteArrayInputStream { private static final int CONSTANT_Double = 6; private static final int CONSTANT_NameAndType = 12; private static final int CONSTANT_Utf8 = 1; + + /*java 8 9 10 11 new tokens https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html*/ + private static final int CONSTANT_MethodHandle = 15; + private static final int CONSTANT_MethodType = 16; + private static final int CONSTANT_Dynamic = 17; + private static final int CONSTANT_InvokeDynamic = 18; + private static final int CONSTANT_Module = 19; + private static final int CONSTANT_Package = 20; + /*end of ava 8 9 10 11 new tokens*/ + /** * the constant pool. constant pool indices in the class file * directly index into this array. The value stored in this array @@ -346,12 +356,31 @@ protected final void readCpool() throws IOException { int len = readShort(); skipFully(len); + break; + case CONSTANT_MethodHandle: + + read(); // reference kind + readShort(); // reference index + break; + + case CONSTANT_MethodType: + + readShort(); // descriptor index + break; + + case CONSTANT_Dynamic: + readShort(); // bootstrap method attr index + readShort(); // name and type index + break; + case CONSTANT_InvokeDynamic: + + readShort(); // bootstrap method attr index + readShort(); // name and type index break; default: // corrupt class file - throw new IllegalStateException( - Messages.getMessage("unexpectedBytes00")); + throw new IllegalStateException("Error looking for paramter names in bytecode: unexpected bytes in file, tag:"+c); } } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaClass.java b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaClass.java index 8c20978e35..a3c271373e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaClass.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaClass.java @@ -23,7 +23,7 @@ /** * A simple cache of previously loaded classes, and their methods. * - * @author Sam Ruby + * @author Sam Ruby (rubys@us.ibm.com) */ public class JavaClass implements Serializable { diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaMethod.java b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaMethod.java index cf99fbbd4d..f2c2a58641 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaMethod.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/JavaMethod.java @@ -22,7 +22,7 @@ /** * A simple cache of previously loaded methods * - * @author Sam Ruby + * @author Sam Ruby (rubys@us.ibm.com) */ public class JavaMethod { @@ -56,7 +56,6 @@ public JavaMethod(Class jc, String name) { /** * Lookup a method based on name. This method returns an array just in * case there is more than one. - * @param name name of method */ public Method[] getMethod() { return methods; diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/MethodCache.java b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/MethodCache.java index dca17f0b72..7eb25e4454 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/cache/MethodCache.java +++ b/axis-rt-core/src/main/java/org/apache/axis/utils/cache/MethodCache.java @@ -28,8 +28,8 @@ * cache for performance reasons. * This class is a singleton - so use getInstance to get an instance of it. * - * @author Davanum Srinivas - * @author Sebastian Dietrich + * @author Davanum Srinivas (dims@yahoo.com) + * @author Sebastian Dietrich (sebastian.dietrich@anecon.com) */ public class MethodCache { /** diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/fromJava/Types.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/fromJava/Types.java index c9a7b87a43..45daab78a0 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/fromJava/Types.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/fromJava/Types.java @@ -65,9 +65,9 @@ import java.util.Set; /** - *

    Description:

    This class is used to recursively serializes a Java Class into + * This class is used to recursively serializes a Java Class into * an XML Schema representation. - *

    + *

    * It has utility methods to create a schema node, assosiate namespaces to the various types * * @author unascribed @@ -1001,7 +1001,7 @@ private void writeWsdlTypesElement() { * Write a schema representation for the given Class. Recurse * through all the public fields as well as fields represented by java * bean compliant accessor methods. - *

    + *

    * Then return the qualified string representation of the generated type * * @param type Class for which to generate schema @@ -1016,7 +1016,7 @@ public String writeType(Class type) throws AxisFault { * Write a schema representation for the given Class. Recurse * through all the public fields as well as fields represented by java * bean compliant accessor methods. - *

    + *

    * Then return the qualified string representation of the generated type * * @param type Class for which to generate schema diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Generator.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Generator.java index 27ca71026b..8a2db3ffc7 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Generator.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Generator.java @@ -20,7 +20,7 @@ /** * This is the interface for all writers. All writers, very simply, must * support a write method. - *

    + *

    * Writer and WriterFactory are part of the Writer framework. Folks who want * to use the emitter to generate stuff from WSDL should do 3 things: * 1. Write implementations of the Writer interface, one each for PortType, diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Parser.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Parser.java index 2ddc0cfdd4..0a6e15431f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Parser.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/gen/Parser.java @@ -15,6 +15,7 @@ */ package org.apache.axis.wsdl.gen; +import org.apache.axis.components.logger.LogFactory; import org.apache.axis.utils.Messages; import org.apache.axis.wsdl.symbolTable.BindingEntry; import org.apache.axis.wsdl.symbolTable.CollectionElement; @@ -26,6 +27,7 @@ import org.apache.axis.wsdl.symbolTable.Type; import org.apache.axis.wsdl.symbolTable.TypeEntry; import org.apache.axis.wsdl.symbolTable.Utils; +import org.apache.commons.logging.Log; import org.w3c.dom.Document; import org.xml.sax.EntityResolver; import org.xml.sax.SAXException; @@ -34,6 +36,7 @@ import javax.wsdl.Definition; import javax.wsdl.WSDLException; import javax.xml.parsers.ParserConfigurationException; + import java.io.IOException; import java.util.Collection; import java.util.Iterator; @@ -44,6 +47,7 @@ * This is a class with no documentation. */ public class Parser { + private static final Log log = LogFactory.getLog(Parser.class.getName()); /** Field debug */ protected boolean debug = false; @@ -304,7 +308,7 @@ public String getWSDLURI() { /** * Parse a WSDL at a given URL. - *

    + *

    * This method will time out after the number of milliseconds specified * by our timeoutms member. * @@ -345,7 +349,14 @@ public void run(String wsdlURI) throws Exception { } if (runnable.getFailure() != null) { - throw runnable.getFailure(); + Throwable failure = runnable.getFailure(); + if (failure instanceof Exception) { + throw (Exception)failure; + } else if (failure instanceof Error){ + throw (Error)failure; + } else { + throw new Error(failure); + } } } // run @@ -363,7 +374,7 @@ private class WSDLRunnable implements Runnable { private String wsdlURI; /** Field failure */ - private Exception failure = null; + private Throwable failure = null; /** * Constructor WSDLRunnable @@ -384,7 +395,7 @@ public void run() { try { symbolTable.populate(wsdlURI, username, password); generate(symbolTable); - } catch (Exception e) { + } catch (Throwable e) { failure = e; } } // run @@ -394,7 +405,7 @@ public void run() { * * @return */ - public Exception getFailure() { + public Throwable getFailure() { return failure; } // getFailure } // WSDLRunnable @@ -435,6 +446,13 @@ protected void sanityCheck(SymbolTable symbolTable) { // do nothing. } + private static void generate(Generator gen) throws IOException { + if (log.isDebugEnabled()) { + log.debug("Invoking generator " + gen); + } + gen.generate(); + } + /** * Method generate * @@ -498,7 +516,7 @@ private void generate(SymbolTable symbolTable) throws IOException { } if (gen != null) { - gen.generate(); + generate(gen); } } } @@ -507,7 +525,7 @@ private void generate(SymbolTable symbolTable) throws IOException { // outside of the recursive emit method. Generator gen = genFactory.getGenerator(def, symbolTable); - gen.generate(); + generate(gen); } // generate /** @@ -542,7 +560,7 @@ private void generateTypes(SymbolTable symbolTable) throws IOException { && (type.getBaseType() == null)) { Generator gen = genFactory.getGenerator(type, symbolTable); - gen.generate(); + generate(gen); } } @@ -569,7 +587,7 @@ private void generateTypes(SymbolTable symbolTable) throws IOException { && (type.getBaseType() == null)) { Generator gen = genFactory.getGenerator(type, symbolTable); - gen.generate(); + generate(gen); } } } // generateTypes diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BackslashUtil.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BackslashUtil.java index 3e88bd50d2..4b0a13e955 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BackslashUtil.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BackslashUtil.java @@ -27,7 +27,7 @@ public class BackslashUtil implements java.io.Serializable { /** - * @param QName[local] that may contain unescaped backslashes + * @param suspectQName QName[local] that may contain unescaped backslashes * @return QName[local] w/ no backslashes */ @@ -40,7 +40,7 @@ public static QName getQNameWithBackslashlessLocal(QName suspectQName) { } /** - * @param QName[local] which may contain unescaped backslashes + * @param suspectQName QName[local] which may contain unescaped backslashes * @return QName[local] w/ escaped backslashes */ @@ -78,7 +78,7 @@ public static String stripBackslashes(String string) { } /** - * Slave method for applyBackslashes & stripBackslashes . + * Slave method for applyBackslashes & stripBackslashes . * */ public static String transformBackslashes(String string, boolean delete) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BindingEntry.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BindingEntry.java index ae0ff09437..b597fa5652 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BindingEntry.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/BindingEntry.java @@ -152,7 +152,7 @@ public BindingEntry(Binding binding, int bindingType, Style bindingStyle, * operation outputBodyTypes = USE_ENCODED * operation faultBodyTypes = USE_ENCODED * mimeTypes = null - *

    + *

    * The caller of this constructor should * also call the various setter methods to fully fill out this object: * setBindingType, setBindingStyle, setHasLiteral, setAttribute, diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionElement.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionElement.java index b25c2ab429..1ae3f84fbc 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionElement.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionElement.java @@ -22,10 +22,10 @@ /** * This Element is for a QName that is a 'collection'. * For example, - * + * <element ref="bar" maxOccurs="unbounded" /> * We need a way to indicate in the symbol table that a foo is * 'collection of bars', In such cases a collection element is - * added with the special QName [, ] + * added with the special QName <name>[<minOccurs>, <maxOccurs>] */ public class CollectionElement extends DefinedElement implements CollectionTE { diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionType.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionType.java index d4e44b9171..6bcaa50175 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionType.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/CollectionType.java @@ -22,10 +22,10 @@ /** * This Type is for a QName that is a 'collection'. * For example, - * + * <element name="foo" type="bar" maxOccurs="unbounded" /> * We need a way to indicate in the symbol table that a foo is * 'collection of bars', In such cases a collection type is - * added with the special QName [, ] + * added with the special QName <name>[<minOccurs>, <maxOccurs>] */ public class CollectionType extends DefinedType implements CollectionTE { diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ElementDecl.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ElementDecl.java index c2d09a67a0..45aecda93d 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ElementDecl.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ElementDecl.java @@ -19,7 +19,7 @@ /** * Simple utility struct for holding element declarations. - *

    + *

    * This simply correlates a QName to a TypeEntry. * * @author Glen Daniels (gdaniels@apache.org) diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/FaultInfo.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/FaultInfo.java index ae46774776..8c58f77339 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/FaultInfo.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/FaultInfo.java @@ -51,11 +51,11 @@ public class FaultInfo { /** * This constructor creates FaultInfo for a binding fault. - *

    + *

    * If the part of the fault is a type, then the QName is * derived from the element name and the provided namespace * (this namespace SHOULD come from the binding). - *

    + *

    * If the part of the fault is an element, then the QName is * the QName of the element, and the given namespace is ignored. * @@ -187,11 +187,11 @@ public Use getUse() { /** * Return the QName of a fault. This method may return null if no parts * are in the fault message. - *

    + *

    * If the part of the fault is a type, then the QName is * derived from the element name and the provided namespace * (this namespace SHOULD come from the binding). - *

    + *

    * If the part of the fault is an element, then the QName is * the QName of the element, and the given namespace is ignored. * diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SchemaUtils.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SchemaUtils.java index 0e262b1aeb..956d7f982e 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SchemaUtils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SchemaUtils.java @@ -16,7 +16,6 @@ package org.apache.axis.wsdl.symbolTable; import org.apache.axis.Constants; -import org.apache.axis.AxisProperties; import org.apache.axis.i18n.Messages; import org.apache.axis.utils.JavaUtils; import org.w3c.dom.DOMException; @@ -27,7 +26,6 @@ import javax.xml.namespace.QName; import javax.xml.rpc.holders.BooleanHolder; import javax.xml.rpc.holders.IntHolder; -import javax.xml.rpc.holders.BooleanHolder; import javax.xml.rpc.holders.QNameHolder; import java.util.Arrays; import java.util.HashSet; @@ -1340,18 +1338,18 @@ public static QName getArrayComponentQName(Node node, /** * If the specified node represents an element that references a collection * then return the qname repesenting the component of the collection. - *

    - * + *

    + * <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/> * returns qname for"xsd:string" - *

    - * - * - * - * - * + *

    + * <xsd:complexType> + * <xsd:sequence> + * <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/> + * </xsd:sequence> + * </xsd:complexType> * returns qname for"xsd:string" - *

    - * + *

    + * <xsd:element ref="alias" maxOccurs="unbounded"/> * returns qname for "alias" * * @param node is the Node @@ -1883,17 +1881,17 @@ private static void addAttributeGroupToVector(Vector v, Node attrGrpnode, * Return the attribute names and types if any in the node * The even indices are the attribute types (TypeEntry) and * the odd indices are the corresponding names (Strings). - *

    + *

    * Example: - * - * - * - * - * - * - * - * - * + * <complexType name="Person"> + * <sequence> + * <element minOccurs="1" maxOccurs="1" name="Age" type="double" /> + * <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float" /> + * </sequence> + * <attribute name="Name" type="string" /> + * <attribute name="Male" type="boolean" /> + * <attributeGroup ref="s0:MyAttrSet" /> + * </complexType> * * @param node * @param symbolTable @@ -2064,8 +2062,8 @@ public static TypeEntry getBaseType(TypeEntry type, SymbolTable symbolTable) { } /** - * Returns whether the specified node represents a - * with a nested . + * Returns whether the specified node represents a <xsd:simpleType> + * with a nested <xsd:list itemType="...">. * @param node * @return */ @@ -2075,7 +2073,7 @@ public static boolean isListWithItemType(Node node) { } /** - * Returns the value of itemType attribute of in + * Returns the value of itemType attribute of <xsd:list> in <xsd:simpleType> * @param node * @return */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ServiceEntry.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ServiceEntry.java index 01ba5d80d6..9e0fa37ea4 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ServiceEntry.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/ServiceEntry.java @@ -39,11 +39,6 @@ public ServiceEntry(Service service) { this.service = service; } // ctor - /** - * - * @param originalServiceName - * - */ public String getOriginalServiceName(){ return this.originalServiceName; } diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymTabEntry.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymTabEntry.java index 142410b332..5763352bb1 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymTabEntry.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymTabEntry.java @@ -147,9 +147,11 @@ public String toString() { */ protected String toString(String indent) { - String string = indent + "QName: " + qname + '\n' + indent - + "name: " + name + '\n' + indent - + "isReferenced? " + isReferenced + '\n'; + StringBuffer buffer = new StringBuffer(); + buffer.append(indent).append("QName: ").append(qname).append('\n'); + buffer.append(indent).append("Class: ").append(this.getClass().getName()).append('\n'); + buffer.append(indent).append("name: ").append(name).append('\n'); + buffer.append(indent).append("isReferenced? ").append(isReferenced).append('\n'); String prefix = indent + "dynamicVars: "; Iterator entries = dynamicVars.entrySet().iterator(); @@ -157,10 +159,10 @@ protected String toString(String indent) { Map.Entry entry = (Map.Entry) entries.next(); Object key = entry.getKey(); - string += prefix + key + " = " + entry.getValue() + '\n'; + buffer.append(prefix).append(key).append(" = ").append(entry.getValue()).append('\n'); prefix = indent + " "; } - return string; + return buffer.toString(); } // toString } // abstract class SymTabEntry diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymbolTable.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymbolTable.java index aefb3f12e7..5f295040e5 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymbolTable.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/SymbolTable.java @@ -89,8 +89,8 @@ /** * This class represents a table of all of the top-level symbols from a set of WSDL Definitions and * DOM Documents: XML types; WSDL messages, portTypes, bindings, and services. - *

    - * This symbolTable contains entries of the form where key is of type QName and value is + *

    + * This symbolTable contains entries of the form <key, value> where key is of type QName and value is * of type Vector. The Vector's elements are all of the objects that have the given QName. This is * necessary since names aren't unique among the WSDL types. message, portType, binding, service, * could all have the same QName and are differentiated merely by type. SymbolTable contains @@ -142,7 +142,7 @@ public class SymbolTable { private final Map typeIndex = Collections.unmodifiableMap(typeTypeEntries); /** - * cache of nodes -> base types for complexTypes. The cache is + * cache of nodes -> base types for complexTypes. The cache is * built on nodes because multiple TypeEntry objects may use the * same node. */ @@ -366,7 +366,7 @@ public Vector getTypes() { } // getTypes /** - * Return an unmodifiable map of qnames -> Elements in the symbol + * Return an unmodifiable map of qnames -> Elements in the symbol * table. * * @return an unmodifiable Map value @@ -376,7 +376,7 @@ public Map getElementIndex() { } /** - * Return an unmodifiable map of qnames -> Elements in the symbol + * Return an unmodifiable map of qnames -> Elements in the symbol * table. * * @return an unmodifiable Map value @@ -1515,16 +1515,16 @@ private void populateMessages(Definition def) throws IOException { /** * ensures that a message in a <input>, <output>, - * or <fault> element in an <operation> + * or <fault> element in an <operation> * element is valid. In particular, ensures that *

      *
    1. an attribute message is present (according to the * XML Schema for WSDL 1.1 message is required - *

      + *

      *

    2. the value of attribute message (a QName) refers to * an already defined message *
    - *

    + *

    * Note: this method should throw a javax.wsdl.WSDLException rather than * a java.io.IOException * @@ -1554,9 +1554,9 @@ protected void ensureOperationMessageValid(Message message) /** * ensures that an an element <operation> within - * an element <portType> is valid. Throws an exception + * an element <portType> is valid. Throws an exception * if the operation is not valid. - *

    + *

    * Note: this method should throw a javax.wsdl.WSDLException * rather than a java.io.IOException * @@ -1619,7 +1619,7 @@ protected void ensureOperationValid(Operation operation) /** * ensures that an an element <portType> * is valid. Throws an exception if the portType is not valid. - *

    + *

    * Note: this method should throw a javax.wsdl.WSDLException * rather than a java.io.IOException * diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/TypeEntry.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/TypeEntry.java index 7b3233f2e7..536b076016 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/TypeEntry.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/TypeEntry.java @@ -32,7 +32,7 @@ * A TypeEntry object extends SymTabEntry and is built by the SymbolTable class for * each supported root complexType, simpleType, and elements that are * defined or encountered. - *

    + *

    * SymTabEntry * | * TypeEntry @@ -43,28 +43,28 @@ * CollectionType CollectionElement, * DefinedType, UndefinedElement) * UndefinedType) - *

    + *

    * UndefinedType and UndefinedElement are placeholders when the real type or element * is not encountered yet. Both of these implement the Undefined interface. - *

    + *

    * A TypeEntry whose java (or other language) name depends on an Undefined type, will * have its name initialization deferred until the Undefined type is replaced with * a defined type. The updateUndefined() method is invoked by the UndefinedDelegate to * update the information. - *

    + *

    * Each TypeEntry whose language name depends on another TypeEntry will have the refType * field set. For example: - * + * <element name="foo" type="bar" /> * The TypeEntry for "foo" will have a refType set to the TypeEntry of "bar". - *

    + *

    * Another Example: - * - * - * - * - * - * - * + * <xsd:complexType name="hobbyArray"> + * <xsd:complexContent> + * <xsd:restriction base="soapenc:Array"> + * <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> + * </xsd:restriction> + * </xsd:complexContent> + * </xsd:complexType> * The TypeEntry for "hobbyArray" will have a refType that locates the TypeEntry for xsd:string * and the dims field will be "[]" * @@ -89,7 +89,7 @@ public abstract class TypeEntry extends SymTabEntry implements Serializable { protected QName componentType = null; // If this is an array, the component type /** If this TypeEntry represents an array with elements inside a "wrapper" - * this field can optionally change the inner QName (default is ). + * this field can optionally change the inner QName (default is <item>). */ protected QName itemQName = null; @@ -432,15 +432,6 @@ public void setItemQName(QName itemQName) { this.itemQName = itemQName; } - /** - * Get string representation. - * - * @return - */ - public String toString() { - return toString(""); - } - /** * Get string representation with indentation * @@ -457,7 +448,6 @@ protected String toString(String indent) { } return super.toString(indent) - + indent + "Class: " + this.getClass().getName() + "\n" + indent + "Base?: " + isBaseType + "\n" + indent + "Undefined?: " + undefined + "\n" + indent + "isSimpleType? " + isSimpleType + "\n" diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/Utils.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/Utils.java index d82ca4c6fe..a08b203e86 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/Utils.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/Utils.java @@ -175,7 +175,7 @@ public static Vector getAttributesWithLocalName(Node node, /** * An xml element may have a name. - * For example <.element name="foo" type="b:bar">. + * For example <element name="foo" type="b:bar"> * has the name "element". This routine gets the full QName of the element. * * @param node @@ -200,7 +200,7 @@ public static QName getNodeQName(Node node) { /** * XML nodes may have a name attribute. - * For example <.element name="foo" type="b:bar">. + * For example <element name="foo" type="b:bar"> * has the name attribute value "foo". This routine gets the QName of the name attribute value. * * @param node @@ -274,12 +274,12 @@ public static QName getNodeNameQName(Node node) { * - use of an anonymous type (i.e. a nested type underneath itself) * - a wsdl:part can use the element attribute. * - an extension can use the base attribute. - *

    + *

    * This routine returns a QName representing this "type". * The forElement value is also returned to indicate whether the * QName represents an element (i.e. obtained using the ref attribute) * or a type. - *

    + *

    * Other attributes affect the QName that is returned. * If the "minOccurs" and "maxOccurs" are set such that the * type is a collection of "types", then an artificial qname is @@ -745,41 +745,6 @@ private static void getNestedTypes(TypeEntry type, HashSet types, */ } // getNestedTypes - /** - * Generate an XML prefixed attribute value with a corresponding xmlns - * declaration for the prefix. If there is no namespace, - * don't prefix the name or emit the xmlns attribute. - *

    - * Caller should provide the enclosing quotes. - *

    - * Usage: println("name=\"" + genXMLQNameString(qname, "foo") + "\"" - * - * @param qname - * @param prefix - * @return - */ - public static String genQNameAttributeString(QName qname, String prefix) { - - if ((qname.getNamespaceURI() == null) - || qname.getNamespaceURI().equals("")) { - return qname.getLocalPart(); - } - - return prefix + ":" + qname.getLocalPart() + "\" xmlns:" + prefix - + "=\"" + qname.getNamespaceURI(); - } - - public static String genQNameAttributeStringWithLastLocalPart(QName qname, String prefix) { - String lastLocalPart = getLastLocalPart(qname.getLocalPart()); - if ((qname.getNamespaceURI() == null) - || qname.getNamespaceURI().equals("")) { - return lastLocalPart; - } - - return prefix + ":" + lastLocalPart + "\" xmlns:" + prefix - + "=\"" + qname.getNamespaceURI(); - } - public static String getLastLocalPart(String localPart) { int anonymousDelimitorIndex = localPart.lastIndexOf('>'); if (anonymousDelimitorIndex > -1 && anonymousDelimitorIndex < localPart.length()-1) { @@ -1057,7 +1022,7 @@ public static String getWrapperType(String type) { } /** - * Determines if the DOM Node represents an xs: + * Determines if the DOM Node represents an xs:<node> */ public static boolean isXsNode (Node node, String nameName) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/WSDLLocatorAdapter.java b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/WSDLLocatorAdapter.java index 33a59fd630..2d078ac889 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/WSDLLocatorAdapter.java +++ b/axis-rt-core/src/main/java/org/apache/axis/wsdl/symbolTable/WSDLLocatorAdapter.java @@ -21,6 +21,9 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; import javax.wsdl.xml.WSDLLocator; @@ -29,23 +32,52 @@ import org.xml.sax.SAXException; class WSDLLocatorAdapter implements WSDLLocator { + /** + * Contains a set of schemas that are always resolved locally. {@link SymbolTable} actually + * doesn't need to read these schemas, and it will not read them if they are imported without + * specifying a schemaLocation (see {@link SymbolTable#isKnownNamespace(String)}). + * However, WSDL4J insists on loading them whenever they are references by a + * schemaLocation. + */ + private final static Map/**/ localSchemas; + private final String baseURI; private final EntityResolver entityResolver; private String latestImportURI; + static { + localSchemas = new HashMap(); + localSchemas.put("http://www.w3.org/2001/xml.xsd", + WSDLLocatorAdapter.class.getResource("xml.xsd")); + localSchemas.put("http://schemas.xmlsoap.org/soap/encoding/", + WSDLLocatorAdapter.class.getResource("soap-encoding.xsd")); + } + WSDLLocatorAdapter(String baseURI, EntityResolver entityResolver) { this.baseURI = baseURI; this.entityResolver = entityResolver; } private InputSource getInputSource(String uri) { - try { - InputSource is = entityResolver.resolveEntity(null, uri); - return is != null ? is : new InputSource(uri); - } catch (SAXException ex) { - return null; - } catch (IOException ex) { - return null; + URL localSchema = (URL)localSchemas.get(uri); + if (localSchema != null) { + InputSource is; + try { + is = new InputSource(localSchema.openStream()); + } catch (IOException ex) { + return null; + } + is.setSystemId(uri); + return is; + } else { + try { + InputSource is = entityResolver.resolveEntity(null, uri); + return is != null ? is : new InputSource(uri); + } catch (SAXException ex) { + return null; + } catch (IOException ex) { + return null; + } } } diff --git a/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource.properties b/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource.properties index 795ac2bfb8..031b0be499 100644 --- a/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource.properties +++ b/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource.properties @@ -878,9 +878,6 @@ badTimeDuration=Invalid time string does not match pattern. needSimpleValueSer=Serializer class {0} does not implement SimpleValueSerializer, which is necessary for attributes. -# NOTE: in needImageIO, do not translate "JIMI", "java.awt.Image", "http://java.sun.com/products/jimi/" -needImageIO=JIMI is necessary to use java.awt.Image attachments (http://java.sun.com/products/jimi/). - wsddServiceName00=The WSDD service name defaults to the port name. badSource=javax.xml.transform.Source implementation not supported: {0}. diff --git a/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource_ja.properties b/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource_ja.properties index 4989efc735..b716fd53aa 100644 --- a/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource_ja.properties +++ b/axis-rt-core/src/main/resources/org/apache/axis/i18n/resource_ja.properties @@ -854,9 +854,6 @@ badTimeDuration=\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u306a\u3044\u66 needSimpleValueSer=\u30af\u30e9\u30b9{0}\u306e\u30b7\u30ea\u30a2\u30e9\u30a4\u30b6\u306fSimpleValueSerializer\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u305b\u3093\u3001\u305d\u308c\u306f\u5c5e\u6027\u306b\u5bfe\u3057\u3066\u5fc5\u8981\u3067\u3059\u3002 / [en]-(Serializer class {0} does not implement SimpleValueSerializer, which is necessary for attributes.) -# NOTE: in needImageIO, do not translate "JIMI", "java.awt.Image", "http://java.sun.com/products/jimi/" -needImageIO=JIMI\u306fjava.awt.Image\u30af\u30e9\u30b9\u306e\u6dfb\u4ed8\u306b\u5fc5\u8981\u3067\u3059 (http://java.sun.com/products/jimi/) / [en]-(JIMI is necessary to use java.awt.Image attachments (http://java.sun.com/products/jimi/).) - wsddServiceName00=WSDD\u30b5\u30fc\u30d3\u30b9\u540d\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u30dd\u30fc\u30c8\u540d\u3067\u3059 / [en]-(The WSDD service name defaults to the port name.) badSource=javax.xml.transform.Source\u306e\u5b9f\u88c5\u306f\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u305b\u3093: {0} / [en]-(javax.xml.transform.Source implementation not supported: {0}.) diff --git a/axis-rt-core/src/main/resources/org/apache/axis/server/server-config.wsdd b/axis-rt-core/src/main/resources/org/apache/axis/server/server-config.wsdd index d250f46e74..e7ac3694b1 100644 --- a/axis-rt-core/src/main/resources/org/apache/axis/server/server-config.wsdd +++ b/axis-rt-core/src/main/resources/org/apache/axis/server/server-config.wsdd @@ -9,6 +9,8 @@ + + + + + + + + 'root' can be used to distinguish serialization roots from other + elements that are present in a serialization but are not roots of + a serialized value graph + + + + + + + + + + + + + Attributes common to all elements that function as accessors or + represent independent (multi-ref) values. The href attribute is + intended to be used in a manner like CONREF. That is, the element + content should be empty iff the href attribute appears + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'Array' is a complex type for accessors identified by position + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/xml.xsd b/axis-rt-core/src/main/resources/org/apache/axis/wsdl/symbolTable/xml.xsd similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/xml.xsd rename to axis-rt-core/src/main/resources/org/apache/axis/wsdl/symbolTable/xml.xsd diff --git a/axis-rt-core/src/site/site.xml b/axis-rt-core/src/site/site.xml index 6d9b412b90..e36a181372 100644 --- a/axis-rt-core/src/site/site.xml +++ b/axis-rt-core/src/site/site.xml @@ -19,9 +19,6 @@ --> -

    - - - + diff --git a/axis-rt-core/src/test/java/org/apache/axis/attachments/TestDimeBodyPart.java b/axis-rt-core/src/test/java/org/apache/axis/attachments/TestDimeBodyPart.java new file mode 100644 index 0000000000..b3b3e4b4da --- /dev/null +++ b/axis-rt-core/src/test/java/org/apache/axis/attachments/TestDimeBodyPart.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.attachments; + +import junit.framework.TestCase; + +import org.apache.axiom.testutils.activation.InstrumentedDataSource; +import org.apache.axiom.testutils.activation.RandomDataSource; +import org.apache.commons.io.output.NullOutputStream; + +public class TestDimeBodyPart extends TestCase { + public void testWriteToWithDynamicContentDataHandlerClosesInputStreams() throws Exception { + InstrumentedDataSource ds = new InstrumentedDataSource(new RandomDataSource(1000)); + DimeBodyPart bp = new DimeBodyPart(new DynamicContentDataHandler(ds), "1234"); + bp.write(new NullOutputStream(), (byte)0); + assertEquals(0, ds.getOpenStreamCount()); + } +} diff --git a/axis-rt-core/src/test/java/test/outparams2/TestOutParams.java b/axis-rt-core/src/test/java/test/outparams2/TestOutParams.java index d0dc0cbe76..9f7bf2aac2 100644 --- a/axis-rt-core/src/test/java/test/outparams2/TestOutParams.java +++ b/axis-rt-core/src/test/java/test/outparams2/TestOutParams.java @@ -9,7 +9,7 @@ import org.apache.axis.description.ServiceDesc; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ParameterDesc; -import org.apache.axis.configuration.DefaultEngineConfigurationFactory; +import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.handlers.soap.SOAPService; import org.apache.axis.message.SOAPEnvelope; @@ -63,7 +63,7 @@ public void testOutputParams() throws Exception { service.setOption("allowedMethods", "serviceMethod"); EngineConfiguration defaultConfig = - (new DefaultEngineConfigurationFactory()).getServerEngineConfig(); + EngineConfigurationFactoryFinder.newFactory().getServerEngineConfig(); SimpleProvider config = new SimpleProvider(defaultConfig); config.deployService("outParamsTest", service); provider.deployService("outParamsTest", service); diff --git a/axis-rt-core/src/test/java/test/outparams2/TestOutParams2.java b/axis-rt-core/src/test/java/test/outparams2/TestOutParams2.java index eea76aa0f9..98546640ff 100644 --- a/axis-rt-core/src/test/java/test/outparams2/TestOutParams2.java +++ b/axis-rt-core/src/test/java/test/outparams2/TestOutParams2.java @@ -8,7 +8,7 @@ import org.apache.axis.Message; import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.configuration.DefaultEngineConfigurationFactory; +import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.description.JavaServiceDesc; import org.apache.axis.description.OperationDesc; @@ -84,7 +84,7 @@ public void testOutputParams() throws Exception { description.addOperationDesc(operation); service.setServiceDescription(description); - EngineConfiguration defaultConfig = (new DefaultEngineConfigurationFactory()) + EngineConfiguration defaultConfig = EngineConfigurationFactoryFinder.newFactory() .getServerEngineConfig(); SimpleProvider config = new SimpleProvider(defaultConfig); config.deployService("outParamsTest", service); diff --git a/axis-rt-core/src/test/java/test/saaj/TestAttachment.java b/axis-rt-core/src/test/java/test/saaj/TestAttachment.java index f855d3faa3..8b062b5347 100644 --- a/axis-rt-core/src/test/java/test/saaj/TestAttachment.java +++ b/axis-rt-core/src/test/java/test/saaj/TestAttachment.java @@ -50,8 +50,8 @@ public void testMultipleAttachments() throws Exception { MessageFactory factory = MessageFactory.newInstance(); SOAPMessage msg = factory.createMessage(); - java.net.URL url1 = new java.net.URL("http://slashdot.org/slashdot.xml"); - java.net.URL url2 = new java.net.URL("http://www.apache.org/LICENSE.txt"); + java.net.URL url1 = TestAttachment.class.getResource("slashdot.xml"); + java.net.URL url2 = TestAttachment.class.getResource("LICENSE.txt"); AttachmentPart a1 = msg.createAttachmentPart(new javax.activation.DataHandler(url1)); a1.setContentType("text/xml"); diff --git a/axis-rt-core/src/test/java/test/servicedesc/TestServiceDesc.java b/axis-rt-core/src/test/java/test/servicedesc/TestServiceDesc.java index 69d47d5ec9..ffbf5f39df 100644 --- a/axis-rt-core/src/test/java/test/servicedesc/TestServiceDesc.java +++ b/axis-rt-core/src/test/java/test/servicedesc/TestServiceDesc.java @@ -15,6 +15,8 @@ */ package test.servicedesc; +import java.util.Arrays; +import java.util.Comparator; import java.util.List; import junit.framework.TestCase; @@ -30,16 +32,21 @@ public void testFaultSynch() throws Exception { desc.loadServiceDescByIntrospection(ServiceClass.class); - List operations = desc.getOperations(); + OperationDesc[] operations = (OperationDesc[])desc.getOperations().toArray(new OperationDesc[0]); + Arrays.sort(operations, new Comparator() { + public int compare(Object o1, Object o2) { + return ((OperationDesc)o1).getName().compareTo(((OperationDesc)o2).getName()); + } + }); assertTrue(operations != null); assertEquals("invalid number of registered operations", - 2, operations.size()); + 2, operations.length); OperationDesc operation; List faults; - operation = (OperationDesc)operations.get(0); + operation = operations[0]; assertEquals("doIt1", operation.getName()); faults = operation.getFaults(); @@ -48,7 +55,7 @@ public void testFaultSynch() throws Exception { assertEquals("invalid number of registered faults", 2, faults.size()); - operation = (OperationDesc)operations.get(1); + operation = operations[1]; assertEquals("doIt2", operation.getName()); faults = operation.getFaults(); diff --git a/axis-rt-core/src/test/java/test/session/TestSimpleSession.java b/axis-rt-core/src/test/java/test/session/TestSimpleSession.java index 1ee3a9424d..ed759c7ab6 100644 --- a/axis-rt-core/src/test/java/test/session/TestSimpleSession.java +++ b/axis-rt-core/src/test/java/test/session/TestSimpleSession.java @@ -5,7 +5,7 @@ import org.apache.axis.MessageContext; import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.configuration.DefaultEngineConfigurationFactory; +import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.configuration.XMLStringProvider; import org.apache.axis.deployment.wsdd.WSDDConstants; @@ -81,7 +81,7 @@ public void testSessionService() throws Exception service.setOption("allowedMethods", "counter"); EngineConfiguration defaultConfig = - (new DefaultEngineConfigurationFactory()).getServerEngineConfig(); + EngineConfigurationFactoryFinder.newFactory().getServerEngineConfig(); SimpleProvider config = new SimpleProvider(defaultConfig); config.deployService("sessionTest", service); diff --git a/axis-rt-core/src/test/java/test/utils/TestMessages.java b/axis-rt-core/src/test/java/test/utils/TestMessages.java index 8ffcd473a3..dc32db794b 100644 --- a/axis-rt-core/src/test/java/test/utils/TestMessages.java +++ b/axis-rt-core/src/test/java/test/utils/TestMessages.java @@ -125,9 +125,8 @@ public void testTestExtendedMessages() { * matches the excpected number of parameters (in the source code). */ public void testForMissingMessages() { - String baseDir = System.getProperty("basedir"); char sep = File.separatorChar; - String srcDirStr = baseDir + sep + "src" + sep + "main" + sep + "java"; + String srcDirStr = "src" + sep + "main" + sep + "java"; File srcDir = new File(srcDirStr); if (srcDir.exists()) { diff --git a/axis-rt-core/src/test/java/test/utils/TestSrcContent.java b/axis-rt-core/src/test/java/test/utils/TestSrcContent.java index e217a08dc8..89c29b4fd1 100644 --- a/axis-rt-core/src/test/java/test/utils/TestSrcContent.java +++ b/axis-rt-core/src/test/java/test/utils/TestSrcContent.java @@ -44,8 +44,7 @@ public class TestSrcContent extends TestCase { * tree (xml-axis/java/src), calling checkFile for each file. */ public void testSourceFiles() { - String baseDir = System.getProperty("basedir"); - File srcDir = new File(baseDir, "src/main/java"); + File srcDir = new File("src/main/java"); if (srcDir.exists()) { walkTree(srcDir); @@ -214,21 +213,25 @@ boolean noMatch(String name, String content) private void checkFile(File file) { try { FileInputStream fis = new FileInputStream(file); - byte[] bytes = new byte[fis.available()]; - fis.read(bytes); - String content = new String(bytes); - - for (int i = 0; i < avoidPatterns.length; i++) { - if (avoidPatterns[i].noMatch(file.getPath(), content)) { - // if (content.indexOf(avoidStrings[i]) >= 0) { - errors = errors - + "File: " + file.getPath() + ": " - + (avoidPatterns[i].getExpectContent() - ? "Expected: " - : "Unexpected: ") - + avoidPatterns[i].getContentPattern() - + LS; + try { + byte[] bytes = new byte[fis.available()]; + fis.read(bytes); + String content = new String(bytes); + + for (int i = 0; i < avoidPatterns.length; i++) { + if (avoidPatterns[i].noMatch(file.getPath(), content)) { + // if (content.indexOf(avoidStrings[i]) >= 0) { + errors = errors + + "File: " + file.getPath() + ": " + + (avoidPatterns[i].getExpectContent() + ? "Expected: " + : "Unexpected: ") + + avoidPatterns[i].getContentPattern() + + LS; + } } + } finally { + fis.close(); } } catch (Throwable t) { diff --git a/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java b/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java index fe38606bc4..4f0e9bb36a 100644 --- a/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java +++ b/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java @@ -303,7 +303,7 @@ public void testDOMXXE() throws Exception String msg = "" + "" + + "" + "]>" + ". + * + * Portions of this software are based upon public domain software + * originally written at the National Center for Supercomputing Applications, + * University of Illinois, Urbana-Champaign. + */ + diff --git a/axis-rt-core/src/test/resources/test/saaj/slashdot.xml b/axis-rt-core/src/test/resources/test/saaj/slashdot.xml new file mode 100644 index 0000000000..021c3e622c --- /dev/null +++ b/axis-rt-core/src/test/resources/test/saaj/slashdot.xml @@ -0,0 +1,184 @@ + + + + Ford Dumping Windows For QNX In New Vehicles + http://slashdot.org/story/14/02/25/0256235/ford-dumping-windows-for-qnx-in-new-vehicles + + Unknown Lamer + back-to-the-classics + 3017 + 0 +
    technology
    + os_64.png +
    + + + The Higgs Boson Re-Explained By the Mick Jagger of Physics + http://slashdot.org/story/14/02/25/0318219/the-higgs-boson-re-explained-by-the-mick-jagger-of-physics + + Unknown Lamer + just-before-he-turned-into-a-cup-of-oj + 100 + 12 +
    science
    + science_64.png +
    + + + Complete Microsoft EMET Bypass Developed + http://slashdot.org/story/14/02/25/0139202/complete-microsoft-emet-bypass-developed + + Unknown Lamer + just-a-teeny-tiny-bug + 77 + 34 +
    technology
    + windows_64.png +
    + + + US War Machine Downsizing? + http://slashdot.org/story/14/02/25/0045203/us-war-machine-downsizing + + Unknown Lamer + how-will-we-defeat-zombie-stalin-now? + 363 + 192 +
    technology
    + military_64.png +
    + + + New Release of DICE, the CPU-Less Arcade Game Emulator, Adds Four Games + http://slashdot.org/story/14/02/25/001257/new-release-of-dice-the-cpu-less-arcade-game-emulator-adds-four-games + + Unknown Lamer + knew-you-got-that-16-core-machine-for-a-reason + 509 + 19 +
    games
    + emulation_64.png +
    + + + Publishers Withdraw More Than 120 Fake Papers + http://slashdot.org/story/14/02/25/006257/publishers-withdraw-more-than-120-fake-papers + + Unknown Lamer + trolling-journals-for-no-particular-reason + 357583 + 41 +
    news
    + themedia_64.png +
    + + + SpaceX Testing Landing Legs On Next Falcon9 Rocket + http://slashdot.org/story/14/02/24/2311234/spacex-testing-landing-legs-on-next-falcon9-rocket + + Unknown Lamer + crazy-enough-to-work + 147 + 36 +
    science
    + space_64.png +
    + + + Oklahoma Schools Required To Teach Students Personal Finance + http://slashdot.org/story/14/02/24/2139226/oklahoma-schools-required-to-teach-students-personal-finance + + samzenpus + value-of-a-dollar + 253 + 196 +
    news
    + money_64.png +
    + + + Why Nissan Is Talking To Tesla Model S Owners + http://slashdot.org/story/14/02/24/2131219/why-nissan-is-talking-to-tesla-model-s-owners + + samzenpus + how-do-you-like-us-now? + 1971 + 183 +
    technology
    + transportation_64.png +
    + + + DARPA Looks To End the Scourge of Counterfeit Computer Gear + http://slashdot.org/story/14/02/24/1948202/darpa-looks-to-end-the-scourge-of-counterfeit-computer-gear + + samzenpus + knocking-out-knock-offs + 828 + 67 +
    hardware
    + crime_64.png +
    + + + Does Relying On an IDE Make You a Bad Programmer? + http://slashdot.org/story/14/02/24/1845209/does-relying-on-an-ide-make-you-a-bad-programmer + + samzenpus + speak-up + 22 + 439 +
    developers
    + programming_64.png +
    + + + The Ever So Unlikely Tale of How ARM Came To Rule the World + http://slashdot.org/story/14/02/24/1840217/the-ever-so-unlikely-tale-of-how-arm-came-to-rule-the-world + + samzenpus + top-of-the-class + 84 + 81 +
    mobile
    + business_64.png +
    + + + Harold Ramis Dies At 69 + http://slashdot.org/story/14/02/24/203208/harold-ramis-dies-at-69 + + samzenpus + print-is-dead + 359 + 116 +
    entertainment
    + movies_64.png +
    + + + Apocalypse NAO: College Studies the Theological Ramifications of Robotics + http://slashdot.org/story/14/02/24/192203/apocalypse-nao-college-studies-the-theological-ramifications-of-robotics + + samzenpus + why-did-you-program-me-to-sin? + 2248 + 135 +
    idle
    + robot_64.png +
    + + + Book Review: Sudo Mastery: User Access Control For Real People + http://slashdot.org/story/14/02/24/1415216/book-review-sudo-mastery-user-access-control-for-real-people + + samzenpus + read-all-about-it + 172 + 76 +
    bookreview
    + books_64.png +
    + +
    diff --git a/axis-rt-core/src/test/resources/test/wsdd/testStructure1.wsdd b/axis-rt-core/src/test/resources/test/wsdd/testStructure1.wsdd index 6449fc28e4..653308c265 100644 --- a/axis-rt-core/src/test/resources/test/wsdd/testStructure1.wsdd +++ b/axis-rt-core/src/test/resources/test/wsdd/testStructure1.wsdd @@ -8,7 +8,7 @@ - + diff --git a/axis-rt-databinding-castor/pom.xml b/axis-rt-databinding-castor/pom.xml index b5e5cf1aec..5f2e8c2cea 100644 --- a/axis-rt-databinding-castor/pom.xml +++ b/axis-rt-databinding-castor/pom.xml @@ -26,7 +26,7 @@ ../pom.xml axis-rt-databinding-castor - Castor databinding support + Castor Databinding Contains serializers and deserializers for Castor. @@ -49,20 +49,4 @@ 0.9.4.2 - - - - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - - - - diff --git a/axis-rt-databinding-castor/src/site/site.xml b/axis-rt-databinding-castor/src/site/site.xml index fea33660da..18866594ab 100644 --- a/axis-rt-databinding-castor/src/site/site.xml +++ b/axis-rt-databinding-castor/src/site/site.xml @@ -17,11 +17,8 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + - - - - +
    diff --git a/axis-rt-databinding-xmlbeans/pom.xml b/axis-rt-databinding-xmlbeans/pom.xml new file mode 100644 index 0000000000..5e25623879 --- /dev/null +++ b/axis-rt-databinding-xmlbeans/pom.xml @@ -0,0 +1,65 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-databinding-xmlbeans + XmlBeans Databinding + ${baseUrl}/xmlbeans + + + axis + ${baseSiteUrl}/xmlbeans + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + org.apache.xmlbeans + xmlbeans + 2.4.0 + + + + + + org.codehaus.mojo + xmlbeans-maven-plugin + 2.3.3 + + + + xmlbeans + + + + + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializer.java b/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializer.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializer.java rename to axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializer.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializerFactory.java b/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializerFactory.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializerFactory.java rename to axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializerFactory.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializer.java b/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializer.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializer.java rename to axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializer.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializerFactory.java b/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializerFactory.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializerFactory.java rename to axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializerFactory.java diff --git a/xsd/soap.xsd b/axis-rt-databinding-xmlbeans/src/main/xsd/soap.xsd similarity index 100% rename from xsd/soap.xsd rename to axis-rt-databinding-xmlbeans/src/main/xsd/soap.xsd diff --git a/xsd/wsdl.xsd b/axis-rt-databinding-xmlbeans/src/main/xsd/wsdl.xsd similarity index 100% rename from xsd/wsdl.xsd rename to axis-rt-databinding-xmlbeans/src/main/xsd/wsdl.xsd diff --git a/axis-rt-databinding-xmlbeans/src/site/site.xml b/axis-rt-databinding-xmlbeans/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-databinding-xmlbeans/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-rt-jws/pom.xml b/axis-rt-jws/pom.xml new file mode 100644 index 0000000000..1a8c266193 --- /dev/null +++ b/axis-rt-jws/pom.xml @@ -0,0 +1,48 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-jws + JWS Support + ${baseUrl}/jws + + + axis + ${baseSiteUrl}/jws + + + + + 1.6 + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/handlers/JWSHandler.java b/axis-rt-jws/src/main/java/org/apache/axis/handlers/JWSHandler.java similarity index 86% rename from axis-rt-core/src/main/java/org/apache/axis/handlers/JWSHandler.java rename to axis-rt-jws/src/main/java/org/apache/axis/handlers/JWSHandler.java index cede9feca9..6626e05203 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/handlers/JWSHandler.java +++ b/axis-rt-jws/src/main/java/org/apache/axis/handlers/JWSHandler.java @@ -19,9 +19,6 @@ import org.apache.axis.AxisFault; import org.apache.axis.Constants; import org.apache.axis.MessageContext; -import org.apache.axis.components.compiler.Compiler; -import org.apache.axis.components.compiler.CompilerError; -import org.apache.axis.components.compiler.CompilerFactory; import org.apache.axis.components.logger.LogFactory; import org.apache.axis.constants.Scope; import org.apache.axis.handlers.soap.SOAPService; @@ -38,11 +35,21 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; +import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; -import java.util.List; import java.util.Map; +import javax.tools.Diagnostic; +import javax.tools.Diagnostic.Kind; +import javax.tools.DiagnosticCollector; +import javax.tools.JavaCompiler; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.StandardLocation; +import javax.tools.ToolProvider; + /** A JWSHandler sets the target service and JWS filename * in the context depending on the JWS configuration and the target URL. * @@ -192,13 +199,17 @@ protected void setupService(MessageContext msgContext) throws Exception { log.debug("javac " + jFile ); // Process proc = rt.exec( "javac " + jFile ); // proc.waitFor(); - Compiler compiler = CompilerFactory.getCompiler(); + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); + + fileManager.setLocation(StandardLocation.CLASS_PATH, ClasspathUtils.getDefaultClasspath(msgContext)); + fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singletonList(new File(outdir))); - compiler.setClasspath(ClasspathUtils.getDefaultClasspath(msgContext)); - compiler.setDestination(outdir); - compiler.addFile(jFile); + DiagnosticCollector diagnosticCollector = new DiagnosticCollector(); + CompilationTask task = compiler.getTask(null, fileManager, diagnosticCollector, null, null, + fileManager.getJavaFileObjectsFromFiles(Collections.singletonList(new File(jFile)))); - boolean result = compiler.compile(); + boolean result = task.call(); /* Delete the temporary *.java file and check return code */ /**********************************************************/ @@ -216,19 +227,17 @@ protected void setupService(MessageContext msgContext) throws Exception { Element root = doc.createElementNS("", "Errors"); StringBuffer message = new StringBuffer("Error compiling "); message.append(jFile); - message.append(":\n"); - - List errors = compiler.getErrors(); - int count = errors.size(); - for (int i = 0; i < count; i++) { - CompilerError error = (CompilerError) errors.get(i); - if (i > 0) message.append("\n"); - message.append("Line "); - message.append(error.getStartLine()); - message.append(", column "); - message.append(error.getStartColumn()); - message.append(": "); - message.append(error.getMessage()); + message.append(":"); + + for (Diagnostic diagnostic : diagnosticCollector.getDiagnostics()) { + if (diagnostic.getKind() == Kind.ERROR) { + message.append("\nLine "); + message.append(diagnostic.getLineNumber()); + message.append(", column "); + message.append(diagnostic.getStartPosition()); + message.append(": "); + message.append(diagnostic.getMessage(null)); + } } root.appendChild( doc.createTextNode( message.toString() ) ); throw new AxisFault( "Server.compileError", diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/ClasspathUtils.java b/axis-rt-jws/src/main/java/org/apache/axis/utils/ClasspathUtils.java similarity index 79% rename from axis-rt-core/src/main/java/org/apache/axis/utils/ClasspathUtils.java rename to axis-rt-jws/src/main/java/org/apache/axis/utils/ClasspathUtils.java index 1858b9a6d7..3502628161 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/utils/ClasspathUtils.java +++ b/axis-rt-jws/src/main/java/org/apache/axis/utils/ClasspathUtils.java @@ -27,6 +27,9 @@ import java.net.URL; import java.net.URLClassLoader; import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.StringTokenizer; import java.util.jar.Attributes; import java.util.jar.JarFile; @@ -50,23 +53,19 @@ public class ClasspathUtils { * @param dirPaths The string containing the directory path or list of * directory paths. * @return The file paths of the jar files in the directories. This is an - * empty string if no files were found, and is terminated by an - * additional pathSeparator in all other cases. + * empty list if no files were found. */ - public static String expandDirs(String dirPaths) { + public static List expandDirs(String dirPaths) { StringTokenizer st = new StringTokenizer(dirPaths, File.pathSeparator); - StringBuffer buffer = new StringBuffer(); + List files = new ArrayList(); while (st.hasMoreTokens()) { String d = st.nextToken(); File dir = new File(d); if (dir.isDirectory()) { - File[] files = dir.listFiles(new JavaArchiveFilter()); - for (int i = 0; i < files.length; i++) { - buffer.append(files[i]).append(File.pathSeparator); - } + files.addAll(Arrays.asList(dir.listFiles(new JavaArchiveFilter()))); } } - return buffer.toString(); + return files; } /** @@ -90,8 +89,8 @@ public static boolean isJar(InputStream is) { * @param msgContext * @return default classpath */ - public static String getDefaultClasspath(MessageContext msgContext) { - StringBuffer classpath = new StringBuffer(); + public static List getDefaultClasspath(MessageContext msgContext) { + List classpath = new ArrayList(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); fillClassPath(cl, classpath); @@ -100,8 +99,7 @@ public static String getDefaultClasspath(MessageContext msgContext) { String webBase = (String) msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETLOCATION); if (webBase != null) { - classpath.append(webBase + File.separatorChar + "classes" + - File.pathSeparatorChar); + classpath.add(new File(webBase, "classes")); try { String libBase = webBase + File.separatorChar + "lib"; File libDir = new File(libBase); @@ -109,10 +107,7 @@ public static String getDefaultClasspath(MessageContext msgContext) { for (int i = 0; i < jarFiles.length; i++) { String jarFile = jarFiles[i]; if (jarFile.endsWith(".jar")) { - classpath.append(libBase + - File.separatorChar + - jarFile + - File.pathSeparatorChar); + classpath.add(new File(libBase, jarFile)); } } } catch (Exception e) { @@ -138,7 +133,8 @@ public static String getDefaultClasspath(MessageContext msgContext) { // boot classpath isn't found in above search getClassPathFromProperty(classpath, "sun.boot.class.path"); - return classpath.toString(); + + return classpath; } /** @@ -146,18 +142,13 @@ public static String getDefaultClasspath(MessageContext msgContext) { * @param classpath * @param property */ - private static void getClassPathFromDirectoryProperty(StringBuffer classpath, String property) { + private static void getClassPathFromDirectoryProperty(List classpath, String property) { String dirs = AxisProperties.getProperty(property); - String path = null; try { - path = ClasspathUtils.expandDirs(dirs); + classpath.addAll(ClasspathUtils.expandDirs(dirs)); } catch (Exception e) { // Oh well. No big deal. } - if (path != null) { - classpath.append(path); - classpath.append(File.pathSeparatorChar); - } } /** @@ -165,11 +156,12 @@ private static void getClassPathFromDirectoryProperty(StringBuffer classpath, St * @param classpath * @param property */ - private static void getClassPathFromProperty(StringBuffer classpath, String property) { + private static void getClassPathFromProperty(List classpath, String property) { String path = AxisProperties.getProperty(property); if (path != null) { - classpath.append(path); - classpath.append(File.pathSeparatorChar); + for (String item : path.split(File.pathSeparator)) { + classpath.add(new File(item)); + } } } @@ -178,7 +170,7 @@ private static void getClassPathFromProperty(StringBuffer classpath, String prop * @param cl * @param classpath */ - private static void fillClassPath(ClassLoader cl, StringBuffer classpath) { + private static void fillClassPath(ClassLoader cl, List classpath) { while (cl != null) { if (cl instanceof URLClassLoader) { URL[] urls = ((URLClassLoader) cl).getURLs(); @@ -187,8 +179,7 @@ private static void fillClassPath(ClassLoader cl, StringBuffer classpath) { //If it is a drive letter, adjust accordingly. if (path.length() >= 3 && path.charAt(0) == '/' && path.charAt(2) == ':') path = path.substring(1); - classpath.append(URLDecoder.decode(path)); - classpath.append(File.pathSeparatorChar); + classpath.add(new File(URLDecoder.decode(path))); // if its a jar extract Class-Path entries from manifest File file = new File(urls[i].getFile()); @@ -208,8 +199,7 @@ private static void fillClassPath(ClassLoader cl, StringBuffer classpath) { StringTokenizer st = new StringTokenizer(s, " "); while (st.hasMoreTokens()) { String t = st.nextToken(); - classpath.append(base + File.separatorChar + t); - classpath.append(File.pathSeparatorChar); + classpath.add(new File(base, t)); } } } diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/JWSClassLoader.java b/axis-rt-jws/src/main/java/org/apache/axis/utils/JWSClassLoader.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/utils/JWSClassLoader.java rename to axis-rt-jws/src/main/java/org/apache/axis/utils/JWSClassLoader.java diff --git a/axis-rt-jws/src/main/resources/META-INF/axis/default-server-config.wsdd b/axis-rt-jws/src/main/resources/META-INF/axis/default-server-config.wsdd new file mode 100644 index 0000000000..079cfc1e08 --- /dev/null +++ b/axis-rt-jws/src/main/resources/META-INF/axis/default-server-config.wsdd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/axis-rt-management/pom.xml b/axis-rt-management/pom.xml new file mode 100644 index 0000000000..319b87650b --- /dev/null +++ b/axis-rt-management/pom.xml @@ -0,0 +1,59 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-management + JMX Support + ${baseUrl}/jmx + + + axis + ${baseSiteUrl}/jmx + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + commons-modeler + commons-modeler + 2.0.1 + + + commons-logging + commons-logging-api + + + xml-apis + xml-apis + + + + + diff --git a/axis-rt-management/src/main/java/org/apache/axis/management/Registrar.java b/axis-rt-management/src/main/java/org/apache/axis/management/Registrar.java new file mode 100644 index 0000000000..395b017081 --- /dev/null +++ b/axis-rt-management/src/main/java/org/apache/axis/management/Registrar.java @@ -0,0 +1,55 @@ +/* + * Copyright 2003,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.axis.management; + +import org.apache.axis.components.logger.LogFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.modeler.Registry; + +/** + * class to act as a dynamic loading registrar to commons-modeler, so + * as to autoregister stuff + *

    + * http://www.webweavertech.com/costin/archives/000168.html#000168 + */ +public class Registrar { + /** + * our log + */ + protected static Log log = LogFactory.getLog(Registrar.class.getName()); + + /** + * register an MBean + * + * @param objectToRegister + * @param name + * @param context + */ + public static boolean register(Object objectToRegister, + String name, String context) { + if (log.isDebugEnabled()) { + log.debug("Registering " + objectToRegister + " as " + + name); + } + try { + Registry.getRegistry(null, null).registerComponent(objectToRegister, name, context); + return true; + } catch (Exception ex) { + log.warn(ex); + return false; + } + } +} diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/ServiceAdmin.java b/axis-rt-management/src/main/java/org/apache/axis/management/ServiceAdmin.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/ServiceAdmin.java rename to axis-rt-management/src/main/java/org/apache/axis/management/ServiceAdmin.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentAdministrator.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentAdministrator.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentAdministrator.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentAdministrator.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentAdministratorMBean.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentAdministratorMBean.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentAdministratorMBean.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentAdministratorMBean.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentQuery.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentQuery.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentQuery.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentQuery.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentQueryMBean.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentQueryMBean.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/DeploymentQueryMBean.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/DeploymentQueryMBean.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/ServiceAdministrator.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/ServiceAdministrator.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/ServiceAdministrator.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/ServiceAdministrator.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/ServiceAdministratorMBean.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/ServiceAdministratorMBean.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/ServiceAdministratorMBean.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/ServiceAdministratorMBean.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/WSDDServiceWrapper.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/WSDDServiceWrapper.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/WSDDServiceWrapper.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/WSDDServiceWrapper.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/management/jmx/WSDDTransportWrapper.java b/axis-rt-management/src/main/java/org/apache/axis/management/jmx/WSDDTransportWrapper.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/management/jmx/WSDDTransportWrapper.java rename to axis-rt-management/src/main/java/org/apache/axis/management/jmx/WSDDTransportWrapper.java diff --git a/axis-rt-management/src/main/java/org/apache/axis/management/servlet/AxisServerMBeanExporter.java b/axis-rt-management/src/main/java/org/apache/axis/management/servlet/AxisServerMBeanExporter.java new file mode 100644 index 0000000000..fc5e169a8e --- /dev/null +++ b/axis-rt-management/src/main/java/org/apache/axis/management/servlet/AxisServerMBeanExporter.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.management.servlet; + +import javax.servlet.ServletContextAttributeEvent; +import javax.servlet.ServletContextAttributeListener; + +import org.apache.axis.management.ServiceAdmin; +import org.apache.axis.server.AxisServer; +import org.apache.axis.transport.http.AxisServlet; + +/** + * Listener that registers the MBeans for the {@link AxisServer} created by {@link AxisServlet}. To + * enable MBean registration in your Web application, add the following configuration to + * web.xml: + * + *

    + * <listener>
    + *     <listener-class>org.apache.axis.management.servlet.AxisServerMBeanExporter</listener-class>
    + * </listener>
    + * 
    + * + * @author Andreas Veithen + */ +public class AxisServerMBeanExporter implements ServletContextAttributeListener { + public void attributeAdded(ServletContextAttributeEvent event) { + Object value = event.getValue(); + if (value instanceof AxisServer) { + ServiceAdmin.setEngine((AxisServer)value, event.getServletContext().getServerInfo()); + } + } + + public void attributeRemoved(ServletContextAttributeEvent event) { + // TODO: we currently never unregister the MBeans, but this was also the case in Axis 1.4 + } + + public void attributeReplaced(ServletContextAttributeEvent event) { + attributeRemoved(event); + attributeAdded(event); + } +} diff --git a/axis-rt-management/src/site/site.xml b/axis-rt-management/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-management/src/site/site.xml @@ -0,0 +1,24 @@ + + + + +
    + + diff --git a/axis-rt-provider-bsf/pom.xml b/axis-rt-provider-bsf/pom.xml index 9a403497c6..590baebe6f 100644 --- a/axis-rt-provider-bsf/pom.xml +++ b/axis-rt-provider-bsf/pom.xml @@ -27,6 +27,13 @@ axis-rt-provider-bsf BSF Provider + ${baseUrl}/bsf + + + axis + ${baseSiteUrl}/bsf + + ${project.groupId} diff --git a/axis-rt-provider-bsf/src/site/site.xml b/axis-rt-provider-bsf/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-provider-bsf/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-rt-soapmonitor/pom.xml b/axis-rt-soapmonitor/pom.xml new file mode 100644 index 0000000000..cd4c1c4a23 --- /dev/null +++ b/axis-rt-soapmonitor/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-soapmonitor + SOAP Monitor Handler/Service + ${baseUrl}/soapmonitor/runtime + + + axis + ${baseSiteUrl}/soapmonitor/runtime + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/handlers/SOAPMonitorHandler.java b/axis-rt-soapmonitor/src/main/java/org/apache/axis/handlers/SOAPMonitorHandler.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/handlers/SOAPMonitorHandler.java rename to axis-rt-soapmonitor/src/main/java/org/apache/axis/handlers/SOAPMonitorHandler.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/monitor/SOAPMonitorConstants.java b/axis-rt-soapmonitor/src/main/java/org/apache/axis/monitor/SOAPMonitorConstants.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/monitor/SOAPMonitorConstants.java rename to axis-rt-soapmonitor/src/main/java/org/apache/axis/monitor/SOAPMonitorConstants.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java b/axis-rt-soapmonitor/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java similarity index 97% rename from axis-rt-core/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java rename to axis-rt-soapmonitor/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java index ecd7cd2994..29dd6cc67f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java +++ b/axis-rt-soapmonitor/src/main/java/org/apache/axis/monitor/SOAPMonitorService.java @@ -54,10 +54,6 @@ * display by the applet. * * @author Brian Price (pricebe@us.ibm.com) - * xdoclet tags are not active yet; keep web.xml in sync - * @web.servlet name="SOAPMonitorService" display-name="SOAPMonitorService" load-on-startup="100" - * @web.servlet-mapping url-pattern="/SOAPMonitor" - * @web.servlet-init-param name="SOAPMonitorPort" value="5001" */ public class SOAPMonitorService extends HttpServlet { diff --git a/axis-rt-soapmonitor/src/site/site.xml b/axis-rt-soapmonitor/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-soapmonitor/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-rt-transport-http-hc3/pom.xml b/axis-rt-transport-http-hc3/pom.xml new file mode 100644 index 0000000000..293b5ceb85 --- /dev/null +++ b/axis-rt-transport-http-hc3/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-transport-http-hc3 + HttpClient 3 Transport + + An alternative HTTP transport that uses HttpClient 3. + + ${baseUrl}/transports/http-hc3 + + + axis + ${baseSiteUrl}/transports/http-hc3 + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + commons-httpclient + commons-httpclient + 3.0.1 + + + junit + junit + + + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java similarity index 92% rename from axis-rt-core/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java rename to axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java index f8aa5ab2e3..ff3f30094a 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java +++ b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/CommonsHTTPClientProperties.java @@ -30,7 +30,7 @@ public interface CommonsHTTPClientProperties { * your system imposes on the number of open file descriptors a * single process may have. * - * @return an integer > 1 + * @return an integer > 1 */ public int getMaximumTotalConnections(); @@ -39,7 +39,7 @@ public interface CommonsHTTPClientProperties { * for a given host. This setting is also constrained by * the one returned from getMaximumTotalConnections. * - * @return an integer > 1 + * @return an integer > 1 */ public int getMaximumConnectionsPerHost(); @@ -48,7 +48,7 @@ public interface CommonsHTTPClientProperties { * for an available connection from the pool. An exception is raised * if the timeout is triggered. * - * @return an integer > 1 OR 0 for infinite timeout + * @return an integer > 1 OR 0 for infinite timeout */ public int getConnectionPoolTimeout(); @@ -56,7 +56,7 @@ public interface CommonsHTTPClientProperties { * Used to set the default amount of time, in milliseconds, spent waiting * for a connection. This can be overridden by the MessageContext * - * @return an integer >= 0 + * @return an integer >= 0 */ public int getDefaultConnectionTimeout(); @@ -64,7 +64,7 @@ public interface CommonsHTTPClientProperties { * Used to set the default amount of time, in milliseconds, spent waiting * for a reponse. This can be overridden by the MessageContext * - * @return an integer >= 0 + * @return an integer >= 0 */ public int getDefaultSoTimeout(); diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/CommonsHTTPClientPropertiesFactory.java b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/CommonsHTTPClientPropertiesFactory.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/components/net/CommonsHTTPClientPropertiesFactory.java rename to axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/CommonsHTTPClientPropertiesFactory.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java similarity index 97% rename from axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java rename to axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java index 76437fa2be..f68dc07455 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java +++ b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/components/net/DefaultCommonsHTTPClientProperties.java @@ -95,7 +95,7 @@ public int getMaximumConnectionsPerHost() { * Return the integer value associated with the property * axis.http.client.connection.pool.timeout or a default of 0. * - * @return an integer >= 0 + * @return an integer >= 0 */ public int getConnectionPoolTimeout() { int i = getIntegerProperty(CONNECTION_POOL_TIMEOUT_KEY, "0"); @@ -109,7 +109,7 @@ public int getConnectionPoolTimeout() { * Return the integer value associated with the property * axis.http.client.connection.default.connection.timeout or a default of 0. * - * @return an integer >= 0 + * @return an integer >= 0 */ public int getDefaultConnectionTimeout() { int i = getIntegerProperty(CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY, "0"); @@ -123,7 +123,7 @@ public int getDefaultConnectionTimeout() { * Return the integer value associated with the property * axis.http.client.connection.default.so.timeout or a default of 0. * - * @return an integer >= 0 + * @return an integer >= 0 */ public int getDefaultSoTimeout() { int i = getIntegerProperty(CONNECTION_DEFAULT_SO_TIMEOUT_KEY, "0"); diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java similarity index 99% rename from axis-rt-core/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java rename to axis-rt-transport-http-hc3/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java index 0694e14248..63127d6ec9 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java +++ b/axis-rt-transport-http-hc3/src/main/java/org/apache/axis/transport/http/CommonsHTTPSender.java @@ -312,7 +312,6 @@ public void invoke(MessageContext msgContext) throws AxisFault { * a string or an array of strings (if there are more than one Set-Cookie) * * @param cookieName - * @param setCookieName * @param cookie * @param msgContext */ diff --git a/axis-rt-transport-http-hc3/src/site/site.xml b/axis-rt-transport-http-hc3/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-transport-http-hc3/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-rt-transport-http-javanet/pom.xml b/axis-rt-transport-http-javanet/pom.xml index 13d8082b17..c22538bbdd 100644 --- a/axis-rt-transport-http-javanet/pom.xml +++ b/axis-rt-transport-http-javanet/pom.xml @@ -26,7 +26,7 @@ ../pom.xml axis-rt-transport-http-javanet - Axis :: java.net HTTP Transport + java.net HTTP Transport An alternative HTTP transport that uses the java.net.HttpURLConnection API. This transport only works with Java 1.5. @@ -37,6 +37,9 @@ ${baseSiteUrl}/transports/http-javanet + + 1.5 + ${project.groupId} @@ -48,12 +51,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - test - ${project.groupId} interop-mock @@ -72,7 +69,7 @@ ${project.groupId} - maven-wsdl2java-plugin + wsdl2java-maven-plugin ${project.version} @@ -126,7 +123,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -155,17 +152,23 @@ - maven-dependency-plugin + com.github.veithen.alta + alta-maven-plugin pre-integration-test - copy-dependencies + generate-properties - ${project.build.directory} - war - true + %artifactId%.location + %file% + + test + + *:*:war:* + + @@ -174,7 +177,7 @@ org.mortbay.jetty jetty-maven-plugin - ${project.build.directory}/interop-mock.war + ${interop-mock.location} foo ${jetty.stopPort} @@ -226,20 +229,4 @@ - - - - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - - - - diff --git a/axis-rt-transport-http-javanet/src/test/resources/client-config.wsdd b/axis-rt-transport-http-javanet/src/main/resources/META-INF/axis/default-client-config.wsdd similarity index 70% rename from axis-rt-transport-http-javanet/src/test/resources/client-config.wsdd rename to axis-rt-transport-http-javanet/src/main/resources/META-INF/axis/default-client-config.wsdd index 0b3fceae3e..5b83c25bf7 100644 --- a/axis-rt-transport-http-javanet/src/test/resources/client-config.wsdd +++ b/axis-rt-transport-http-javanet/src/main/resources/META-INF/axis/default-client-config.wsdd @@ -17,14 +17,8 @@ ~ specific language governing permissions and limitations ~ under the License. --> - - - - - - - + - diff --git a/axis-rt-transport-http-javanet/src/site/apt/index.apt.vm b/axis-rt-transport-http-javanet/src/site/apt/index.apt.vm index 870f5d2414..9bebad553c 100644 --- a/axis-rt-transport-http-javanet/src/site/apt/index.apt.vm +++ b/axis-rt-transport-http-javanet/src/site/apt/index.apt.vm @@ -36,9 +36,20 @@ <<>>. However, it only works with Java 1.5 or higher because it relies on features of the <<>> API that were not available in earlier Java versions. - To use the java.net based HTTP transport, add <<<${project.artifactId}-${project.version}.jar>>> to the class path and set up - <<>> with the right pivot handler for the <<>> transport, as shown in the following + To use the java.net based HTTP transport, add <<<${project.artifactId}-${project.version}.jar>>> to the class path. + If you are using the default client configuration, it will be configured automatically. If you provide your own + custom client configuration WSDD file, then configure the pivot handler for the <<>> transport as shown in the following sample: -%{snippet|id=deployment|file=${project.basedir}/src/test/resources/client-config.wsdd} +------------------------------------------------------------------------------------------------- + + + + + + + +------------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/axis-rt-transport-http-javanet/src/site/site.xml b/axis-rt-transport-http-javanet/src/site/site.xml index 0d54edecf7..18866594ab 100644 --- a/axis-rt-transport-http-javanet/src/site/site.xml +++ b/axis-rt-transport-http-javanet/src/site/site.xml @@ -17,11 +17,8 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + - - - - + diff --git a/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestDefaultConfiguration.java b/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestDefaultConfiguration.java new file mode 100644 index 0000000000..31b27e59e3 --- /dev/null +++ b/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestDefaultConfiguration.java @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.transport.http.javanet; + +import junit.framework.TestCase; + +import org.apache.axis.Handler; +import org.apache.axis.SimpleTargetedChain; +import org.apache.axis.client.AxisClient; +import org.apache.axis.configuration.DefaultConfiguration; + +/** + * Tests that {@link DefaultConfiguration} (with type client) configures the java.net + * transport as default HTTP transport if it is in the classpath. + * + * @author Andreas Veithen + */ +public class TestDefaultConfiguration extends TestCase { + public void test() throws Exception { + AxisClient client = new AxisClient(new DefaultConfiguration("client")); + Handler[] handlers = ((SimpleTargetedChain)client.getTransport("http")).getHandlers(); + assertTrue(handlers[0] instanceof JavaNetHTTPSender); + } +} diff --git a/axis-rt-transport-jms/pom.xml b/axis-rt-transport-jms/pom.xml index 0242087564..1a4ed5bce9 100644 --- a/axis-rt-transport-jms/pom.xml +++ b/axis-rt-transport-jms/pom.xml @@ -26,7 +26,7 @@ ../pom.xml axis-rt-transport-jms - Axis :: JMS transport + JMS Transport Contains the Axis JMS transport. @@ -49,33 +49,4 @@ 1.1.1 - - - - maven-compiler-plugin - - - - org/apache/axis/components/jms/SonicMQVendorAdapter.java - - - - - - - - - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - - - - diff --git a/axis-rt-transport-jms/src/main/java/org/apache/axis/components/jms/SonicMQVendorAdapter.java b/axis-rt-transport-jms/src/main/java/org/apache/axis/components/jms/SonicMQVendorAdapter.java deleted file mode 100644 index 4240bae88a..0000000000 --- a/axis-rt-transport-jms/src/main/java/org/apache/axis/components/jms/SonicMQVendorAdapter.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Copyright 2001, 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.axis.components.jms; - -import org.apache.axis.MessageContext; -import org.apache.axis.client.Call; -import org.apache.axis.transport.jms.JMSConnector; -import org.apache.axis.transport.jms.JMSConnectorFactory; -import org.apache.axis.transport.jms.JMSURLHelper; - -import progress.message.client.ENetworkFailure; -import progress.message.client.EUserAlreadyConnected; -import progress.message.jclient.ErrorCodes; - -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; -import javax.jms.QueueConnectionFactory; -import javax.jms.TopicConnectionFactory; -import java.util.HashMap; -import java.util.Iterator; - -/** - * Defines SonicMQ specific constants for connnection factory creation. - * Overrides methods in BeanVendorAdapter to fill in MQ classnames - * - * @author Jaime Meritt (jmeritt@sonicsoftware.com) - * @author Ray Chun (rchun@sonicsoftware.com) - */ -public class SonicMQVendorAdapter extends BeanVendorAdapter -{ - private final static String QCF_CLASS = - "progress.message.jclient.QueueConnectionFactory"; - - private final static String TCF_CLASS = - "progress.message.jclient.TopicConnectionFactory"; - - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory. - * This is a required property. - * The value must be a java.lang.String - * See the SonicMQ documentation for information on this property - */ - public final static String BROKER_URL = "brokerURL"; - - /** - * SonicConnectionFactory parameter valid for either domains. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * This is a required property for secure brokers. - * The value must be a java.lang.String - * See the SonicMQ documentation for information on this property - */ - public final static String DEFAULT_USERNAME = "defaultUser"; - - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * This is a required property for secure brokers. - * The value must be a java.lang.String - * See the SonicMQ documentation for information on this property - */ - public final static String DEFAULT_PASSWORD = "defaultPassword"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Long - * See the SonicMQ documentation for information on this property - */ - public final static String PING_INTERVAL = "pingIntervalLong"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Integer - * See the SonicMQ documentation for information on this property - */ - public final static String RECONNECT_INTERVAL = "reconnectIntervalInteger"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Integer - * See the SonicMQ documentation for information on this property - */ - public final static String RECONNECT_TIMEOUT = "reconnectTimeoutInteger"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.String - * See the SonicMQ documentation for information on this property - */ - public final static String CONNECT_ID = "connectID"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.String - * See the SonicMQ documentation for information on this property - */ - public final static String CONNECTION_URLS = "connectionURLs"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Boolean - * See the SonicMQ documentation for information on this property - */ - public final static String LOAD_BALANCING = "loadBalancingBoolean"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Long - * See the SonicMQ documentation for information on this property - */ - public final static String MONITOR_INTERVAL = "monitorInterval"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Boolean - * See the SonicMQ documentation for information on this property - */ - public final static String PERSISTENT_DELIVERY = "persistentDeliveryBoolean"; - /** - * SonicConnectionFactory parameter valid for either domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Boolean - * See the SonicMQ documentation for information on this property - */ - public final static String SEQUENTIAL = "sequentialBoolean"; - - /** - * SonicConnectionFactory parameter valid for the PTP domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Integer - * See the SonicMQ documentation for information on this property - */ - public final static String PREFETCH_COUNT = "prefetchCountInteger"; - /** - * SonicConnectionFactory parameter valid for the PTP domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Integer - * See the SonicMQ documentation for information on this property - */ - public final static String PREFETCH_THRESHOLD = "prefetchThresholdInteger"; - /** - * SonicConnectionFactory parameter valid for the PubSub domain. This should - * be used as a key in the environment map passed into calls to - * createConnector in JMSConnectorFactory - * The value must be a java.lang.Boolean - * See the SonicMQ documentation for information on this property - */ - public final static String SELECTOR_AT_BROKER = "selectorAtBroker"; - - public QueueConnectionFactory getQueueConnectionFactory(HashMap cfConfig) - throws Exception - { - cfConfig = (HashMap)cfConfig.clone(); - cfConfig.put(CONNECTION_FACTORY_CLASS, QCF_CLASS); - return super.getQueueConnectionFactory(cfConfig); - } - - public TopicConnectionFactory getTopicConnectionFactory(HashMap cfConfig) - throws Exception - { - cfConfig = (HashMap)cfConfig.clone(); - cfConfig.put(CONNECTION_FACTORY_CLASS, TCF_CLASS); - return super.getTopicConnectionFactory(cfConfig); - } - - /** - * Extract Sonic-specific properties from the JMS URL - * - * @param jmsurl The JMS URL representing the target endpoint address - * @param cfProps The set of connection factory configuration properties - */ - public void addVendorConnectionFactoryProperties(JMSURLHelper jmsurl, HashMap cfProps) - { - if (jmsurl.getPropertyValue(BROKER_URL) != null) - cfProps.put(BROKER_URL, jmsurl.getPropertyValue(BROKER_URL)); - - if (jmsurl.getPropertyValue(DEFAULT_USERNAME) != null) - cfProps.put(DEFAULT_USERNAME, jmsurl.getPropertyValue(DEFAULT_USERNAME)); - - if (jmsurl.getPropertyValue(DEFAULT_PASSWORD) != null) - cfProps.put(DEFAULT_PASSWORD, jmsurl.getPropertyValue(DEFAULT_PASSWORD)); - - if (jmsurl.getPropertyValue(PING_INTERVAL) != null) - cfProps.put(PING_INTERVAL, jmsurl.getPropertyValue(PING_INTERVAL)); - - if (jmsurl.getPropertyValue(RECONNECT_INTERVAL) != null) - cfProps.put(RECONNECT_INTERVAL, jmsurl.getPropertyValue(RECONNECT_INTERVAL)); - - if (jmsurl.getPropertyValue(RECONNECT_TIMEOUT) != null) - cfProps.put(RECONNECT_TIMEOUT, jmsurl.getPropertyValue(RECONNECT_TIMEOUT)); - - if (jmsurl.getPropertyValue(CONNECT_ID) != null) - cfProps.put(CONNECT_ID, jmsurl.getPropertyValue(CONNECT_ID)); - - if (jmsurl.getPropertyValue(CONNECTION_URLS) != null) - cfProps.put(CONNECTION_URLS, jmsurl.getPropertyValue(CONNECTION_URLS)); - - if (jmsurl.getPropertyValue(LOAD_BALANCING) != null) - cfProps.put(LOAD_BALANCING, jmsurl.getPropertyValue(LOAD_BALANCING)); - - if (jmsurl.getPropertyValue(MONITOR_INTERVAL) != null) - cfProps.put(MONITOR_INTERVAL, jmsurl.getPropertyValue(MONITOR_INTERVAL)); - - if (jmsurl.getPropertyValue(PERSISTENT_DELIVERY) != null) - cfProps.put(PERSISTENT_DELIVERY, jmsurl.getPropertyValue(PERSISTENT_DELIVERY)); - - if (jmsurl.getPropertyValue(SEQUENTIAL) != null) - cfProps.put(SEQUENTIAL, jmsurl.getPropertyValue(SEQUENTIAL)); - - if (jmsurl.getPropertyValue(PREFETCH_COUNT) != null) - cfProps.put(PREFETCH_COUNT, jmsurl.getPropertyValue(PREFETCH_COUNT)); - - if (jmsurl.getPropertyValue(PREFETCH_THRESHOLD) != null) - cfProps.put(PREFETCH_THRESHOLD, jmsurl.getPropertyValue(PREFETCH_THRESHOLD)); - - if (jmsurl.getPropertyValue(SELECTOR_AT_BROKER) != null) - cfProps.put(SELECTOR_AT_BROKER, jmsurl.getPropertyValue(SELECTOR_AT_BROKER)); - } - - /** - * Check that the attributes of the candidate connection factory match the - * requested connection factory properties. - * - * @param cf the candidate connection factory - * @param jmsurl the JMS URL associated with the candidate connection factory - * @param cfProps the properties associated with the current request - * @return true or false - */ - public boolean isMatchingConnectionFactory(javax.jms.ConnectionFactory cf, - JMSURLHelper jmsurl, - HashMap cfProps) - { - String brokerURL = null; - String connectionURLs = null; - boolean loadBalancing = false; - boolean sequential = false; - - if (cf instanceof progress.message.jclient.QueueConnectionFactory) - { - progress.message.jclient.QueueConnectionFactory qcf = - (progress.message.jclient.QueueConnectionFactory)cf; - - // get existing queue connection factory properties - brokerURL = qcf.getBrokerURL(); - connectionURLs = qcf.getConnectionURLs(); - loadBalancing = qcf.getLoadBalancing(); - sequential = qcf.getSequential(); - } - else if (cf instanceof progress.message.jclient.TopicConnectionFactory) - { - progress.message.jclient.TopicConnectionFactory tcf = - (progress.message.jclient.TopicConnectionFactory)cf; - - // get existing topic connection factory properties - brokerURL = tcf.getBrokerURL(); - connectionURLs = tcf.getConnectionURLs(); - loadBalancing = tcf.getLoadBalancing(); - sequential = tcf.getSequential(); - } - - // compare broker url - String propertyBrokerURL = (String)cfProps.get(BROKER_URL); - if (!brokerURL.equals(propertyBrokerURL)) - return false; - - // compare connection url list - String propertyConnectionURLs = (String)cfProps.get(CONNECTION_URLS); - if ((connectionURLs != null) && (propertyConnectionURLs != null)) - { - if (!connectionURLs.equalsIgnoreCase(propertyConnectionURLs)) - return false; - - // check sequential if connection urls have been set - String tmpSequential = (String)cfProps.get(SEQUENTIAL); - boolean propertySequential = true; - if (tmpSequential != null) - propertySequential = Boolean.getBoolean(tmpSequential); - if (sequential != propertySequential) - return false; - } - else if ((connectionURLs != null) || (propertyConnectionURLs != null)) - return false; - - // compare load balancing flag - String tmpLoadBalancing = (String)cfProps.get(LOAD_BALANCING); - boolean propertyLoadBalancing = false; - if (tmpLoadBalancing != null) - propertyLoadBalancing = Boolean.getBoolean(tmpLoadBalancing); - if (loadBalancing != propertyLoadBalancing) - return false; - - return true; - } - - public boolean isRecoverable(Throwable thrown, int action) - { - //the super class cannot be trusted for on exception because it always - //returns false - if(action != ON_EXCEPTION_ACTION && !super.isRecoverable(thrown, action)) - return false; - - if(!(thrown instanceof JMSException)) - return true; - - JMSException jmse = (JMSException)thrown; - switch(action) - { - case CONNECT_ACTION: - if(isNetworkFailure(jmse)) - return false; - break; - case SUBSCRIBE_ACTION: - - if(isQueueMissing(jmse) || isAnotherSubscriberConnected(jmse)) - return false; - break; - - case ON_EXCEPTION_ACTION: - if(isConnectionDropped(jmse)) - return false; - break; - - } - - return true; - } - - public boolean isConnectionDropped(JMSException jmse) - { - return ErrorCodes.testException(jmse, ErrorCodes.ERR_CONNECTION_DROPPED); - } - - private boolean isQueueMissing(JMSException jmse) - { - String message = jmse.getMessage(); - if(message != null && message.startsWith("Queue not found")) - { - return true; - } - return false; - } - - private boolean isAnotherSubscriberConnected(JMSException jmse) - { - Exception linkedException = jmse.getLinkedException(); - if(linkedException != null && - linkedException instanceof EUserAlreadyConnected) - { - return true; - } - return false; - } - - private boolean isNetworkFailure(JMSException jmse) - { - Exception linkedException = jmse.getLinkedException(); - if(linkedException != null && - linkedException instanceof ENetworkFailure) - { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/Handler.java b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/Handler.java index 8f4bdadaff..9a4f2880d8 100644 --- a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/Handler.java +++ b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/Handler.java @@ -33,7 +33,7 @@ public class Handler } /** - * Reassembles the URL string, in the form "jms:/?prop1=value1&prop2=value2&..." + * Reassembles the URL string, in the form "jms:/<dest>?prop1=value1&prop2=value2&..." */ protected String toExternalForm(URL url) { diff --git a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSEndpoint.java b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSEndpoint.java index 9448542135..109c831952 100644 --- a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSEndpoint.java +++ b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSEndpoint.java @@ -47,7 +47,7 @@ abstract Destination getDestination(Session session) * @param message * @param timeout * @return - * @throws JMSException + * @throws Exception */ public byte[] call(byte[] message, long timeout)throws Exception { @@ -61,7 +61,7 @@ public byte[] call(byte[] message, long timeout)throws Exception * @param timeout * @param properties * @return - * @throws JMSException + * @throws Exception */ public byte[] call(byte[] message, long timeout, HashMap properties) throws Exception @@ -75,7 +75,7 @@ public byte[] call(byte[] message, long timeout, HashMap properties) * Send a message w/o waiting for a response. * * @param message - * @throws JMSException + * @throws Exception */ public void send(byte[] message)throws Exception { @@ -87,7 +87,7 @@ public void send(byte[] message)throws Exception * * @param message * @param properties - * @throws JMSException + * @throws Exception */ public void send(byte[] message, HashMap properties) throws Exception @@ -101,7 +101,7 @@ public void send(byte[] message, HashMap properties) * Register a MessageListener. * * @param listener - * @throws JMSException + * @throws Exception */ public void registerListener(MessageListener listener) throws Exception @@ -114,7 +114,7 @@ public void registerListener(MessageListener listener) * * @param listener * @param properties - * @throws JMSException + * @throws Exception */ public void registerListener(MessageListener listener, HashMap properties) throws Exception diff --git a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSSender.java b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSSender.java index 24621fd2bf..b05149440f 100644 --- a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSSender.java +++ b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSSender.java @@ -44,7 +44,7 @@ public JMSSender() * invoke() creates an endpoint, sends the request SOAP message, and then * either reads the response SOAP message or simply returns. * - * @todo hash on something much better than the connection factory + * TODO: hash on something much better than the connection factory * something like domain:url:username:password would be adequate * @param msgContext * @throws AxisFault diff --git a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSURLHelper.java b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSURLHelper.java index d157e2bff4..8467247a38 100644 --- a/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSURLHelper.java +++ b/axis-rt-transport-jms/src/main/java/org/apache/axis/transport/jms/JMSURLHelper.java @@ -25,7 +25,7 @@ /** * JMSURLHelper provides access to properties in the URL. - * The URL must be of the form: "jms:/?[=&]*" + * The URL must be of the form: "jms:/<destination>?[<property>=<key>&]*" * * @author Ray Chun (rchun@sonicsoftware.com) */ diff --git a/axis-rt-transport-jms/src/site/site.xml b/axis-rt-transport-jms/src/site/site.xml index ea9de8bd86..18866594ab 100644 --- a/axis-rt-transport-jms/src/site/site.xml +++ b/axis-rt-transport-jms/src/site/site.xml @@ -17,11 +17,8 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + - - - - + diff --git a/axis-rt-transport-mail/pom.xml b/axis-rt-transport-mail/pom.xml new file mode 100644 index 0000000000..14307f2ae7 --- /dev/null +++ b/axis-rt-transport-mail/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + axis-rt-transport-mail + Mail Transport + ${baseUrl}/transports/mail + + + axis + ${baseSiteUrl}/transports/mail + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + javax.mail + mail + + + commons-net + commons-net + 1.0.0 + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/Handler.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/Handler.java similarity index 95% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/Handler.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/Handler.java index 75d84144ea..663396c79f 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/Handler.java +++ b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/Handler.java @@ -24,7 +24,7 @@ * A stub URLStreamHandler, so the system will recognize our * custom URLs as valid. * - * @author Davanum Srinivas + * @author Davanum Srinivas <dims@yahoo.com> */ public class Handler extends URLStreamHandler { protected URLConnection openConnection(URL u) { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailConstants.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailConstants.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailConstants.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailConstants.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailSender.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailSender.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailSender.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailSender.java diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailServer.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailServer.java similarity index 99% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailServer.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailServer.java index 64c528fd35..f68c19de37 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailServer.java +++ b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailServer.java @@ -38,7 +38,7 @@ * use. Its intended uses are for demos, debugging, and performance * profiling. * - * @author Davanum Srinivas + * @author Davanum Srinivas <dims@yahoo.com> * @author Rob Jellinghaus (robj@unrealities.com) */ diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailTransport.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailTransport.java similarity index 96% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailTransport.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailTransport.java index 9b04c74535..2f551a7705 100644 --- a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailTransport.java +++ b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailTransport.java @@ -24,7 +24,7 @@ /** * A Transport which will cause an invocation via "mail" * - * @author Davanum Srinivas + * @author Davanum Srinivas <dims@yahoo.com> */ public class MailTransport extends Transport { public MailTransport() { diff --git a/axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailWorker.java b/axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailWorker.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/transport/mail/MailWorker.java rename to axis-rt-transport-mail/src/main/java/org/apache/axis/transport/mail/MailWorker.java diff --git a/axis-rt-transport-mail/src/site/site.xml b/axis-rt-transport-mail/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-rt-transport-mail/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-saaj/pom.xml b/axis-saaj/pom.xml index 26cdafbaa3..b0f11fdf41 100644 --- a/axis-saaj/pom.xml +++ b/axis-saaj/pom.xml @@ -26,7 +26,15 @@ ../pom.xml axis-saaj - Axis :: SAAJ + SAAJ API + Contains the SAAJ 1.2 API + ${baseUrl}/saaj + + + axis + ${baseSiteUrl}/saaj + + javax.activation @@ -52,13 +60,6 @@ - - maven-site-plugin - - true - true - - diff --git a/axis-saaj/src/main/java/javax/xml/soap/MimeHeaders.java b/axis-saaj/src/main/java/javax/xml/soap/MimeHeaders.java index 61b500af33..ffb1039fdf 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/MimeHeaders.java +++ b/axis-saaj/src/main/java/javax/xml/soap/MimeHeaders.java @@ -21,7 +21,7 @@ /** * A container for MimeHeader objects, which * represent the MIME headers present in a MIME part of a - * message.

    + * message. * *

    This class is used primarily when an application wants to * retrieve specific attachments based on certain MIME headers and diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPBody.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPBody.java index 75d735967d..6abdb82bf8 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPBody.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPBody.java @@ -81,7 +81,7 @@ public abstract SOAPBodyElement addBodyElement(Name name) * @param faultString a String giving an explanation of the * fault * @param locale a Locale object indicating the native language - * of the faultString + * of the faultString * @return the new SOAPFault object * @throws SOAPException if there is a SOAP error */ diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPConnectionFactory.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPConnectionFactory.java index 2b595745f2..02b83c26c4 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPConnectionFactory.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPConnectionFactory.java @@ -34,7 +34,7 @@ public SOAPConnectionFactory() {} * @return a new instance of a default * SOAPConnectionFactory object * @throws SOAPException if there was an error creating - * the SOAPConnectionFactory + * the SOAPConnectionFactory * @throws UnsupportedOperationException if newInstance is not supported. */ public static SOAPConnectionFactory newInstance() diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPElementFactory.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPElementFactory.java index 744c0be830..6e640216cb 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPElementFactory.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPElementFactory.java @@ -100,7 +100,7 @@ public SOAPElement create(String localName, String prefix, String uri) * @return a new instance of a * SOAPElementFactory * @throws SOAPException if there was an error creating - * the default SOAPElementFactory + * the default SOAPElementFactory */ public static SOAPElementFactory newInstance() throws SOAPException { diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPEnvelope.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPEnvelope.java index 8da3f29039..af9d06d1f0 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPEnvelope.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPEnvelope.java @@ -26,7 +26,7 @@ * required, and the SOAPHeader object, though * optional, is used in the majority of cases. If the * SOAPHeader object is not needed, it can be deleted, - * which is shown later.

    + * which is shown later. * *

    A client can access the SOAPHeader and * SOAPBody objects by calling the methods @@ -35,7 +35,7 @@ * these two methods after starting with the * SOAPMessage object message to get the * SOAPPart object sp, which is then used to get the - * SOAPEnvelope object se.

    + * SOAPEnvelope object se. *
      *    SOAPPart sp = message.getSOAPPart();
      *    SOAPEnvelope se = sp.getEnvelope();
    @@ -50,7 +50,7 @@
      *   detaches the XML element (node) on which it is called. For
      *   example, the following line of code deletes the 
      *   SOAPBody object that is retrieved by the method 
    - *   getBody.

    + * getBody
    . *
      *     se.getBody().detachNode();
      * 
    @@ -82,7 +82,7 @@ * namespace prefix, and the third creates Name * objects with just a local name. The following line of code, in * which se is a SOAPEnvelope object, creates - * a new Name object with all three.

    + * a new Name object with all three. *
      *    Name name = se.createName("GetLastTradePrice", "WOMBAT",
      *                               "http://www.wombat.org/trader");
    diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPException.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPException.java
    index b928686841..f789d7bfb0 100644
    --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPException.java
    +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPException.java
    @@ -21,7 +21,7 @@
      *   String that gives the reason for the exception, an
      *   embedded Throwable object, or both. This class
      *   provides methods for retrieving reason messages and for
    - *   retrieving the embedded Throwable object.

    + * retrieving the embedded Throwable object. * *

    Typical reasons for throwing a SOAPException * object are problems such as difficulty setting a header, not diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPFault.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPFault.java index 2b680e863c..49d4091735 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPFault.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPFault.java @@ -154,6 +154,7 @@ public abstract void setFaultString(String faultString) SOAPConstants.URI_NS_SOAP_ENVELOPE); SOAPFault fault = ...; fault.setFaultCode(qname); +

    * * It is preferable to use this method over setFaultCode(String). * diff --git a/axis-saaj/src/main/java/javax/xml/soap/SOAPPart.java b/axis-saaj/src/main/java/javax/xml/soap/SOAPPart.java index 72dd878ec4..49a8a8a34b 100644 --- a/axis-saaj/src/main/java/javax/xml/soap/SOAPPart.java +++ b/axis-saaj/src/main/java/javax/xml/soap/SOAPPart.java @@ -240,7 +240,7 @@ public void setContentLocation(String contentLocation) { /** * Sets the content of the SOAPEnvelope object * with the data from the given Source object. - * @param source javax.xml.transform.Source
    object with the data to + * @param source javax.xml.transform.Source object with the data to * be set * @throws SOAPException if there is a problem in * setting the source diff --git a/axis-saaj/src/site/site.xml b/axis-saaj/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-saaj/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-standalone-server/pom.xml b/axis-standalone-server/pom.xml index 92b48d7f58..63e0553e1c 100644 --- a/axis-standalone-server/pom.xml +++ b/axis-standalone-server/pom.xml @@ -26,7 +26,7 @@ ../pom.xml axis-standalone-server - Axis :: Stand-alone server + Stand-alone Server A Jetty based stand-alone Axis server that replaces the former SimpleAxisServer. @@ -37,6 +37,9 @@ ${baseSiteUrl}/standalone-server + + 1.5 + ${project.groupId} @@ -46,29 +49,29 @@ commons-cli commons-cli - 1.2 - + commons-daemon + commons-daemon + + org.mortbay.jetty jetty - 6.1.26 - + - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - + maven-jar-plugin + + + + true + org.apache.axis.server.standalone.cli.Main + + + - + diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/LimitSessionManager.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/LimitSessionManager.java new file mode 100644 index 0000000000..33493506a7 --- /dev/null +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/LimitSessionManager.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.server.standalone; + +import java.util.Iterator; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import javax.servlet.http.HttpServletRequest; + +import org.mortbay.jetty.servlet.AbstractSessionManager; +import org.mortbay.jetty.servlet.HashSessionManager; + +/** + * {@link HashSessionManager} extension that limits the number of concurrently active session. + * + * @author Andreas Veithen + */ +final class LimitSessionManager extends HashSessionManager { + // This is only needed to get access to some protected methods/fields. + class Session extends HashSessionManager.Session { + private static final long serialVersionUID = -6648322281268846583L; + + Session(HttpServletRequest request) { + super(request); + } + + long accessed() { + return _accessed; + } + + protected void timeout() { + super.timeout(); + } + } + + private final int maxSessions; + private ScheduledExecutorService executor; + + LimitSessionManager(int maxSessions) { + this.maxSessions = maxSessions; + } + + public void doStart() throws Exception { + super.doStart(); + executor = new ScheduledThreadPoolExecutor(1); + executor.scheduleWithFixedDelay(new Runnable() { + public void run() { + scavenge(); + } + }, 5, 5, TimeUnit.SECONDS); + } + + protected AbstractSessionManager.Session newSession(HttpServletRequest request) { + return new Session(request); + } + + void scavenge() { + while (true) { + Session sessionToRemove = null; + synchronized (this) { + if (_sessions.size() <= maxSessions) { + break; + } + long minAccessed = Long.MAX_VALUE; + for (Iterator it = _sessions.values().iterator(); it.hasNext(); ) { + Session session = (Session)it.next(); + long accessed = session.accessed(); + if (accessed < minAccessed) { + minAccessed = accessed; + sessionToRemove = session; + } + } + } + sessionToRemove.timeout(); + } + } + + public void doStop() throws Exception { + executor.shutdown(); + executor.awaitTermination(60, TimeUnit.SECONDS); + super.doStop(); + } +} diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitHandler.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitHandler.java index 853decd90a..3afef3fa5f 100644 --- a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitHandler.java +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitHandler.java @@ -29,10 +29,13 @@ /** * Handler that looks for the {@link MessageContext#QUIT_REQUESTED} flag set by {@link Admin} and * initiates the shutdown procedure if the flag is set. + *

    + * Note: this is an internal class that should not be used by application code. * * @author Andreas Veithen */ -public class QuitHandler extends BasicHandler { +// Must be public so that the Axis core can load it +public final class QuitHandler extends BasicHandler { public static final String QUIT_LISTENER = QuitListener.class.getName(); public void invoke(MessageContext msgContext) throws AxisFault { diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitListener.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitListener.java index 5600c0bd0b..4ec7ee7753 100644 --- a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitListener.java +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/QuitListener.java @@ -23,7 +23,7 @@ * * @author Andreas Veithen */ -class QuitListener { +final class QuitListener { private boolean quit; synchronized void requestQuit() { diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/ServerException.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/ServerException.java new file mode 100644 index 0000000000..f53dd3c299 --- /dev/null +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/ServerException.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.server.standalone; + +public class ServerException extends Exception { + private static final long serialVersionUID = 2996112474203025829L; + + public ServerException(Throwable cause) { + super(cause); + } +} diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServer.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServer.java index 2775a06e84..d403e05e36 100644 --- a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServer.java +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServer.java @@ -19,18 +19,14 @@ package org.apache.axis.server.standalone; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.GnuParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; import org.mortbay.jetty.Server; +import org.mortbay.jetty.SessionManager; import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.servlet.HashSessionManager; import org.mortbay.jetty.servlet.ServletHandler; import org.mortbay.jetty.servlet.ServletHolder; import org.mortbay.jetty.servlet.ServletMapping; @@ -43,77 +39,87 @@ * * @author Andreas Veithen */ -public class StandaloneAxisServer { - public static void main(String[] args) throws Exception { - Options options = new Options(); - - { - Option option = new Option("p", true, "the HTTP port"); - option.setArgName("port"); - option.setRequired(true); - options.addOption(option); - } - - { - Option option = new Option("w", true, "the work directory"); - option.setArgName("dir"); - option.setRequired(true); - options.addOption(option); - } - - { - Option option = new Option("j", true, "a list of directories to look up JWS files from"); - option.setArgName("dirs"); - options.addOption(option); - } - - if (args.length == 0) { - HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp(StandaloneAxisServer.class.getName(), options); - return; - } - - CommandLineParser parser = new GnuParser(); - CommandLine cmdLine; - try { - cmdLine = parser.parse(options, args); - } catch (ParseException ex) { - System.err.println(ex.getMessage()); - System.exit(1); - return; // Make compiler happy - } - - int port = Integer.parseInt(cmdLine.getOptionValue("p")); +public final class StandaloneAxisServer { + private int port; + private File workDir; + private int maxSessions = -1; + private File[] jwsDirs; + + private Server server; + private QuitListener quitListener; + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public File getWorkDir() { + return workDir; + } + + public void setWorkDir(File workDir) { + this.workDir = workDir; + } + + public int getMaxSessions() { + return maxSessions; + } + + public void setMaxSessions(int maxSessions) { + this.maxSessions = maxSessions; + } + + public File[] getJwsDirs() { + return jwsDirs == null ? null : (File[])jwsDirs.clone(); + } + + public void setJwsDirs(File[] jwsDirs) { + this.jwsDirs = jwsDirs == null ? null : (File[])jwsDirs.clone(); + } + + public void init() throws ServerException { + StandaloneAxisServlet servlet = new StandaloneAxisServlet(); List resources = new ArrayList(); // Add the work dir as a resource so that Axis can create its server-config.wsdd file there - File workDir = new File(cmdLine.getOptionValue("w")); new File(workDir, "WEB-INF").mkdir(); - resources.add(Resource.newResource(workDir.getAbsolutePath())); + try { + resources.add(Resource.newResource(workDir.getAbsolutePath())); + } catch (IOException ex) { + throw new ServerException(ex); + } - boolean enableJWS; - if (cmdLine.hasOption("j")) { - String[] jwsDirs = cmdLine.getOptionValue("j").split(File.pathSeparator); + if (jwsDirs != null) { for (int i=0; i 0) { ServletMapping mapping = new ServletMapping(); mapping.setServletName("AxisServlet"); mapping.setPathSpec("*.jws"); servletHandler.addServletMapping(mapping); } - server.start(); + } + + public void start() throws ServerException { + try { + server.start(); + } catch (Exception ex) { + throw new ServerException(ex); + } + } + + public void awaitQuitRequest() throws InterruptedException { + quitListener.awaitQuitRequest(); + } + + public void stop() throws ServerException { try { - quitListener.awaitQuitRequest(); - } catch (InterruptedException ex) { - // Just continue and stop the server + server.stop(); + } catch (Exception ex) { + throw new ServerException(ex); } - server.stop(); } } diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServlet.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServlet.java index 995034a6d3..fbbf12223f 100644 --- a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServlet.java +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/StandaloneAxisServlet.java @@ -18,9 +18,15 @@ */ package org.apache.axis.server.standalone; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import javax.servlet.ServletException; import org.apache.axis.WSDDEngineConfiguration; +import org.apache.axis.deployment.wsdd.WSDDDeployment; import org.apache.axis.deployment.wsdd.WSDDDocument; import org.apache.axis.server.AxisServer; import org.apache.axis.transport.http.AxisServlet; @@ -31,14 +37,24 @@ * * @author Andreas Veithen */ -public class StandaloneAxisServlet extends AxisServlet { +final class StandaloneAxisServlet extends AxisServlet { + private final List/**/ wsddUrls; + + public StandaloneAxisServlet() { + wsddUrls = new ArrayList(); + wsddUrls.add(StandaloneAxisServlet.class.getResource("quit-handler-deploy.wsdd")); + } + public void init() throws ServletException { super.init(); try { AxisServer engine = getEngine(); - WSDDDocument wsdd = new WSDDDocument(XMLUtils.newDocument( - StandaloneAxisServlet.class.getResource("quit-handler-deploy.wsdd").toExternalForm())); - wsdd.deploy(((WSDDEngineConfiguration)engine.getConfig()).getDeployment()); + WSDDDeployment registry = ((WSDDEngineConfiguration)engine.getConfig()).getDeployment(); + for (Iterator it = wsddUrls.iterator(); it.hasNext(); ) { + URL url = (URL)it.next(); + WSDDDocument wsdd = new WSDDDocument(XMLUtils.newDocument(url.toExternalForm())); + wsdd.deploy(registry); + } } catch (Exception ex) { throw new ServletException(ex); } diff --git a/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/cli/Configurator.java b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/cli/Configurator.java new file mode 100644 index 0000000000..1449feb569 --- /dev/null +++ b/axis-standalone-server/src/main/java/org/apache/axis/server/standalone/cli/Configurator.java @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.server.standalone.cli; + +import java.io.File; +import java.io.PrintWriter; + +import org.apache.axis.server.standalone.StandaloneAxisServer; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; + +public final class Configurator { + public static final Configurator INSTANCE = new Configurator(); + + private final Options options; + + private Configurator() { + options = new Options(); + + { + Option option = new Option("p", true, "the HTTP port"); + option.setArgName("port"); + option.setRequired(true); + options.addOption(option); + } + + { + Option option = new Option("w", true, "the work directory"); + option.setArgName("dir"); + option.setRequired(true); + options.addOption(option); + } + + { + Option option = new Option("j", true, "a list of directories to look up JWS files from"); + option.setArgName("dirs"); + options.addOption(option); + } + + { + Option option = new Option("m", true, "the maximum number of concurrently active sessions"); + option.setArgName("count"); + options.addOption(option); + } + } + + public void printHelp(PrintWriter pw, String app) { + HelpFormatter formatter = new HelpFormatter(); + formatter.printUsage(pw, 100, app, options); + formatter.printOptions(pw, 100, options, 1, 2); + pw.flush(); + } + + public void configure(StandaloneAxisServer server, String[] args) throws ConfiguratorException { + CommandLineParser parser = new GnuParser(); + CommandLine cmdLine; + try { + cmdLine = parser.parse(options, args); + } catch (ParseException ex) { + throw new ConfiguratorException(ex.getMessage()); + } + + server.setPort(Integer.parseInt(cmdLine.getOptionValue("p"))); + server.setWorkDir(new File(cmdLine.getOptionValue("w"))); + if (cmdLine.hasOption("m")) { + server.setMaxSessions(Integer.parseInt(cmdLine.getOptionValue("m"))); + } + if (cmdLine.hasOption("j")) { + String[] jwsDirStrings = cmdLine.getOptionValue("j").split(File.pathSeparator); + File[] jwsDirs = new File[jwsDirStrings.length]; + for (int i=0; i - + -

    - - - + diff --git a/axis-testutils/src/main/java/test/AxisFileGenTestBase.java b/axis-testutils/src/main/java/test/AxisFileGenTestBase.java index 72e5424f94..d014c93239 100644 --- a/axis-testutils/src/main/java/test/AxisFileGenTestBase.java +++ b/axis-testutils/src/main/java/test/AxisFileGenTestBase.java @@ -17,8 +17,6 @@ package test; -import org.custommonkey.xmlunit.XMLTestCase; - import java.io.File; import java.io.IOException; import java.util.Set; @@ -44,7 +42,15 @@ protected String getPrefix(String parent) { } } - abstract protected Set mayExist(); + /** + * List of files which may or may not be generated. May be overridden by + * subclasses. + */ + protected Set mayExist() { + HashSet set = new HashSet(); + return set; + } + abstract protected String rootDir(); abstract protected Set shouldExist(); diff --git a/axis-tools/pom.xml b/axis-tools/pom.xml index 4db3ca30f3..baac8149eb 100644 --- a/axis-tools/pom.xml +++ b/axis-tools/pom.xml @@ -49,20 +49,4 @@ ${project.version} - - - - maven-project-info-reports-plugin - 2.4 - - - - index - dependencies - - - - - - diff --git a/axis-tools/src/site/site.xml b/axis-tools/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/axis-tools/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/axis-war/pom.xml b/axis-war/pom.xml index 845e058238..2a2cd05a10 100644 --- a/axis-war/pom.xml +++ b/axis-war/pom.xml @@ -28,30 +28,77 @@ axis-war war Axis :: WAR + + 1.5 + ${project.groupId} axis-rt-core ${project.version} + + ${project.groupId} + axis-rt-jws + ${project.version} + + + ${project.groupId} + axis-rt-soapmonitor + ${project.version} + + + ${project.groupId} + axis-rt-management + ${project.version} + log4j log4j + + ${project.groupId} + soapmonitor-applet + ${project.version} + junit junit test + + com.google.truth + truth + test + httpunit httpunit 1.6.1 test + + commons-io + commons-io + test + + + maven-war-plugin + + WEB-INF/lib/soapmonitor-applet-*.jar + *.jws + + + ${project.groupId} + soapmonitor-applet + jar + + + + maven-resources-plugin diff --git a/axis-war/src/main/webapp/WEB-INF/server-config.wsdd b/axis-war/src/main/webapp/WEB-INF/server-config.wsdd new file mode 100644 index 0000000000..d250f46e74 --- /dev/null +++ b/axis-war/src/main/webapp/WEB-INF/server-config.wsdd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://xml.apache.org/axis/wsdd/ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/axis-war/src/main/webapp/WEB-INF/web.xml b/axis-war/src/main/webapp/WEB-INF/web.xml index 3574451a42..517caa876c 100644 --- a/axis-war/src/main/webapp/WEB-INF/web.xml +++ b/axis-war/src/main/webapp/WEB-INF/web.xml @@ -9,6 +9,10 @@ Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> org.apache.axis.transport.http.AxisHTTPSessionListener + + AxisServlet diff --git a/axis-war/src/test/java/org/apache/axis/war/Utils.java b/axis-war/src/test/java/org/apache/axis/war/Utils.java new file mode 100644 index 0000000000..77d03ee259 --- /dev/null +++ b/axis-war/src/test/java/org/apache/axis/war/Utils.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.war; + +import static org.junit.Assert.assertNotNull; + +public final class Utils { + private static String URL_PROPERTY = "test.functional.webapp.url"; + + private Utils() {} + + public static String getWebappUrl() { + String url = System.getProperty(URL_PROPERTY); + assertNotNull(URL_PROPERTY + " not set", url); + return url; + } +} diff --git a/axis-war/src/test/java/org/apache/axis/war/XssTest.java b/axis-war/src/test/java/org/apache/axis/war/XssTest.java new file mode 100644 index 0000000000..0504e1a8c2 --- /dev/null +++ b/axis-war/src/test/java/org/apache/axis/war/XssTest.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.war; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.commons.io.IOUtils; +import org.junit.Test; + +public class XssTest { + /** + * Tests for potential XSS vulnerability in the Version service. + *

    + * The Version service returns a body with whatever namespace URI was used in the request. If + * the namespace URI is not properly encoded in the response, then this creates a potential + * XSS vulnerability. + * + * @throws Exception + */ + @Test + public void testGetVersion() throws Exception { + HttpURLConnection conn = (HttpURLConnection)new URL(Utils.getWebappUrl() + "/services/Version").openConnection(); + conn.setDoInput(true); + conn.setDoOutput(true); + conn.setRequestProperty("SOAPAction", ""); + conn.setRequestProperty("Content-Type", "text/xml;charset=UTF-8"); + InputStream payload = XssTest.class.getResourceAsStream("getVersion-xss.xml"); + OutputStream out = conn.getOutputStream(); + IOUtils.copy(payload, out); + payload.close(); + out.close(); + assertThat(conn.getResponseCode()).isEqualTo(200); + InputStream in = conn.getInputStream(); + assertThat(IOUtils.toString(in, "UTF-8")).doesNotContain(" + + + + diff --git a/axis/pom.xml b/axis/pom.xml index 6bbfc323c2..01a094ce5a 100644 --- a/axis/pom.xml +++ b/axis/pom.xml @@ -28,13 +28,7 @@ axis Axis Uber-JAR Uber-JAR containing the same packages as the corresponding JAR from Axis 1.4. For compatibility only. - ${baseUrl}/core - - - axis - ${baseSiteUrl}/core - - + ${baseUrl} ${project.groupId} @@ -46,11 +40,21 @@ axis-rt-databinding-castor ${project.version} + + ${project.groupId} + axis-rt-jws + ${project.version} + ${project.groupId} axis-rt-provider-bsf ${project.version} + + ${project.groupId} + axis-rt-transport-mail + ${project.version} + ${project.groupId} axis-codegen @@ -66,7 +70,6 @@ maven-shade-plugin - 2.0 package @@ -76,11 +79,23 @@ + + ${project.groupId}:axis-rt-compat ${project.groupId}:axis-rt-core ${project.groupId}:axis-rt-databinding-castor + ${project.groupId}:axis-rt-databinding-xmlbeans + ${project.groupId}:axis-rt-management + ${project.groupId}:axis-rt-jws ${project.groupId}:axis-rt-provider-bsf + ${project.groupId}:axis-rt-soapmonitor + ${project.groupId}:axis-rt-transport-jms + ${project.groupId}:axis-rt-transport-http-hc3 + ${project.groupId}:axis-rt-transport-mail + ${project.groupId}:axis-model ${project.groupId}:axis-codegen ${project.groupId}:axis-tools + ${project.groupId}:soapmonitor-client + ${project.groupId}:tcpmon true @@ -89,6 +104,13 @@ + + maven-site-plugin + + true + true + + diff --git a/daemon-launcher/pom.xml b/daemon-launcher/pom.xml new file mode 100644 index 0000000000..ceb7f901fd --- /dev/null +++ b/daemon-launcher/pom.xml @@ -0,0 +1,50 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + daemon-launcher + Daemon Launcher + + Used by axis-server-maven-plugin to launch a Commons Daemon implementation. + + + + commons-daemon + commons-daemon + + + + + + maven-site-plugin + + true + true + + + + + diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java new file mode 100644 index 0000000000..da8f3417ad --- /dev/null +++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.daemon; + +import java.io.BufferedReader; +import java.io.Reader; +import java.util.LinkedList; + +import org.apache.commons.daemon.Daemon; + +/** + * Reads messages from the control connection. The main purpose of this is to detect as soon as + * possible when the control connection is closed by the parent process and to terminate the child + * process if that is unexpected. To achieve this we need to read the messages eagerly and place + * them into a queue. In particular this covers the case where the child process has received a + * STOP message and {@link Daemon#stop()} or {@link Daemon#destroy()} hangs. In this case, + * if the parent process is terminated (or stops waiting for the STOPPED message and closes + * the control connection), we can stop the child process immediately. + * + * @author Andreas Veithen + */ +final class ControlConnectionReader implements Runnable { + private final BufferedReader in; + private final LinkedList queue = new LinkedList(); + private boolean expectClose; + + ControlConnectionReader(Reader in) { + this.in = new BufferedReader(in); + } + + synchronized String awaitMessage() throws InterruptedException { + while (queue.isEmpty()) { + wait(); + } + return (String)queue.removeFirst(); + } + + synchronized void expectClose() { + this.expectClose = true; + } + + public void run() { + try { + String message; + while ((message = in.readLine()) != null) { + synchronized (this) { + queue.add(message); + notify(); + } + } + if (!expectClose) { + System.err.println("Control connection unexpectedly closed; terminating."); + System.exit(1); + } + } catch (Throwable ex) { + ex.printStackTrace(); + System.exit(1); + } + } +} diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java new file mode 100644 index 0000000000..414690a7e5 --- /dev/null +++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.daemon; + +import org.apache.commons.daemon.DaemonContext; +import org.apache.commons.daemon.DaemonController; + +final class DaemonContextImpl implements DaemonContext { + private final String[] args; + + public DaemonContextImpl(String[] args) { + this.args = args; + } + + public DaemonController getController() { + throw new UnsupportedOperationException(); + } + + public String[] getArguments() { + return args; + } +} diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java new file mode 100644 index 0000000000..35c15f5b0c --- /dev/null +++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.daemon; + +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; + +import org.apache.commons.daemon.Daemon; +import org.apache.commons.daemon.DaemonContext; + +/** + * Main class to launch and control a {@link Daemon} implementation. This class is typically + * executed in a child JVM and allows the parent process to control the lifecycle of the daemon + * instance. The main method takes the following arguments: + *

      + *
    1. The class name of the {@link Daemon} implementation. + *
    2. A TCP port number to use for the control connection. + *
    + * All remaining arguments are passed to the {@link Daemon} implementation. + *

    + * The class uses the following protocol to allow the parent process to control the lifecycle of the + * daemon: + *

      + *
    1. The parent process spawns a new child JVM with this class as main class. It passes the class + * name of the {@link Daemon} implementation and the control port as arguments (see above). + *
    2. The child process opens the specified TCP port and waits for the control connection to be + * established. + *
    3. The parent process connects to the control port. + *
    4. The child process {@link Daemon#init(DaemonContext) initializes} and {@link Daemon#start() + * starts} the daemon. + *
    5. The child process sends a READY message over the control connection to the parent + * process. + *
    6. When the parent process no longer needs the daemon, it sends a STOP message to the + * child process. + *
    7. The child process {@link Daemon#stop() stops} and {@link Daemon#destroy() destroys} the + * daemon. + *
    8. The child process sends a STOPPED message to the parent process, closes the control + * connection and terminates itself. + *
    9. The parent process closes the control connection. + *
    + * + * @author Andreas Veithen + */ +public class Launcher { + public static void main(String[] args) { + try { + String daemonClass = args[0]; + int controlPort = Integer.parseInt(args[1]); + String[] daemonArgs = new String[args.length-2]; + System.arraycopy(args, 2, daemonArgs, 0, args.length-2); + ServerSocket controlServerSocket = new ServerSocket(); + controlServerSocket.bind(new InetSocketAddress(InetAddress.getByName("localhost"), controlPort)); + Socket controlSocket = controlServerSocket.accept(); + // We only accept a single connection; therefore we can close the ServerSocket here + controlServerSocket.close(); + ControlConnectionReader controlIn = new ControlConnectionReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII")); + new Thread(controlIn).start(); + Writer controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII"); + Daemon daemon = (Daemon)Class.forName(daemonClass).newInstance(); + daemon.init(new DaemonContextImpl(daemonArgs)); + daemon.start(); + controlOut.write("READY\r\n"); + controlOut.flush(); + String request = controlIn.awaitMessage(); + if (request.equals("STOP")) { + daemon.stop(); + daemon.destroy(); + controlIn.expectClose(); + controlOut.write("STOPPED\r\n"); + controlOut.flush(); + System.exit(0); + } else { + throw new LauncherException("Unexpected request: " + request); + } + } catch (Throwable ex) { + ex.printStackTrace(); + System.exit(1); + } + } +} diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java new file mode 100644 index 0000000000..5d177c2738 --- /dev/null +++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.daemon; + +final class LauncherException extends Exception { + private static final long serialVersionUID = 9049901854635661634L; + + public LauncherException(String msg) { + super(msg); + } +} diff --git a/distribution/pom.xml b/distribution/pom.xml index e7dbb22c85..d62f31923f 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -34,7 +34,7 @@ ${project.groupId} - axis-rt-core + axis ${project.version} @@ -44,9 +44,18 @@ ${project.groupId} - axis-tools + axis-jaxrpc ${project.version} + + ${project.groupId} + axis-saaj + ${project.version} + + + log4j + log4j + junit junit @@ -81,7 +90,7 @@ run - + @@ -93,7 +102,7 @@ run - + @@ -139,7 +148,8 @@ ${project.build.directory}/axis-${project.version}/lib - junit + junit,mail + ${skipTests} @@ -159,6 +169,7 @@ true ${project.build.directory}/jboss/lib true + ${skipTests}
    @@ -183,10 +194,9 @@ tools-include - - java.vendor - Sun Microsystems Inc. - + + ${java.home}/../lib/tools.jar + diff --git a/distribution/src/main/assembly/bin.xml b/distribution/src/main/assembly/bin.xml index c79f678b0b..1acddae3a3 100644 --- a/distribution/src/main/assembly/bin.xml +++ b/distribution/src/main/assembly/bin.xml @@ -28,6 +28,18 @@ src/main/files / + + ../samples/addr-sample/src/main/java + / + + + ../samples/addr-sample/src/test/java + / + + + ../samples/addr-sample/src/main/wsdl + samples/addr + ../samples/attachments-sample/src/main/java / @@ -100,6 +112,18 @@ ../samples/jaxrpc-sample/src/main/wsdd samples/jaxrpc + + ../samples/jms-sample/src/main/java + / + + + ../samples/jms-sample/src/main/wsdl + samples/jms/stub + + + ../samples/jms-sample/src/main/wsdd + samples/jms + ../samples/message-sample/src/main/java / @@ -153,10 +177,37 @@ false lib - - ant:ant:jar - junit:junit:jar - + ${artifact.artifactId}.jar + + *:axis:jar + *:axis-ant:jar + + + + false + lib + jaxrpc.jar + + *:axis-jaxrpc:jar + + + + false + lib + saaj.jar + + *:axis-saaj:jar + + + + false + lib + + *:commons-discovery:jar + *:commons-logging:jar + *:log4j:jar + *:wsdl4j:jar + diff --git a/integration/pom.xml b/integration/pom.xml index 472869c2ce..7d7ce7e99c 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -40,13 +40,19 @@ ${project.groupId} - axis-standalone-server + axis-testutils ${project.version} test ${project.groupId} - axis-testutils + addr-sample + ${project.version} + test + + + ${project.groupId} + echo-sample ${project.version} test @@ -60,7 +66,7 @@ ${project.groupId} - maven-java2wsdl-plugin + java2wsdl-maven-plugin ${project.version} @@ -183,55 +189,38 @@ - - - - ${project.groupId} - maven-wsdl2java-plugin - ${project.version} - - test.functional.ServicePort - 8080 - - - samples-echo + webref - generate-test-sources - - - ../samples/echo-sample/src/main/wsdl/InteropTest.wsdl - client - 1.1 - - - http://soapinterop.org/ - samples.echo - - - http://soapinterop.org/xsd - samples.echo - - - - - - samples-addr - - generate-test-sources + generate-wsdl + process-classes - ../distribution/src/main/files/samples/addr/AddressBook.wsdl - client - 1.1 + ${project.build.directory}/work/test/wsdl/webref/DoubleBackService.wsdl + test.wsdl.webref.DoubleBack + + http://webref.wsdl.test/DoubleBack + http://localhost:8080/axis/services/DoubleBackService + DoubleBackPortType - urn:AddressFetcher2 - samples.addr + test.wsdl.webref + http://webref.wsdl.test/DoubleBack + + + + ${project.groupId} + wsdl2java-maven-plugin + ${project.version} + + test.functional.ServicePort + 8080 + + @@ -1165,6 +1154,21 @@ ${project.build.directory}/wsdd/stubheaders.wsdd + + + types + + generate-test-sources + + + src/test/wsdl/types/ComprehensiveTypes.wsdl + both + true + true + true + ${project.build.directory}/wsdd/types.wsdd + + union @@ -1181,6 +1185,25 @@ + + webref + + generate-test-sources + + + ${project.build.directory}/work/test/wsdl/webref/DoubleBackService.wsdl + both + true + test.wsdl.webref.DoubleBack + + + http://webref.wsdl.test/DoubleBack + test.wsdl.webref + + + ${project.build.directory}/wsdd/webref.wsdd + + wrapped @@ -1344,6 +1367,30 @@ + + maven-dependency-plugin + + + pre-integration-test + + copy + + + + + ${project.groupId} + addr-sample + ${project.version} + wsdd + deploy + ${project.build.directory}/wsdd + addr.wsdd + + + + + + org.codehaus.mojo build-helper-maven-plugin @@ -1364,7 +1411,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -1493,8 +1540,13 @@ test/wsdl/marshall2/types/** + true ${test.functional.ServicePort} + + + PST8PDT + diff --git a/test/wsdl/webref/DoubleBack.java b/integration/src/main/java/test/wsdl/webref/DoubleBack.java similarity index 100% rename from test/wsdl/webref/DoubleBack.java rename to integration/src/main/java/test/wsdl/webref/DoubleBack.java diff --git a/integration/src/test/java/test/dynamic/ServiceGetPort.java b/integration/src/test/java/test/dynamic/ServiceGetPort.java index 26dcce5f70..00ac5d123f 100644 --- a/integration/src/test/java/test/dynamic/ServiceGetPort.java +++ b/integration/src/test/java/test/dynamic/ServiceGetPort.java @@ -39,7 +39,7 @@ public ServiceGetPort(String name) { public void testGetGeneratedStub() throws Exception { Service service = ServiceFactory.newInstance().createService( - new URL("file:../distribution/src/main/files/samples/addr/AddressBook.wsdl"), + new URL("file:../samples/addr-sample/src/main/wsdl/AddressBook.wsdl"), new QName("urn:AddressFetcher2", "AddressBookService")); QName portName = new QName("urn:AddressFetcher2", "AddressBook"); Remote stub = service.getPort(portName, AddressBook.class); diff --git a/integration/src/test/java/test/functional/TestAutoTypes.java b/integration/src/test/java/test/functional/TestAutoTypes.java index d3d3f914b1..a0996d5c0c 100644 --- a/integration/src/test/java/test/functional/TestAutoTypes.java +++ b/integration/src/test/java/test/functional/TestAutoTypes.java @@ -32,13 +32,13 @@ public class TestAutoTypes extends TestCase { protected void setUp() throws java.lang.Exception { AxisProperties.setProperty("axis.doAutoTypes", "true"); - String[] args = { System.getProperty("basedir") + "/src/test/wsdd/functional/auto-deploy.wsdd" }; + String[] args = { "src/test/wsdd/functional/auto-deploy.wsdd" }; AdminClient.main(args); } protected void tearDown() throws java.lang.Exception { AxisProperties.setProperty("axis.doAutoTypes", "false"); - String[] args = { System.getProperty("basedir") + "/src/test/wsdd/functional/auto-undeploy.wsdd" }; + String[] args = { "/src/test/wsdd/functional/auto-undeploy.wsdd" }; AdminClient.main(args); } diff --git a/integration/src/test/java/test/wsdl/attachments/AttachmentTestCase.java b/integration/src/test/java/test/wsdl/attachments/AttachmentTestCase.java index 95c608af59..d71d95c78a 100644 --- a/integration/src/test/java/test/wsdl/attachments/AttachmentTestCase.java +++ b/integration/src/test/java/test/wsdl/attachments/AttachmentTestCase.java @@ -1,24 +1,43 @@ -/** - * AttachmentTestCase.java +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * This file was auto-generated from WSDL - * by the Apache Axis WSDL2Java emitter. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ - package test.wsdl.attachments; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; +import javax.xml.rpc.holders.FloatHolder; +import javax.xml.rpc.holders.StringHolder; + +import org.apache.axis.attachments.OctetStream; +import org.apache.axis.holders.ImageHolder; import test.HttpTestUtil; import java.util.Arrays; -public class AttachmentTestCase extends junit.framework.TestCase { - public AttachmentTestCase(java.lang.String name) { - super(name); - } +import junit.framework.TestCase; +public class AttachmentTestCase extends TestCase { + private static Pt1 getBinding() throws Exception { + AttachmentLocator loc = new AttachmentLocator(); + return loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); + } + private MimeMultipart createMimeMultipart(String data) throws Exception { // create the root multipart MimeMultipart mpRoot = new MimeMultipart("mixed"); @@ -30,187 +49,62 @@ private MimeMultipart createMimeMultipart(String data) throws Exception { return mpRoot; } - public void test1AttachmentPortRPCGetCompanyInfo2() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - java.lang.String value = null; - value = binding.getCompanyInfo2(0, new java.lang.String("GetCompanyInfo2"), null); - assertEquals(value, "GetCompanyInfo2"); + public void testGetCompanyInfo() throws Exception { + FloatHolder result = new FloatHolder(); + StringHolder docs = new StringHolder(); + ImageHolder logo = new ImageHolder(); + getBinding().getCompanyInfo("IBM", result, docs, logo); + assertEquals(134, (int)(result.value*10)); + assertEquals("IBM", docs.value); + assertNotNull(logo.value); + assertEquals(24, logo.value.getWidth(null)); + assertEquals(24, logo.value.getHeight(null)); + } + + public void testGetCompanyInfo2() throws Exception { + assertEquals("GetCompanyInfo2", getBinding().getCompanyInfo2(0, "GetCompanyInfo2", null)); } - public void test2AttachmentPortRPCInputPlainText() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - binding.inputPlainText(new java.lang.String("InputPlainText")); + public void testInputPlainText() throws Exception { + getBinding().inputPlainText("InputPlainText"); // TBD - validate results } - public void test3AttachmentPortRPCInoutPlainText() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - java.lang.String value = null; - value = binding.inoutPlainText(new java.lang.String("InoutPlainText")); - // TBD - validate results - assertEquals(value, "InoutPlainText"); + public void testInoutPlainText() throws Exception { + assertEquals("InoutPlainText", getBinding().inoutPlainText("InoutPlainText")); } - public void test4AttachmentPortRPCEchoPlainText() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - java.lang.String value = null; - value = binding.echoPlainText(new java.lang.String("EchoPlainText")); - // TBD - validate results - assertEquals(value, "EchoPlainText"); + public void testEchoPlainText() throws Exception { + assertEquals("EchoPlainText", getBinding().echoPlainText("EchoPlainText")); } - public void test5AttachmentPortRPCOutputPlainText() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - java.lang.String value = null; - value = binding.outputPlainText(); - // TBD - validate results - assertEquals(value, "OutputPlainText"); + public void testOutputPlainText() throws Exception { + assertEquals("OutputPlainText", getBinding().outputPlainText()); } - public void test6AttachmentPortRPCInputMimeMultipart() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - binding.inputMimeMultipart(createMimeMultipart("InputMimeMultipart")); + public void testInputMimeMultipart() throws Exception { + getBinding().inputMimeMultipart(createMimeMultipart("InputMimeMultipart")); // TBD - validate results } - public void test7AttachmentPortRPCInoutMimeMultipart() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - javax.mail.internet.MimeMultipart value = null; - value = binding.inoutMimeMultipart(createMimeMultipart("InoutMimeMultipart")); + public void testInoutMimeMultipart() throws Exception { + MimeMultipart value = getBinding().inoutMimeMultipart(createMimeMultipart("InoutMimeMultipart")); // TBD - validate results } - public void test8AttachmentPortRPCEchoMimeMultipart() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - javax.mail.internet.MimeMultipart value = null; - value = binding.echoMimeMultipart(createMimeMultipart("EchoMimeMultipart")); + public void testEchoMimeMultipart() throws Exception { + MimeMultipart value = getBinding().echoMimeMultipart(createMimeMultipart("EchoMimeMultipart")); // TBD - validate results } - public void test9AttachmentPortRPCOutputMimeMultipart() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } catch (javax.xml.rpc.ServiceException jre) { - if (jre.getLinkedCause() != null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - javax.mail.internet.MimeMultipart value = null; - value = binding.outputMimeMultipart(); + public void testOutputMimeMultipart() throws Exception { + MimeMultipart value = getBinding().outputMimeMultipart(); // TBD - validate results } - public void test10AttachmentPortRPCEchoAttachment() throws Exception { - test.wsdl.attachments.Pt1 binding; - try { - AttachmentLocator loc = new AttachmentLocator(); - binding = loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); - } - catch (javax.xml.rpc.ServiceException jre) { - if(jre.getLinkedCause()!=null) - jre.getLinkedCause().printStackTrace(); - throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - - // Test operation - org.apache.axis.attachments.OctetStream input = new org.apache.axis.attachments.OctetStream("EchoAttachment".getBytes()); - org.apache.axis.attachments.OctetStream output = null; - output = binding.echoAttachment(input); - // TBD - validate results + public void testEchoAttachment() throws Exception { + OctetStream input = new OctetStream("EchoAttachment".getBytes()); + OctetStream output = getBinding().echoAttachment(input); assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } } diff --git a/integration/src/test/java/test/wsdl/attachments/B1Impl.java b/integration/src/test/java/test/wsdl/attachments/B1Impl.java index d70f4369ff..31d525f708 100644 --- a/integration/src/test/java/test/wsdl/attachments/B1Impl.java +++ b/integration/src/test/java/test/wsdl/attachments/B1Impl.java @@ -7,9 +7,17 @@ package test.wsdl.attachments; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.rmi.RemoteException; + import javax.mail.MessagingException; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; +import javax.xml.rpc.holders.FloatHolder; +import javax.xml.rpc.holders.StringHolder; + +import org.apache.axis.holders.ImageHolder; public class B1Impl implements test.wsdl.attachments.Pt1 { @@ -24,6 +32,16 @@ private MimeMultipart createMimeMultipart(String data) throws MessagingException return mpRoot; } + public void getCompanyInfo(String tickerSymbol, FloatHolder result, StringHolder docs, ImageHolder logo) throws RemoteException { + result.value = 13.4f; + docs.value = tickerSymbol; + BufferedImage image = new BufferedImage(24, 24, BufferedImage.TYPE_INT_ARGB); + Graphics g = image.createGraphics(); + g.drawLine(0, 0, 24, 24); + g.dispose(); + logo.value = image; + } + public java.lang.String getCompanyInfo2(float result, java.lang.String docs, java.awt.Image logo) throws java.rmi.RemoteException { return docs; } diff --git a/integration/src/test/java/test/wsdl/multithread/Invoker.java b/integration/src/test/java/test/wsdl/multithread/Invoker.java new file mode 100644 index 0000000000..e23aba0cc0 --- /dev/null +++ b/integration/src/test/java/test/wsdl/multithread/Invoker.java @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package test.wsdl.multithread; + +import java.util.concurrent.CountDownLatch; + +import org.apache.axis.components.logger.LogFactory; +import org.apache.commons.logging.Log; + +import samples.addr.Address; +import samples.addr.AddressBook; +import samples.addr.Phone; +import samples.addr.StateType; + +class Invoker implements Runnable { + private static Log log = LogFactory.getLog(Invoker.class.getName()); + + private final AddressBook binding; + private final CountDownLatch readyLatch; + private final CountDownLatch startLatch; + private final Report report; + private final int numInvocations; + + Invoker(AddressBook binding, CountDownLatch readyLatch, CountDownLatch startLatch, Report report, + int numInvocations) { + this.binding = binding; + this.readyLatch = readyLatch; + this.startLatch = startLatch; + this.report = report; + this.numInvocations = numInvocations; + } + + public void run() { + try { + // This ensures that all threads start sending requests at the same time, + // thereby increasing the probability of triggering a concurrency issue. + readyLatch.countDown(); + startLatch.await(); + + for (int i = 0; i < numInvocations; ++i) { + Address address = new Address(); + Phone phone = new Phone(); + address.setStreetNum(i); + address.setStreetName("2"); + address.setCity("3"); + address.setState(StateType.TX); + address.setZip(i); + phone.setAreaCode(11); + phone.setExchange("22"); + phone.setNumber("33"); + address.setPhoneNumber(phone); + + binding.addEntry("hi", address); + Address addressRet = binding.getAddressFromName("hi"); + // succeeded, count it. + report.addSuccess(); + } + } catch (Throwable t) { + // Log a stack trace as we may not be so lucky next time! + log.fatal("Throwable caught: ", t); + + report.setError(t); + } + } // run +} \ No newline at end of file diff --git a/integration/src/test/java/test/wsdl/multithread/MultithreadTestCase.java b/integration/src/test/java/test/wsdl/multithread/MultithreadTestCase.java new file mode 100644 index 0000000000..726fe6d0ac --- /dev/null +++ b/integration/src/test/java/test/wsdl/multithread/MultithreadTestCase.java @@ -0,0 +1,75 @@ +package test.wsdl.multithread; + +import java.util.concurrent.CountDownLatch; + +import junit.framework.TestCase; +import samples.addr.AddressBook; +import samples.addr.AddressBookSOAPBindingStub; +import samples.addr.AddressBookServiceLocator; +import test.HttpTestUtil; + +public class MultithreadTestCase extends TestCase { + /** + * This test calls a single stub multiple times from multiple threads. Before the + * stub was made threadsafe, there was a good chance this test would fail with an + * IllegalStateException or "javax.xml.rpc.ServiceException: Number of parameters + * passed in (2) doesn't match the number of IN/INOUT parameters (4) from the + * addParameter() calls" or something else just as cryptic. + */ + public void testSingleStub() throws Throwable { + AddressBookServiceLocator loc = new AddressBookServiceLocator(); + final AddressBook binding = loc.getAddressBook(HttpTestUtil.getTestEndpoint(loc.getAddressBookAddress())); + ((AddressBookSOAPBindingStub) binding).setMaintainSession(true); + testMultithreading(new StubSupplier() { + public AddressBook getStub() throws Exception { + return binding; + } + }); + } + + /** + * Tests concurrent invocations of different stubs (one per thread) created from a single + * locator. This tests the scenario described in AXIS-2498. + */ + public void testSingleLocator() throws Throwable { + final AddressBookServiceLocator loc = new AddressBookServiceLocator(); + testMultithreading(new StubSupplier() { + public AddressBook getStub() throws Exception { + AddressBook binding = loc.getAddressBook(HttpTestUtil.getTestEndpoint(loc.getAddressBookAddress())); + ((AddressBookSOAPBindingStub) binding).setMaintainSession(true); + return binding; + } + }); + } + + private void testMultithreading(StubSupplier stubSupplier) throws Throwable { + Report report = new Report(); + final int numThreads = 50; + final int numInvocations = 10; + CountDownLatch readyLatch = new CountDownLatch(numThreads); + CountDownLatch startLatch = new CountDownLatch(1); + Thread[] threads = new Thread[numThreads]; + for (int i = 0; i < numThreads; ++i) { + threads[i] = new Thread(new Invoker(stubSupplier.getStub(), readyLatch, startLatch, report, numInvocations)); + threads[i].start(); + } + readyLatch.await(); + startLatch.countDown(); + for (int i = 0; i < numThreads; ++i) { + threads[i].join(30000); + StackTraceElement[] stack = threads[i].getStackTrace(); + if (stack.length > 0) { + Throwable t = new Throwable("Hanging thread detected"); + t.setStackTrace(stack); + throw t; + } + } + Throwable error = report.getError(); + if (error != null) { + throw error; + } + assertEquals("number of successes", numThreads * numInvocations, report.getSuccessCount()); + } // testMultithreading +} // class MultithreadTestCase + diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java b/integration/src/test/java/test/wsdl/multithread/Report.java similarity index 61% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java rename to integration/src/test/java/test/wsdl/multithread/Report.java index 3dddd07905..c779bce912 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java +++ b/integration/src/test/java/test/wsdl/multithread/Report.java @@ -16,21 +16,30 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.axis.tools.maven.server; - -import org.codehaus.plexus.logging.Logger; +package test.wsdl.multithread; /** - * Action to be executed after a given process has been started. This is typically used to configure - * the server process, e.g. to deploy services. - * - * @author Andreas Veithen + * Collects the results from a set of {@link Invoker} instances. */ -public interface ProcessStartAction { - ProcessStartAction NOP = new ProcessStartAction() { - public void execute(Logger logger, Process process) throws Exception { +class Report { + private int successCount = 0; + private Throwable error; + + synchronized void addSuccess() { + successCount++; + } + + synchronized int getSuccessCount() { + return successCount; + } + + synchronized void setError(Throwable error) { + if (this.error == null) { + this.error = error; } - }; - - void execute(Logger logger, Process process) throws Exception; + } + + synchronized Throwable getError() { + return error; + } } diff --git a/integration/src/test/java/test/wsdl/multithread/StubSupplier.java b/integration/src/test/java/test/wsdl/multithread/StubSupplier.java new file mode 100644 index 0000000000..6e6df0e5e9 --- /dev/null +++ b/integration/src/test/java/test/wsdl/multithread/StubSupplier.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package test.wsdl.multithread; + +import samples.addr.AddressBook; + +/** + * Supplies a stub instance to a given {@link Invoker}. Depending on the implementation this may be + * a singleton or a new stub for each {@link Invoker}. + */ +interface StubSupplier { + AddressBook getStub() throws Exception; +} diff --git a/integration/src/test/java/test/wsdl/query/FileGenWrappedTestCase.java b/integration/src/test/java/test/wsdl/query/FileGenWrappedTestCase.java index 25a894830f..66cc4555e8 100644 --- a/integration/src/test/java/test/wsdl/query/FileGenWrappedTestCase.java +++ b/integration/src/test/java/test/wsdl/query/FileGenWrappedTestCase.java @@ -59,8 +59,7 @@ protected Set mayExist() { * The directory containing the files that should exist. */ protected String rootDir() { - return System.getProperty("basedir", ".") + File.separator + - "target" + File.separator + "generated-test-sources" + File.separator + + return "target" + File.separator + "generated-test-sources" + File.separator + "wsdl2java" + File.separator + "test" + File.separator + "wsdl" + File.separator + "query"; diff --git a/test/wsdl/types/DynamicProxyTestCase.java b/integration/src/test/java/test/wsdl/types/DynamicProxyTestCase.java similarity index 99% rename from test/wsdl/types/DynamicProxyTestCase.java rename to integration/src/test/java/test/wsdl/types/DynamicProxyTestCase.java index 7abb63b9d9..078f24e585 100644 --- a/test/wsdl/types/DynamicProxyTestCase.java +++ b/integration/src/test/java/test/wsdl/types/DynamicProxyTestCase.java @@ -39,6 +39,8 @@ import org.apache.axis.types.UnsignedShort; import org.apache.axis.types.Year; import org.apache.axis.types.YearMonth; + +import test.HttpTestUtil; import test.wsdl.types.comprehensive_service.TypeTest; import javax.xml.namespace.QName; @@ -64,6 +66,8 @@ import javax.xml.rpc.holders.ShortHolder; import javax.xml.rpc.holders.ShortWrapperHolder; import javax.xml.rpc.holders.StringHolder; + +import java.io.File; import java.math.BigDecimal; import java.math.BigInteger; import java.net.MalformedURLException; @@ -79,11 +83,13 @@ public DynamicProxyTestCase(String name) { private TypeTest getProxyWithWSDL() { try { Service service = ServiceFactory.newInstance().createService( - new URL("file", "", "test/wsdl/types/ComprehensiveTypes.wsdl"), + new File("src/test/wsdl/types/ComprehensiveTypes.wsdl").getAbsoluteFile().toURL(), new QName("urn:comprehensive-service.types.wsdl.test", "TypeTestService")); - return (TypeTest) service.getPort( + Stub stub = (Stub)service.getPort( new QName("", "TypeTest"), TypeTest.class); + stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, HttpTestUtil.getTestEndpoint((String)stub._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)).toString()); + return (TypeTest)stub; } catch (MalformedURLException mue) { throw new AssertionFailedError( diff --git a/test/wsdl/types/VerifyTestCase.java b/integration/src/test/java/test/wsdl/types/VerifyTestCase.java similarity index 99% rename from test/wsdl/types/VerifyTestCase.java rename to integration/src/test/java/test/wsdl/types/VerifyTestCase.java index a8a5f9c43c..a09b6af609 100644 --- a/test/wsdl/types/VerifyTestCase.java +++ b/integration/src/test/java/test/wsdl/types/VerifyTestCase.java @@ -37,6 +37,8 @@ import org.apache.axis.types.UnsignedShort; import org.apache.axis.types.Year; import org.apache.axis.types.YearMonth; + +import test.HttpTestUtil; import test.wsdl.types.comprehensive_service.TypeTest; import test.wsdl.types.comprehensive_service.TypeTestServiceLocator; import test.wsdl.types.comprehensive_types.Animal; @@ -103,7 +105,8 @@ public void testTypeTestWSDL() throws Exception { public void testTypeTest() throws Exception { TypeTest binding; try { - binding = new TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); diff --git a/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java b/integration/src/test/java/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java similarity index 81% rename from test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java rename to integration/src/test/java/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java index ec153ff56c..10fb72b1bd 100644 --- a/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java +++ b/integration/src/test/java/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java @@ -7,6 +7,8 @@ package test.wsdl.types.comprehensive_service; +import test.HttpTestUtil; + public class TypeTestServiceTestCase extends junit.framework.TestCase { public TypeTestServiceTestCase(java.lang.String name) { super(name); @@ -24,8 +26,8 @@ public void testTypeTestWSDL() throws Exception { public void test1TypeTestAllPrimitivesIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -45,8 +47,8 @@ public void test1TypeTestAllPrimitivesIn() throws Exception { public void test2TypeTestAllPrimitivesInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -66,8 +68,8 @@ public void test2TypeTestAllPrimitivesInout() throws Exception { public void test3TypeTestAllPrimitivesOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -87,8 +89,8 @@ public void test3TypeTestAllPrimitivesOut() throws Exception { public void test4TypeTestEnumIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -108,8 +110,8 @@ public void test4TypeTestEnumIn() throws Exception { public void test5TypeTestEnumInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -129,8 +131,8 @@ public void test5TypeTestEnumInout() throws Exception { public void test6TypeTestEnumOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -150,8 +152,8 @@ public void test6TypeTestEnumOut() throws Exception { public void test7TypeTestEnumReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -172,8 +174,8 @@ public void test7TypeTestEnumReturn() throws Exception { public void test8TypeTestEnumIntIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -193,8 +195,8 @@ public void test8TypeTestEnumIntIn() throws Exception { public void test9TypeTestEnumIntInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -214,8 +216,8 @@ public void test9TypeTestEnumIntInout() throws Exception { public void test10TypeTestEnumIntOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -235,8 +237,8 @@ public void test10TypeTestEnumIntOut() throws Exception { public void test11TypeTestEnumIntReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -257,8 +259,8 @@ public void test11TypeTestEnumIntReturn() throws Exception { public void test12TypeTestArrayIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -278,8 +280,8 @@ public void test12TypeTestArrayIn() throws Exception { public void test13TypeTestArrayInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -299,8 +301,8 @@ public void test13TypeTestArrayInout() throws Exception { public void test14TypeTestArrayOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -320,8 +322,8 @@ public void test14TypeTestArrayOut() throws Exception { public void test15TypeTestArrayReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -342,8 +344,8 @@ public void test15TypeTestArrayReturn() throws Exception { public void test16TypeTestArrayMIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -363,8 +365,8 @@ public void test16TypeTestArrayMIn() throws Exception { public void test17TypeTestArrayMInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -384,8 +386,8 @@ public void test17TypeTestArrayMInout() throws Exception { public void test18TypeTestArrayMOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -405,8 +407,8 @@ public void test18TypeTestArrayMOut() throws Exception { public void test19TypeTestArrayMReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -427,8 +429,8 @@ public void test19TypeTestArrayMReturn() throws Exception { public void test20TypeTestComplexAllIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -448,8 +450,8 @@ public void test20TypeTestComplexAllIn() throws Exception { public void test21TypeTestComplexAllInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -469,8 +471,8 @@ public void test21TypeTestComplexAllInout() throws Exception { public void test22TypeTestComplexAllOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -490,8 +492,8 @@ public void test22TypeTestComplexAllOut() throws Exception { public void test23TypeTestComplexAllReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -512,8 +514,8 @@ public void test23TypeTestComplexAllReturn() throws Exception { public void test24TypeTestComplexSequenceIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -533,8 +535,8 @@ public void test24TypeTestComplexSequenceIn() throws Exception { public void test25TypeTestComplexSequenceInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -554,8 +556,8 @@ public void test25TypeTestComplexSequenceInout() throws Exception { public void test26TypeTestComplexSequenceOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -575,8 +577,8 @@ public void test26TypeTestComplexSequenceOut() throws Exception { public void test27TypeTestComplexSequenceReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -597,8 +599,8 @@ public void test27TypeTestComplexSequenceReturn() throws Exception { public void test32TypeTestComplexWComplexIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -618,8 +620,8 @@ public void test32TypeTestComplexWComplexIn() throws Exception { public void test33TypeTestComplexWComplexInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -639,8 +641,8 @@ public void test33TypeTestComplexWComplexInout() throws Exception { public void test34TypeTestComplexWComplexOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -660,8 +662,8 @@ public void test34TypeTestComplexWComplexOut() throws Exception { public void test35TypeTestComplexWComplexReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -682,8 +684,8 @@ public void test35TypeTestComplexWComplexReturn() throws Exception { public void test36TypeTestEmptyComplexTypeIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -708,8 +710,8 @@ public void test36TypeTestEmptyComplexTypeIn() throws Exception { public void test37TypeTestEmptyComplexTypeInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -734,8 +736,8 @@ public void test37TypeTestEmptyComplexTypeInout() throws Exception { public void test38TypeTestEmptyComplexTypeOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -760,8 +762,8 @@ public void test38TypeTestEmptyComplexTypeOut() throws Exception { public void test39TypeTestEmptyComplexTypeReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -787,8 +789,8 @@ public void test39TypeTestEmptyComplexTypeReturn() throws Exception { public void test40TypeTestAnyIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -808,8 +810,8 @@ public void test40TypeTestAnyIn() throws Exception { public void test41TypeTestAnyInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -829,8 +831,8 @@ public void test41TypeTestAnyInout() throws Exception { public void test42TypeTestAnyOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -850,8 +852,8 @@ public void test42TypeTestAnyOut() throws Exception { public void test43TypeTestAnyReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -872,8 +874,8 @@ public void test43TypeTestAnyReturn() throws Exception { public void test44TypeTestAnimalIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -893,8 +895,8 @@ public void test44TypeTestAnimalIn() throws Exception { public void test45TypeTestAnimalInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -914,8 +916,8 @@ public void test45TypeTestAnimalInout() throws Exception { public void test46TypeTestAnimalOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -935,8 +937,8 @@ public void test46TypeTestAnimalOut() throws Exception { public void test47TypeTestAnimalReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -957,8 +959,8 @@ public void test47TypeTestAnimalReturn() throws Exception { public void test48TypeTestCatIn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -978,8 +980,8 @@ public void test48TypeTestCatIn() throws Exception { public void test49TypeTestCatInout() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -999,8 +1001,8 @@ public void test49TypeTestCatInout() throws Exception { public void test50TypeTestCatOut() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1020,8 +1022,8 @@ public void test50TypeTestCatOut() throws Exception { public void test51TypeTestCatReturn() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1042,8 +1044,8 @@ public void test51TypeTestCatReturn() throws Exception { public void test52TypeTestMethodBoolean() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1064,8 +1066,8 @@ public void test52TypeTestMethodBoolean() throws Exception { public void test53TypeTestMethodByte() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1086,8 +1088,8 @@ public void test53TypeTestMethodByte() throws Exception { public void test54TypeTestMethodShort() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1108,8 +1110,8 @@ public void test54TypeTestMethodShort() throws Exception { public void test55TypeTestMethodInt() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1130,8 +1132,8 @@ public void test55TypeTestMethodInt() throws Exception { public void test56TypeTestMethodLong() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1152,8 +1154,8 @@ public void test56TypeTestMethodLong() throws Exception { public void test57TypeTestMethodFloat() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1174,8 +1176,8 @@ public void test57TypeTestMethodFloat() throws Exception { public void test58TypeTestMethodDouble() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1196,8 +1198,8 @@ public void test58TypeTestMethodDouble() throws Exception { public void test59TypeTestMethodString() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1218,8 +1220,8 @@ public void test59TypeTestMethodString() throws Exception { public void test60TypeTestMethodInteger() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1240,8 +1242,8 @@ public void test60TypeTestMethodInteger() throws Exception { public void test61TypeTestMethodDecimal() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1262,8 +1264,8 @@ public void test61TypeTestMethodDecimal() throws Exception { public void test62TypeTestMethodDateTime() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1284,8 +1286,8 @@ public void test62TypeTestMethodDateTime() throws Exception { public void test63TypeTestMethodQName() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1306,8 +1308,8 @@ public void test63TypeTestMethodQName() throws Exception { public void test64TypeTestMethodTime() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1328,8 +1330,8 @@ public void test64TypeTestMethodTime() throws Exception { public void test65TypeTestMethodUnsignedLong() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1350,8 +1352,8 @@ public void test65TypeTestMethodUnsignedLong() throws Exception { public void test66TypeTestMethodUnsignedInt() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1372,8 +1374,8 @@ public void test66TypeTestMethodUnsignedInt() throws Exception { public void test67TypeTestMethodUnsignedShort() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1394,8 +1396,8 @@ public void test67TypeTestMethodUnsignedShort() throws Exception { public void test68TypeTestMethodUnsignedByte() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1416,8 +1418,8 @@ public void test68TypeTestMethodUnsignedByte() throws Exception { public void test69TypeTestMethodNonNegativeInteger() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1438,8 +1440,8 @@ public void test69TypeTestMethodNonNegativeInteger() throws Exception { public void test70TypeTestMethodPositiveInteger() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1460,8 +1462,8 @@ public void test70TypeTestMethodPositiveInteger() throws Exception { public void test71TypeTestMethodNonPositiveInteger() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1482,8 +1484,8 @@ public void test71TypeTestMethodNonPositiveInteger() throws Exception { public void test72TypeTestMethodNegativeInteger() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1504,8 +1506,8 @@ public void test72TypeTestMethodNegativeInteger() throws Exception { public void test73TypeTestMethodAnyURI() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1526,8 +1528,8 @@ public void test73TypeTestMethodAnyURI() throws Exception { public void test74TypeTestMethodSimpleAnyURI() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1547,8 +1549,8 @@ public void test74TypeTestMethodSimpleAnyURI() throws Exception { public void test75TypeTestMethodYear() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1569,8 +1571,8 @@ public void test75TypeTestMethodYear() throws Exception { public void test76TypeTestMethodMonth() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1591,8 +1593,8 @@ public void test76TypeTestMethodMonth() throws Exception { public void test77TypeTestMethodDay() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1613,8 +1615,8 @@ public void test77TypeTestMethodDay() throws Exception { public void test78TypeTestMethodYearMonth() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1635,8 +1637,8 @@ public void test78TypeTestMethodYearMonth() throws Exception { public void test79TypeTestMethodMonthDay() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1657,8 +1659,8 @@ public void test79TypeTestMethodMonthDay() throws Exception { public void test80TypeTestMethodSoapString() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1679,8 +1681,8 @@ public void test80TypeTestMethodSoapString() throws Exception { public void test81TypeTestMethodSoapBoolean() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1701,8 +1703,8 @@ public void test81TypeTestMethodSoapBoolean() throws Exception { public void test82TypeTestMethodSoapFloat() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1723,8 +1725,8 @@ public void test82TypeTestMethodSoapFloat() throws Exception { public void test83TypeTestMethodSoapDouble() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1745,8 +1747,8 @@ public void test83TypeTestMethodSoapDouble() throws Exception { public void test84TypeTestMethodSoapDecimal() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1767,8 +1769,8 @@ public void test84TypeTestMethodSoapDecimal() throws Exception { public void test85TypeTestMethodSoapInt() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) @@ -1789,8 +1791,8 @@ public void test85TypeTestMethodSoapInt() throws Exception { public void test86TypeTestMethodSoapShort() throws Exception { test.wsdl.types.comprehensive_service.TypeTestBindingStub binding; try { - binding = (test.wsdl.types.comprehensive_service.TypeTestBindingStub) - new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest(); + TypeTestServiceLocator loc = new TypeTestServiceLocator(); + binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) diff --git a/test/wsdl/webref/DoubleBackServiceTestCase.java b/integration/src/test/java/test/wsdl/webref/DoubleBackServiceTestCase.java similarity index 73% rename from test/wsdl/webref/DoubleBackServiceTestCase.java rename to integration/src/test/java/test/wsdl/webref/DoubleBackServiceTestCase.java index a040fd92c7..ac5dda47e9 100644 --- a/test/wsdl/webref/DoubleBackServiceTestCase.java +++ b/integration/src/test/java/test/wsdl/webref/DoubleBackServiceTestCase.java @@ -7,6 +7,8 @@ package test.wsdl.webref; +import test.HttpTestUtil; + public class DoubleBackServiceTestCase extends junit.framework.TestCase { public DoubleBackServiceTestCase(java.lang.String name) { super(name); @@ -14,16 +16,16 @@ public DoubleBackServiceTestCase(java.lang.String name) { public void testDoubleBackServiceWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); - java.net.URL url = new java.net.URL(new test.wsdl.webref.DoubleBackPortTypeServiceLocator().getDoubleBackServiceAddress() + "?WSDL"); - javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.webref.DoubleBackPortTypeServiceLocator().getServiceName()); + java.net.URL url = HttpTestUtil.getTestEndpoint(new DoubleBackPortTypeServiceLocator().getDoubleBackServiceAddress() + "?WSDL"); + javax.xml.rpc.Service service = serviceFactory.createService(url, new DoubleBackPortTypeServiceLocator().getServiceName()); assertTrue(service != null); } public void test1DoubleBackServiceEcho() throws Exception { test.wsdl.webref.DoubleBackServiceSoapBindingStub binding; try { - binding = (test.wsdl.webref.DoubleBackServiceSoapBindingStub) - new test.wsdl.webref.DoubleBackPortTypeServiceLocator().getDoubleBackService(); + DoubleBackPortTypeServiceLocator loc = new DoubleBackPortTypeServiceLocator(); + binding = (DoubleBackServiceSoapBindingStub)loc.getDoubleBackService(HttpTestUtil.getTestEndpoint(loc.getDoubleBackServiceAddress())); } catch (javax.xml.rpc.ServiceException jre) { if(jre.getLinkedCause()!=null) diff --git a/integration/src/test/wsdl/attachments/mime.wsdl b/integration/src/test/wsdl/attachments/mime.wsdl index 2290407b38..85e74c8ce2 100644 --- a/integration/src/test/wsdl/attachments/mime.wsdl +++ b/integration/src/test/wsdl/attachments/mime.wsdl @@ -59,12 +59,10 @@ - @@ -110,7 +108,6 @@ - diff --git a/test/wsdl/types/ComprehensiveTypes.wsdl b/integration/src/test/wsdl/types/ComprehensiveTypes.wsdl similarity index 100% rename from test/wsdl/types/ComprehensiveTypes.wsdl rename to integration/src/test/wsdl/types/ComprehensiveTypes.wsdl diff --git a/interop-mock/pom.xml b/interop-mock/pom.xml index 78240e6130..3cef4de261 100644 --- a/interop-mock/pom.xml +++ b/interop-mock/pom.xml @@ -28,6 +28,9 @@ interop-mock Interoperability mock services war + + 1.5 + org.springframework @@ -72,14 +75,6 @@ - - maven-compiler-plugin - true - - 1.5 - 1.5 - - org.mortbay.jetty jetty-maven-plugin diff --git a/interop-mock/src/main/java/org/apache/axis/test/interop/mock/DOMUtil.java b/interop-mock/src/main/java/org/apache/axis/test/interop/mock/DOMUtil.java index 4c64a8e8b4..916c2c5cd3 100644 --- a/interop-mock/src/main/java/org/apache/axis/test/interop/mock/DOMUtil.java +++ b/interop-mock/src/main/java/org/apache/axis/test/interop/mock/DOMUtil.java @@ -29,6 +29,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.w3c.dom.Text; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -75,7 +76,19 @@ public static void removeWhitespace(Element element) { switch (child.getNodeType()) { case Node.TEXT_NODE: if (previousChild != null || nextChild != null) { - element.removeChild(child); + String content = ((Text)child).getData(); + boolean isWhitespace = true; + for (int i=0; i ' ') { + isWhitespace = false; + break; + } + } + if (isWhitespace) { + element.removeChild(child); + } } break; case Node.ELEMENT_NODE: diff --git a/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java b/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java index 0b9a9f6faa..517e281aa5 100644 --- a/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java +++ b/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java @@ -104,6 +104,7 @@ protected void handleSOAPRequest(HttpServletRequest httpRequest, HttpServletResp } } Element request = requestDocument.getDocumentElement(); + DOMUtil.removeWhitespace(request); if (requestProcessors != null) { for (MessageProcessor processor : requestProcessors) { if (log.isDebugEnabled()) { diff --git a/interop-mock/src/main/resources/terra/GetPlaceList-request.xml b/interop-mock/src/main/resources/terra/GetPlaceList-request.xml new file mode 100644 index 0000000000..9c944eb009 --- /dev/null +++ b/interop-mock/src/main/resources/terra/GetPlaceList-request.xml @@ -0,0 +1,9 @@ + + + + Boston + 5 + true + + + \ No newline at end of file diff --git a/interop-mock/src/main/resources/terra/GetPlaceList-response.xml b/interop-mock/src/main/resources/terra/GetPlaceList-response.xml new file mode 100644 index 0000000000..735d1ed86c --- /dev/null +++ b/interop-mock/src/main/resources/terra/GetPlaceList-response.xml @@ -0,0 +1,78 @@ + + + + + + + Boston + Georgia + United States + +
    + -83.790000915527344 + 30.790000915527344 +
    + 3 + CityTown + 0 +
    + + + Boston + Pennsylvania + United States + +
    + -79.80999755859375 + 40.299999237060547 +
    + 3 + CityTown + 0 +
    + + + Boston + Massachusetts + United States + +
    + -71.050003051757812 + 42.360000610351563 +
    + 3 + CityTown + 0 +
    + + + Boston + Alabama + United States + +
    + -86.481941223144531 + 31.467777252197266 +
    + 3 + OtherLandFeature + 0 +
    + + + Boston + Arkansas + United States + +
    + -93.601112365722656 + 35.840557098388672 +
    + 3 + OtherLandFeature + 0 +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/interop-mock/src/main/resources/terra/README.txt b/interop-mock/src/main/resources/terra/README.txt new file mode 100644 index 0000000000..51e61d5007 --- /dev/null +++ b/interop-mock/src/main/resources/terra/README.txt @@ -0,0 +1,2 @@ +The messages in this folder have been created from requests sent to +http://msrmaps.com/terraservice2.asmx. \ No newline at end of file diff --git a/interop-mock/src/main/resources/uddi_v1/README.txt b/interop-mock/src/main/resources/uddi_v1/README.txt new file mode 100644 index 0000000000..5f20c8c783 --- /dev/null +++ b/interop-mock/src/main/resources/uddi_v1/README.txt @@ -0,0 +1 @@ +Request/response constructed from samples found on the Internet. \ No newline at end of file diff --git a/interop-mock/src/main/resources/uddi_v1/find_business-request.xml b/interop-mock/src/main/resources/uddi_v1/find_business-request.xml new file mode 100644 index 0000000000..c39264d9cd --- /dev/null +++ b/interop-mock/src/main/resources/uddi_v1/find_business-request.xml @@ -0,0 +1,8 @@ + + + + + Microsoft + + + diff --git a/interop-mock/src/main/resources/uddi_v1/find_business-response.xml b/interop-mock/src/main/resources/uddi_v1/find_business-response.xml new file mode 100644 index 0000000000..79df894e7a --- /dev/null +++ b/interop-mock/src/main/resources/uddi_v1/find_business-response.xml @@ -0,0 +1,21 @@ + + + + + + + Microsoft Corporation + Empowering people through great software - any time, any place and on any device. + + + Electronic Business Integration Services + + + UDDI Web Services + + + + + + + diff --git a/test/wsdl/terra/TerraService.WSDL b/interop-mock/src/main/resources/wsdl/TerraService.wsdl similarity index 100% rename from test/wsdl/terra/TerraService.WSDL rename to interop-mock/src/main/resources/wsdl/TerraService.wsdl diff --git a/interop-mock/src/main/resources/xmethods/README.txt b/interop-mock/src/main/resources/xmethods/README.txt new file mode 100644 index 0000000000..5d09e1f45d --- /dev/null +++ b/interop-mock/src/main/resources/xmethods/README.txt @@ -0,0 +1,3 @@ +* delayed-quotes-request.xml is basically the request produced by the JAXM sample. +* delayed-quotes-response.xml is a response constructed from samples found on the Web + (the original SOAP endpoint is no longer availalbe). \ No newline at end of file diff --git a/interop-mock/src/main/resources/xmethods/delayed-quotes-request.xml b/interop-mock/src/main/resources/xmethods/delayed-quotes-request.xml new file mode 100644 index 0000000000..1291e49ac0 --- /dev/null +++ b/interop-mock/src/main/resources/xmethods/delayed-quotes-request.xml @@ -0,0 +1,10 @@ + + + + + SUNW + + + diff --git a/interop-mock/src/main/resources/xmethods/delayed-quotes-response.xml b/interop-mock/src/main/resources/xmethods/delayed-quotes-response.xml new file mode 100644 index 0000000000..8674fc85eb --- /dev/null +++ b/interop-mock/src/main/resources/xmethods/delayed-quotes-response.xml @@ -0,0 +1,10 @@ + + + + + 3.67 + + + diff --git a/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml b/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml index 31f51f40fd..56a38bc075 100644 --- a/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml +++ b/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml @@ -279,4 +279,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interop/src/test/resources/client-config.wsdd b/interop/src/test/resources/client-config.wsdd deleted file mode 100644 index acf9d9c555..0000000000 --- a/interop/src/test/resources/client-config.wsdd +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/jetty-daemon/pom.xml b/jetty-daemon/pom.xml new file mode 100644 index 0000000000..fad038febe --- /dev/null +++ b/jetty-daemon/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + jetty-daemon + Jetty Daemon + + Daemon implementation used by axis-server-maven-plugin to launch a Jetty server in a separate JVM. + + + + commons-daemon + commons-daemon + + + commons-cli + commons-cli + + + org.mortbay.jetty + jetty + + + + + + maven-site-plugin + + true + true + + + + + diff --git a/jetty-daemon/src/main/java/org/apache/axis/tools/daemon/jetty/WebAppDaemon.java b/jetty-daemon/src/main/java/org/apache/axis/tools/daemon/jetty/WebAppDaemon.java new file mode 100644 index 0000000000..f65a7fea58 --- /dev/null +++ b/jetty-daemon/src/main/java/org/apache/axis/tools/daemon/jetty/WebAppDaemon.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.daemon.jetty; + +import java.io.File; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.daemon.Daemon; +import org.apache.commons.daemon.DaemonContext; +import org.apache.commons.daemon.DaemonInitException; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.webapp.WebAppContext; +import org.mortbay.resource.Resource; +import org.mortbay.resource.ResourceCollection; + +/** + * + * + * @author Andreas Veithen + */ +public class WebAppDaemon implements Daemon { + private Server server; + + public void init(DaemonContext daemonContext) throws DaemonInitException, Exception { + Options options = new Options(); + + { + Option option = new Option("p", true, "the HTTP port"); + option.setArgName("port"); + option.setRequired(true); + options.addOption(option); + } + + { + Option option = new Option("r", true, "a list of resource directories"); + option.setArgName("dirs"); + option.setRequired(true); + options.addOption(option); + } + + CommandLineParser parser = new GnuParser(); + CommandLine cmdLine = parser.parse(options, daemonContext.getArguments()); + + server = new Server(Integer.parseInt(cmdLine.getOptionValue("p"))); + WebAppContext context = new WebAppContext(server, null, "/"); + String[] resourceDirs = cmdLine.getOptionValue("r").split(File.pathSeparator); + Resource[] resources = new Resource[resourceDirs.length]; + for (int i=0; i + + + 4.0.0 + + org.apache.axis + maven + 1.4.1-SNAPSHOT + ../pom.xml + + axis-server-maven-plugin + maven-plugin + axis-server-maven-plugin + + Axis server Maven plugin. + + ${baseUrl}/maven/axis-server + + + axis + ${baseSiteUrl}/maven/axis-server + + + + + ${project.groupId} + axis-model + ${project.version} + + + org.apache.maven + maven-plugin-api + + + org.apache.maven + maven-project + + + com.github.veithen.ulog + ulog + + + org.apache.maven + maven-toolchain + 1.0 + + + + + ${project.groupId} + daemon-launcher + ${project.version} + test + + + ${project.groupId} + axis-standalone-server + ${project.version} + test + + + diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractServerMojo.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractDaemonControlMojo.java similarity index 90% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractServerMojo.java rename to maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractDaemonControlMojo.java index a67ad7dfa8..4cb0751725 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractServerMojo.java +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractDaemonControlMojo.java @@ -24,7 +24,7 @@ import com.github.veithen.ulog.PlexusLoggerInjector; -public abstract class AbstractServerMojo extends AbstractMojo { +public abstract class AbstractDaemonControlMojo extends AbstractMojo { /** * @component */ @@ -35,7 +35,7 @@ public abstract class AbstractServerMojo extends AbstractMojo { /** * @component */ - private ProcessManager processManager; + private DaemonManager daemonManager; /** * Set this to true to skip running tests, but still compile them. This is the same @@ -45,8 +45,8 @@ public abstract class AbstractServerMojo extends AbstractMojo { */ private boolean skipTests; - public ProcessManager getProcessManager() { - return processManager; + public final DaemonManager getDaemonManager() { + return daemonManager; } public final void execute() throws MojoExecutionException, MojoFailureException { diff --git a/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartDaemonMojo.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartDaemonMojo.java new file mode 100644 index 0000000000..9e821ba00a --- /dev/null +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartDaemonMojo.java @@ -0,0 +1,329 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.maven.server; + +import java.io.File; +import java.io.IOException; +import java.net.ServerSocket; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.resolver.ArtifactCollector; +import org.apache.maven.artifact.resolver.ArtifactNotFoundException; +import org.apache.maven.artifact.resolver.ArtifactResolutionException; +import org.apache.maven.artifact.resolver.ArtifactResolver; +import org.apache.maven.artifact.resolver.DebugResolutionListener; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectBuilder; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.artifact.InvalidDependencyVersionException; +import org.apache.maven.toolchain.Toolchain; +import org.apache.maven.toolchain.ToolchainManager; +import org.codehaus.plexus.logging.LogEnabled; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.util.StringUtils; + +public abstract class AbstractStartDaemonMojo extends AbstractDaemonControlMojo implements LogEnabled { + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * The current build session instance. This is used for toolchain manager API calls. + * + * @parameter default-value="${session}" + * @required + * @readonly + */ + private MavenSession session; + + /** + * @component + */ + private MavenProjectBuilder projectBuilder; + + /** + * Local maven repository. + * + * @parameter expression="${localRepository}" + * @required + * @readonly + */ + private ArtifactRepository localRepository; + + /** + * Remote repositories. + * + * @parameter expression="${project.remoteArtifactRepositories}" + * @required + * @readonly + */ + private List remoteArtifactRepositories; + + /** + * @component + */ + private ArtifactFactory artifactFactory; + + /** + * @component + */ + private ArtifactResolver artifactResolver; + + /** + * @component + */ + private ArtifactCollector artifactCollector; + + /** + * @component + */ + private ArtifactMetadataSource artifactMetadataSource; + + /** + * @component + */ + private ToolchainManager toolchainManager; + + /** + * The arguments to pass to the JVM when debug mode is enabled. + * + * @parameter default-value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8899,server=y,suspend=y" + */ + private String debugArgs; + + /** + * Indicates whether the Java process should be started in debug mode. This flag should only be + * set from the command line. + * + * @parameter expression="${axis.server.debug}" default-value="false" + */ + private boolean debug; + + /** + * The arguments to pass to the JVM when JMX is enabled. + * + * @parameter default-value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" + */ + private String jmxArgs; + + /** + * Indicates whether the Java process should be started with remote JMX enabled. This flag + * should only be set from the command line. + * + * @parameter expression="${axis.server.jmx}" default-value="false" + */ + private boolean jmx; + + /** + * Arbitrary JVM options to set on the command line. Note that this parameter uses the same + * expression as the Surefire and Failsafe plugins. By setting the argLine + * property, it is therefore possible to easily pass a common set of JVM options to all + * processes involved in the tests. Since the JaCoCo Maven plugin also sets this property, code + * coverage generated on the server-side will be automatically included in the analysis. + * + * @parameter expression="${argLine}" + */ + private String argLine; + + /** + * @parameter default-value="${plugin.version}" + * @required + * @readonly + */ + private String axisVersion; + + private final Set/**/ additionalDependencies = new HashSet(); + private List/**/ classpath; + + private Logger logger; + + public final void enableLogging(Logger logger) { + this.logger = logger; + } + + protected final void addDependency(String groupId, String artifactId, String version) { + additionalDependencies.add(artifactFactory.createArtifact(groupId, artifactId, version, Artifact.SCOPE_TEST, "jar")); + classpath = null; + } + + protected final void addAxisDependency(String artifactId) { + addDependency("org.apache.axis", artifactId, axisVersion); + } + + protected final List/**/ getClasspath() throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException, ArtifactNotFoundException { + if (classpath == null) { + final Log log = getLog(); + + // We need dependencies in scope test. Since this is the largest scope, we don't need + // to do any additional filtering based on dependency scope. + Set projectDependencies = project.getArtifacts(); + + final Set artifacts = new HashSet(projectDependencies); + + if (additionalDependencies != null) { + for (Iterator it = additionalDependencies.iterator(); it.hasNext(); ) { + Artifact a = (Artifact)it.next(); + if (log.isDebugEnabled()) { + log.debug("Resolving artifact to be added to classpath: " + a); + } + ArtifactFilter filter = new ArtifactFilter() { + public boolean include(Artifact artifact) { + String id = artifact.getDependencyConflictId(); + for (Iterator it = artifacts.iterator(); it.hasNext(); ) { + if (id.equals(((Artifact)it.next()).getDependencyConflictId())) { + return false; + } + } + return true; + } + }; + MavenProject p = projectBuilder.buildFromRepository(a, remoteArtifactRepositories, localRepository); + if (filter.include(p.getArtifact())) { + Set s = p.createArtifacts(artifactFactory, Artifact.SCOPE_RUNTIME, filter); + artifacts.addAll(artifactCollector.collect(s, + p.getArtifact(), p.getManagedVersionMap(), + localRepository, remoteArtifactRepositories, artifactMetadataSource, filter, + Collections.singletonList(new DebugResolutionListener(logger))).getArtifacts()); + artifacts.add(p.getArtifact()); + } + } + } + + classpath = new ArrayList(); + classpath.add(new File(project.getBuild().getTestOutputDirectory())); + classpath.add(new File(project.getBuild().getOutputDirectory())); + for (Iterator it = artifacts.iterator(); it.hasNext(); ) { + Artifact a = (Artifact)it.next(); + if (a.getArtifactHandler().isAddedToClasspath()) { + if (a.getFile() == null) { + artifactResolver.resolve(a, remoteArtifactRepositories, localRepository); + } + classpath.add(a.getFile()); + } + } + } + + return classpath; + } + + private int allocatePort() throws MojoFailureException { + try { + ServerSocket ss = new ServerSocket(0); + int port = ss.getLocalPort(); + ss.close(); + return port; + } catch (IOException ex) { + throw new MojoFailureException("Failed to allocate port number", ex); + } + } + + protected final void startDaemon(String description, String daemonClass, String[] args, File workDir) throws MojoExecutionException, MojoFailureException { + Log log = getLog(); + + // Locate java executable to use + String jvm; + Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", session); + if (tc != null) { + jvm = tc.findTool("java"); + } else { + jvm = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; + } + if (log.isDebugEnabled()) { + log.debug("Java executable: " + jvm); + } + + int controlPort = allocatePort(); + + // Get class path + List classpath; + try { + classpath = getClasspath(); + } catch (Exception ex) { + throw new MojoExecutionException("Failed to build classpath", ex); + } + if (log.isDebugEnabled()) { + log.debug("Class path elements: " + classpath); + } + + // Compute JVM arguments + List vmArgs = new ArrayList(); + if (debug) { + processVMArgs(vmArgs, debugArgs); + } + if (jmx) { + processVMArgs(vmArgs, jmxArgs); + } + if (argLine != null) { + processVMArgs(vmArgs, argLine); + } + if (log.isDebugEnabled()) { + log.debug("Additional VM args: " + vmArgs); + } + + List cmdline = new ArrayList(); + cmdline.add(jvm); + cmdline.add("-cp"); + cmdline.add(StringUtils.join(classpath.iterator(), File.pathSeparator)); + cmdline.addAll(vmArgs); + cmdline.add("org.apache.axis.tools.daemon.Launcher"); + cmdline.add(daemonClass); + cmdline.add(String.valueOf(controlPort)); + cmdline.addAll(Arrays.asList(args)); + try { + getDaemonManager().startDaemon( + description, + (String[])cmdline.toArray(new String[cmdline.size()]), + workDir, + controlPort); + } catch (Exception ex) { + throw new MojoFailureException("Failed to start server", ex); + } + } + + private static void processVMArgs(List vmArgs, String args) { + vmArgs.addAll(Arrays.asList(args.split(" "))); + } + + protected final void doExecute() throws MojoExecutionException, MojoFailureException { + addAxisDependency("daemon-launcher"); + doStartDaemon(); + } + + protected abstract void doStartDaemon() throws MojoExecutionException, MojoFailureException; +} diff --git a/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartWebServerMojo.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartWebServerMojo.java new file mode 100644 index 0000000000..8fa91528d9 --- /dev/null +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartWebServerMojo.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.maven.server; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; + +public abstract class AbstractStartWebServerMojo extends AbstractStartDaemonMojo { + /** + * The HTTP port. + * + * @parameter default-value="8080" + * @required + */ + private int port; + + /** + * If this flag is set to true, then the execution of the goal will block after the + * server has been started. This is useful if one wants to manually test some services deployed + * on the server or if one wants to run the integration tests from an IDE. The flag should only + * be set using the command line, but not in the POM. + * + * @parameter expression="${axis.server.foreground}" default-value="false" + */ + // Note: this feature is implemented using a flag (instead of a distinct goal) to make sure that + // the server is configured in exactly the same way as in a normal integration test execution. + private boolean foreground; + + /** + * Specifies an alternate port number that will override {@link #port} if {@link #foreground} is + * set to true. This parameter should be used if the port number configured with + * the {@link #port} parameter is allocated dynamically. This makes it easier to run integration + * tests from an IDE. For more information, see the usage + * documentation. + * + * @parameter + */ + private int foregroundPort = -1; + + protected final void doStartDaemon() throws MojoExecutionException, MojoFailureException { + Log log = getLog(); + + doStartDaemon(foreground && foregroundPort != -1 ? foregroundPort : port); + + if (foreground) { + log.info("Server started in foreground mode. Press CRTL-C to stop."); + Object lock = new Object(); + synchronized (lock) { + try { + lock.wait(); + } catch (InterruptedException ex) { + // Set interrupt flag and continue + Thread.currentThread().interrupt(); + } + } + } + } + + protected abstract void doStartDaemon(int port) throws MojoExecutionException, MojoFailureException; +} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonManager.java similarity index 82% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java rename to maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonManager.java index cfa7db04e0..caa6dd2733 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonManager.java @@ -20,7 +20,7 @@ import java.io.File; -public interface ProcessManager { - void startProcess(String description, String[] cmdline, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws Exception; +public interface DaemonManager { + void startDaemon(String description, String[] cmdline, File workDir, int controlPort) throws Exception; void stopAll() throws Exception; } diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultDaemonManager.java similarity index 68% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java rename to maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultDaemonManager.java index 14046b0ab9..57c8a15156 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultDaemonManager.java @@ -27,8 +27,8 @@ import org.codehaus.plexus.logging.LogEnabled; import org.codehaus.plexus.logging.Logger; -public class DefaultProcessManager implements ProcessManager, LogEnabled { - private final List managedProcesses = new ArrayList(); +public class DefaultDaemonManager implements DaemonManager, LogEnabled { + private final List daemons = new ArrayList(); private Logger logger; @@ -36,44 +36,48 @@ public void enableLogging(Logger logger) { this.logger = logger; } - public void startProcess(String description, String[] cmdline, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws Exception { + public void startDaemon(String description, String[] cmdline, File workDir, int controlPort) throws Exception { if (logger.isDebugEnabled()) { logger.debug("Starting process with command line: " + Arrays.asList(cmdline)); } Process process = Runtime.getRuntime().exec(cmdline, null, workDir); - managedProcesses.add(new ManagedProcess(process, description, stopAction)); + RemoteDaemon daemon = new RemoteDaemon(process, description, controlPort); + daemons.add(daemon); new Thread(new StreamPump(process.getInputStream(), System.out)).start(); new Thread(new StreamPump(process.getErrorStream(), System.err)).start(); - startAction.execute(logger, process); + daemon.startDaemon(logger); } public void stopAll() throws Exception { Exception savedException = null; - for (Iterator it = managedProcesses.iterator(); it.hasNext(); ) { - ManagedProcess managedProcess = (ManagedProcess)it.next(); - int result; - logger.debug("Executing stop action"); + for (Iterator it = daemons.iterator(); it.hasNext(); ) { + RemoteDaemon daemon = (RemoteDaemon)it.next(); + if (logger.isDebugEnabled()) { + logger.debug("Stopping " + daemon.getDescription()); + } + boolean success; try { - result = managedProcess.getStopAction().execute(logger); + daemon.stopDaemon(logger); + success = true; } catch (Exception ex) { if (savedException == null) { savedException = ex; } - result = -1; + success = false; } if (logger.isDebugEnabled()) { - logger.debug("result = " + result); + logger.debug("success = " + success); } - if (result == ProcessStopAction.STOPPING) { - managedProcess.getProcess().waitFor(); + if (success) { + daemon.getProcess().waitFor(); } else { - managedProcess.getProcess().destroy(); + daemon.getProcess().destroy(); } - logger.info(managedProcess.getDescription() + " stopped"); + logger.info(daemon.getDescription() + " stopped"); } // TODO: need to clear the collection because the same ServerManager instance may be used by multiple projects in a reactor build; // note that this means that the plugin is not thread safe (i.e. doesn't support parallel builds in Maven 3) - managedProcesses.clear(); + daemons.clear(); if (savedException != null) { throw savedException; } diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/FileSet.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/FileSet.java similarity index 100% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/FileSet.java rename to maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/FileSet.java diff --git a/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/RemoteDaemon.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/RemoteDaemon.java new file mode 100644 index 0000000000..1c8af6fc5a --- /dev/null +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/RemoteDaemon.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.maven.server; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.net.InetAddress; +import java.net.Socket; + +import org.codehaus.plexus.logging.Logger; + +public class RemoteDaemon { + private final Process process; + private final String description; + private final int controlPort; + private BufferedReader controlIn; + private Writer controlOut; + + public RemoteDaemon(Process process, String description, int controlPort) { + this.process = process; + this.description = description; + this.controlPort = controlPort; + } + + public Process getProcess() { + return process; + } + + public String getDescription() { + return description; + } + + public void startDaemon(Logger logger) throws Exception { + logger.debug("Attempting to establish control connection on port " + controlPort); + Socket controlSocket; + while (true) { + try { + controlSocket = new Socket(InetAddress.getByName("localhost"), controlPort); + break; + } catch (IOException ex) { + try { + int exitValue = process.exitValue(); + throw new IllegalStateException("Process terminated prematurely with exit code " + exitValue); + } catch (IllegalThreadStateException ex2) { + // Process is still running; continue + } + Thread.sleep(100); + } + } + logger.debug("Control connection established"); + controlIn = new BufferedReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII")); + controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII"); + logger.debug("Waiting for daemon to become ready"); + expectStatus("READY"); + logger.debug("Daemon is ready"); + } + + public void stopDaemon(Logger logger) throws Exception { + controlOut.write("STOP\r\n"); + controlOut.flush(); + expectStatus("STOPPED"); + } + + private void expectStatus(String expectedStatus) throws IOException { + String status = controlIn.readLine(); + if (status == null) { + throw new IllegalStateException("Control connection unexpectedly closed"); + } else if (!status.equals(expectedStatus)) { + throw new IllegalStateException("Unexpected status: " + status); + } + } +} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java similarity index 78% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java rename to maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java index 3777a9e0f3..40e612b311 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java @@ -24,20 +24,20 @@ import org.apache.maven.plugin.MojoFailureException; /** - * Start an arbitrary Java process. + * Start a daemon. * - * @goal start-process + * @goal start-daemon * @phase pre-integration-test * @requiresDependencyResolution test */ -public class StartProcessMojo extends AbstractStartProcessMojo { +public class StartDaemonMojo extends AbstractStartDaemonMojo { /** - * The main class. + * The daemon class. * * @parameter * @required */ - private String mainClass; + private String daemonClass; /** * The arguments to be passed to the main class. @@ -54,8 +54,8 @@ public class StartProcessMojo extends AbstractStartProcessMojo { */ private File workDir; - protected void doExecute() throws MojoExecutionException, MojoFailureException { + protected void doStartDaemon() throws MojoExecutionException, MojoFailureException { workDir.mkdirs(); - startJavaProcess(mainClass, mainClass, args != null ? args : new String[0], workDir, ProcessStartAction.NOP, ProcessStopAction.NOP); + startDaemon(daemonClass, daemonClass, args, workDir); } } diff --git a/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java new file mode 100644 index 0000000000..35f8f1ab91 --- /dev/null +++ b/maven/axis-server-maven-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.maven.server; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.List; + +import org.apache.axis.model.wsdd.Deployment; +import org.apache.axis.model.wsdd.WSDDUtil; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.codehaus.plexus.util.DirectoryScanner; +import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.StringUtils; +import org.xml.sax.InputSource; + +/** + * Start a org.apache.axis.server.standalone.StandaloneAxisServer instance in a separate + * JVM. + * + * @goal start-server + * @phase pre-integration-test + * @requiresDependencyResolution test + */ +public class StartServerMojo extends AbstractStartWebServerMojo { + /** + * @parameter default-value="${project.build.directory}/axis-server" + * @required + * @readonly + */ + private File workDirBase; + + /** + * The maximum number of concurrently active sessions. + * + * @parameter default-value="100" + */ + private int maxSessions; + + /** + * A set of WSDD files for services to deploy. + * + * @parameter + */ + private FileSet[] wsdds; + + /** + * A set of directories to look up JWS files from. + * + * @parameter + */ + private File[] jwsDirs; + + /** + * A set of config files to copy to the WEB-INF dir. An example of a config file + * would be users.lst used by SimpleSecurityProvider. + * + * @parameter + */ + private FileSet[] configs; + + protected void doStartDaemon(int port) throws MojoExecutionException, MojoFailureException { + // Need to setup additional dependencies before building the default configuration! + addAxisDependency("axis-standalone-server"); + if (jwsDirs != null && jwsDirs.length > 0) { + addAxisDependency("axis-rt-jws"); + } + + // Prepare a work directory where we can place the server-config.wsdd file + File workDir = new File(workDirBase, String.valueOf(port)); + if (workDir.exists()) { + try { + FileUtils.deleteDirectory(workDir); + } catch (IOException ex) { + throw new MojoFailureException("Failed to clean the work directory", ex); + } + } + File webInfDir = new File(workDir, "WEB-INF"); + webInfDir.mkdirs(); + + // Start with the default configuration (which depends on the JARs in the classpath) + Deployment deployment; + try { + deployment = WSDDUtil.buildDefaultConfiguration(buildClassLoader(), "server"); + } catch (IOException ex) { + throw new MojoExecutionException("Failed to build default server configuration", ex); + } + + // Select WSDD files + if (wsdds != null) { + for (int i=0; i 0) { + for (int i=0; i 0) { + args.add("-j"); + args.add(StringUtils.join(jwsDirs, File.pathSeparator)); + } + args.add("-m"); + args.add(String.valueOf(maxSessions)); + try { + startDaemon( + "Server on port " + port, + "org.apache.axis.server.standalone.daemon.AxisServerDaemon", + (String[])args.toArray(new String[args.size()]), + workDir); + } catch (Exception ex) { + throw new MojoFailureException("Failed to start server", ex); + } + } + + private ClassLoader buildClassLoader() throws MojoExecutionException { + List classpath; + try { + classpath = getClasspath(); + } catch (Exception ex) { + throw new MojoExecutionException("Failed to build classpath", ex); + } + URL[] urls = new URL[classpath.size()]; + for (int i=0; i - org.apache.axis.tools.maven.server.ProcessManager - org.apache.axis.tools.maven.server.DefaultProcessManager + org.apache.axis.tools.maven.server.DaemonManager + org.apache.axis.tools.maven.server.DefaultDaemonManager \ No newline at end of file diff --git a/maven/maven-axis-server-plugin/src/site/apt/index.apt b/maven/axis-server-maven-plugin/src/site/apt/index.apt similarity index 93% rename from maven/maven-axis-server-plugin/src/site/apt/index.apt rename to maven/axis-server-maven-plugin/src/site/apt/index.apt index 6581c4588f..f6da54b445 100644 --- a/maven/maven-axis-server-plugin/src/site/apt/index.apt +++ b/maven/axis-server-maven-plugin/src/site/apt/index.apt @@ -19,9 +19,9 @@ Introduction ------------ -maven-axis-server-plugin +axis-server-maven-plugin - The purpose of the maven-axis-server-plugin is to automatically start and stop a stand-alone Axis server (and other processes) + The purpose of the axis-server-maven-plugin is to automatically start and stop a stand-alone Axis server (and other processes) during integration test phases of a Maven project. This enables end-to-end automation of integration tests. * Goals Overview @@ -35,4 +35,4 @@ maven-axis-server-plugin phase. This can e.g. be used to start a mock Web service. * {{{./stop-all-mojo.html}axis-server:stop-all}} stops all processes started by <<>> and - <<>>. It is executed during the <<>> phase. \ No newline at end of file + <<>>. It is executed during the <<>> phase. diff --git a/maven/maven-axis-server-plugin/src/site/apt/usage.apt.vm b/maven/axis-server-maven-plugin/src/site/apt/usage.apt.vm similarity index 97% rename from maven/maven-axis-server-plugin/src/site/apt/usage.apt.vm rename to maven/axis-server-maven-plugin/src/site/apt/usage.apt.vm index ebbc0fac1e..0059dad46b 100644 --- a/maven/maven-axis-server-plugin/src/site/apt/usage.apt.vm +++ b/maven/axis-server-maven-plugin/src/site/apt/usage.apt.vm @@ -87,7 +87,7 @@ Usage -------------------------------------------------------------------------------- ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -117,9 +117,9 @@ Usage Note the reference to the <<>> property set by the build-helper-maven-plugin. Also note the <<>> option that specifies the location of the WSDD files for the Web services to deploy. These files are typically generated using the - {{{../wsdl2java/index.html}maven-wsdl2java-plugin}}. + {{{../wsdl2java/index.html}wsdl2java-maven-plugin}}. - The maven-axis-server-plugin assumes that <<>> class + The axis-server-maven-plugin assumes that <<>> class (not to be confused with the old <<>> class) is in the class path. Therefore, you need to add the relevant dependency to your project: @@ -197,7 +197,7 @@ mvn clean integration-test -Daxis.server.foreground=true -DaxisServerPort=8080 -------------------------------------------------------------------------------- ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -235,4 +235,4 @@ System.getProperty("axisServerPort", "8080") If you set up your project like that, then no additional configuration is required in your IDE and you only need to pass the <<>> property - to Maven. \ No newline at end of file + to Maven. diff --git a/maven/maven-axis-server-plugin/src/site/site.xml b/maven/axis-server-maven-plugin/src/site/site.xml similarity index 96% rename from maven/maven-axis-server-plugin/src/site/site.xml rename to maven/axis-server-maven-plugin/src/site/site.xml index 73c49a403b..d4b6a8e251 100644 --- a/maven/maven-axis-server-plugin/src/site/site.xml +++ b/maven/axis-server-maven-plugin/src/site/site.xml @@ -17,7 +17,7 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + diff --git a/maven/maven-java2wsdl-plugin/pom.xml b/maven/java2wsdl-maven-plugin/pom.xml similarity index 90% rename from maven/maven-java2wsdl-plugin/pom.xml rename to maven/java2wsdl-maven-plugin/pom.xml index 26057ba355..cf5859dd25 100644 --- a/maven/maven-java2wsdl-plugin/pom.xml +++ b/maven/java2wsdl-maven-plugin/pom.xml @@ -25,9 +25,9 @@ 1.4.1-SNAPSHOT ../pom.xml - maven-java2wsdl-plugin + java2wsdl-maven-plugin maven-plugin - Axis :: Maven :: maven-java2wsdl-plugin + java2wsdl-maven-plugin Axis java2wsdl Maven plugin. @@ -76,12 +76,4 @@ 1.8.1 - - - - maven-plugin-plugin - 2.9 - - - diff --git a/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java b/maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java similarity index 95% rename from maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java rename to maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java index 015231b163..092e5cbbe1 100644 --- a/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java +++ b/maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/AbstractGenerateWsdlMojo.java @@ -110,6 +110,14 @@ public abstract class AbstractGenerateWsdlMojo extends AbstractMojo { */ private String location; + /** + * Indicates the name to use use for the portType element. If not specified, the + * class-of-portType name is used. + * + * @parameter + */ + private String portTypeName; + /** * The name of the output WSDL file. * @@ -166,6 +174,9 @@ public final void execute() throws MojoExecutionException, MojoFailureException } emitter.setIntfNamespace(namespace); emitter.setLocationUrl(location); + if (portTypeName != null) { + emitter.setPortTypeName(portTypeName); + } output.getParentFile().mkdirs(); try { emitter.emit(output.getAbsolutePath(), Emitter.MODE_ALL); diff --git a/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/DeployMojo.java b/maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/DeployMojo.java similarity index 100% rename from maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/DeployMojo.java rename to maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/DeployMojo.java diff --git a/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java b/maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java similarity index 96% rename from maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java rename to maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java index 4cd0775b2d..40404f23d7 100644 --- a/maven/maven-java2wsdl-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java +++ b/maven/java2wsdl-maven-plugin/src/main/java/org/apache/axis/tools/maven/java2wsdl/GenerateWsdlMojo.java @@ -25,7 +25,7 @@ import org.apache.maven.plugin.MojoFailureException; /** - * + * Generates a WSDL description from a Java class. * * @goal generate-wsdl * @requiresDependencyResolution compile diff --git a/maven/maven-java2wsdl-plugin/src/site/site.xml b/maven/java2wsdl-maven-plugin/src/site/site.xml similarity index 96% rename from maven/maven-java2wsdl-plugin/src/site/site.xml rename to maven/java2wsdl-maven-plugin/src/site/site.xml index 67069f8889..06b1870eae 100644 --- a/maven/maven-java2wsdl-plugin/src/site/site.xml +++ b/maven/java2wsdl-maven-plugin/src/site/site.xml @@ -17,7 +17,7 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java deleted file mode 100644 index ab1ff35f1d..0000000000 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.axis.tools.maven.server; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.apache.maven.artifact.DependencyResolutionRequiredException; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.project.MavenProject; -import org.apache.maven.toolchain.Toolchain; -import org.apache.maven.toolchain.ToolchainManager; -import org.codehaus.plexus.util.StringUtils; - -public abstract class AbstractStartProcessMojo extends AbstractServerMojo { - /** - * The maven project. - * - * @parameter expression="${project}" - * @required - * @readonly - */ - private MavenProject project; - - /** - * The current build session instance. This is used for toolchain manager API calls. - * - * @parameter default-value="${session}" - * @required - * @readonly - */ - private MavenSession session; - - /** - * @component - */ - private ToolchainManager toolchainManager; - - /** - * The arguments to pass to the JVM when debug mode is enabled. - * - * @parameter default-value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8899,server=y,suspend=y" - */ - private String debugArgs; - - /** - * Indicates whether the Java process should be started in debug mode. This flag should only be - * set from the command line. - * - * @parameter expression="${axis.server.debug}" default-value="false" - */ - private boolean debug; - - /** - * The arguments to pass to the JVM when JMX is enabled. - * - * @parameter default-value="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" - */ - private String jmxArgs; - - /** - * Indicates whether the Java process should be started with remote JMX enabled. This flag - * should only be set from the command line. - * - * @parameter expression="${axis.server.jmx}" default-value="false" - */ - private boolean jmx; - - protected boolean isDebug() { - return debug; - } - - protected void startJavaProcess(String description, String mainClass, String[] args, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws MojoExecutionException, MojoFailureException { - Log log = getLog(); - - // Locate java executable to use - String jvm; - Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", session); - if (tc != null) { - jvm = tc.findTool("java"); - } else { - jvm = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; - } - if (log.isDebugEnabled()) { - log.debug("Java executable: " + jvm); - } - - // Get class path - List classpath; - try { - classpath = project.getTestClasspathElements(); - } catch (DependencyResolutionRequiredException ex) { - throw new MojoExecutionException("Unexpected exception", ex); - } - if (log.isDebugEnabled()) { - log.debug("Class path elements: " + classpath); - } - - // Compute JVM arguments - List vmArgs = new ArrayList(); - if (debug) { - processVMArgs(vmArgs, debugArgs); - } - if (jmx) { - processVMArgs(vmArgs, jmxArgs); - } - if (log.isDebugEnabled()) { - log.debug("Additional VM args: " + vmArgs); - } - - List cmdline = new ArrayList(); - cmdline.add(jvm); - cmdline.add("-cp"); - cmdline.add(StringUtils.join(classpath.iterator(), File.pathSeparator)); - cmdline.addAll(vmArgs); - cmdline.add(mainClass); - cmdline.addAll(Arrays.asList(args)); - try { - getProcessManager().startProcess( - description, - (String[])cmdline.toArray(new String[cmdline.size()]), - workDir, - startAction, - stopAction); - } catch (Exception ex) { - throw new MojoFailureException("Failed to start server", ex); - } - } - - private static void processVMArgs(List vmArgs, String args) { - vmArgs.addAll(Arrays.asList(args.split(" "))); - } -} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java deleted file mode 100644 index a937f8158d..0000000000 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.axis.tools.maven.server; - -import java.io.File; -import java.net.URL; -import java.rmi.RemoteException; - -import javax.xml.namespace.QName; - -import org.apache.axis.client.AdminClient; -import org.apache.axis.client.Call; -import org.codehaus.plexus.logging.Logger; - -public class AxisServerStartAction implements ProcessStartAction { - private final int port; - private final AdminClient adminClient; - private final File[] deployments; - private final int timeout; - - public AxisServerStartAction(int port, AdminClient adminClient, File[] deployments, int timeout) { - this.port = port; - this.adminClient = adminClient; - this.deployments = deployments; - this.timeout = timeout; - } - - public void execute(Logger logger, Process process) throws Exception { - // Wait for server to become ready - String versionUrl = "http://localhost:" + port + "/axis/services/Version"; - Call call = new Call(new URL(versionUrl)); - call.setOperationName(new QName(versionUrl, "getVersion")); - long start = System.currentTimeMillis(); - while (true) { - try { - String result = (String)call.invoke(new Object[0]); - logger.info("Server ready on port " + port + ": " + result.replace('\n', ' ')); - break; - } catch (RemoteException ex) { - if (System.currentTimeMillis() > start + timeout) { - throw ex; - } - } - try { - int exitValue = process.exitValue(); - // TODO: choose a better exception here - throw new RemoteException("The server process unexpectedly died with exit status " + exitValue); - } catch (IllegalThreadStateException ex) { - // This means that the process is still running; continue - } - Thread.sleep(200); - } - - // Deploy services - AdminClientUtils.process(logger, adminClient, deployments); - } -} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java deleted file mode 100644 index 299c8da751..0000000000 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.axis.tools.maven.server; - -import org.codehaus.plexus.logging.Logger; - -/** - * Action to be executed when a process is stopped. Typically (but not necessarily) this involves - * sending a request to initiate a clean shutdown of the process. - * - * @author Andreas Veithen - */ -public interface ProcessStopAction { - ProcessStopAction NOP = new ProcessStopAction() { - public int execute(Logger logger) throws Exception { - return RUNNING; - } - }; - - /** - * Indicates that the process is expected to be still running after the action is completed. - */ - int RUNNING = 1; - - /** - * Indicates that the action has sent a request to the process to initiate a clean shutdown, - * i.e. that the process is expected to be stopping (but not necessarily to be stopped yet). - */ - int STOPPING = 2; - - int execute(Logger logger) throws Exception; -} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java deleted file mode 100644 index 8df0f3661d..0000000000 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.axis.tools.maven.server; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.axis.client.AdminClient; -import org.apache.axis.deployment.wsdd.WSDDConstants; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugin.logging.Log; -import org.codehaus.plexus.util.DirectoryScanner; -import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.StringUtils; -import org.w3c.dom.Element; - -/** - * Start a {@link org.apache.axis.server.standalone.StandaloneAxisServer} instance in a separate - * JVM. - * - * @goal start-server - * @phase pre-integration-test - * @requiresDependencyResolution test - */ -public class StartServerMojo extends AbstractStartProcessMojo { - /** - * @parameter default-value="${project.build.directory}/axis-server" - * @required - * @readonly - */ - private File workDirBase; - - /** - * The port of the Axis server. - * - * @parameter default-value="8080" - * @required - */ - private int port; - - /** - * A set of WSDD files for services to deploy. The WSDD files may be deployment or undeployment - * requests. Undeployment requests will be processed when the server is stopped. The primary use - * case for this is to test undeployment. - * - * @parameter - */ - private FileSet[] wsdds; - - /** - * A set of directories to look up JWS files from. - * - * @parameter - */ - private File[] jwsDirs; - - /** - * A set of config files to copy to the WEB-INF dir. An example of a config file - * would be users.lst used by SimpleSecurityProvider. - * - * @parameter - */ - private FileSet[] configs; - - /** - * If this flag is set to true, then the execution of the goal will block after the - * server has been started and the services are deployed. This is useful if one wants to - * manually test some services deployed on the server or if one wants to run the integration - * tests from an IDE. The flag should only be set using the command line, but not in the POM. - * - * @parameter expression="${axis.server.foreground}" default-value="false" - */ - // Note: this feature is implemented using a flag (instead of a distinct goal) to make sure that - // the server is configured in exactly the same way as in a normal integration test execution. - private boolean foreground; - - /** - * Specifies an alternate port number that will override {@link #port} if {@link #foreground} is - * set to true. This parameter should be used if the port number configured with - * the {@link #port} parameter is allocated dynamically. This makes it easier to run integration - * tests from an IDE. For more information, see the usage - * documentation. - * - * @parameter - */ - private int foregroundPort = -1; - - protected void doExecute() throws MojoExecutionException, MojoFailureException { - Log log = getLog(); - - // Determine the port to be used - int actualPort = foreground && foregroundPort != -1 ? foregroundPort : port; - - // Select WSDD files - List deployments = new ArrayList(); - List undeployments = new ArrayList(); - if (wsdds != null && wsdds.length > 0) { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - DocumentBuilder documentBuilder; - try { - documentBuilder = dbf.newDocumentBuilder(); - } catch (ParserConfigurationException ex) { - throw new MojoFailureException("Unable to initialize DOM parser", ex); - } - for (int i=0; i 0) { - File webInfDir = new File(workDir, "WEB-INF"); - webInfDir.mkdirs(); - for (int i=0; i 0) { - args.add("-j"); - args.add(StringUtils.join(jwsDirs, File.pathSeparator)); - } - try { - AdminClient adminClient = new AdminClient(true); - adminClient.setTargetEndpointAddress(new URL("http://localhost:" + actualPort + "/axis/services/AdminService")); - startJavaProcess( - "Server on port " + actualPort, - "org.apache.axis.server.standalone.StandaloneAxisServer", - (String[])args.toArray(new String[args.size()]), - workDir, - new AxisServerStartAction(actualPort, adminClient, - (File[])deployments.toArray(new File[deployments.size()]), - isDebug() || foreground ? Integer.MAX_VALUE : 20000), - new AxisServerStopAction(adminClient, - (File[])undeployments.toArray(new File[undeployments.size()]))); - } catch (Exception ex) { - throw new MojoFailureException("Failed to start server", ex); - } - - if (foreground) { - log.info("Server started in foreground mode. Press CRTL-C to stop."); - Object lock = new Object(); - synchronized (lock) { - try { - lock.wait(); - } catch (InterruptedException ex) { - // Set interrupt flag and continue - Thread.currentThread().interrupt(); - } - } - } - } -} diff --git a/maven/maven-wsdl2java-plugin/src/it/settings.xml b/maven/maven-wsdl2java-plugin/src/it/settings.xml deleted file mode 100644 index 8737d31ab2..0000000000 --- a/maven/maven-wsdl2java-plugin/src/it/settings.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - it-repo - - true - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - local.central - @localRepositoryUrl@ - - true - - - true - - - - - - diff --git a/maven/nsmap/pom.xml b/maven/nsmap/pom.xml index e3696be485..e1376f6e7d 100644 --- a/maven/nsmap/pom.xml +++ b/maven/nsmap/pom.xml @@ -28,7 +28,7 @@ nsmap Maven plugin common classes - Contains classes shared by maven-wsdl2java-plugin and maven-java2wsdl-plugin. + Contains classes shared by wsdl2java-maven-plugin and java2wsdl-maven-plugin. diff --git a/maven/pom.xml b/maven/pom.xml index ddf6a5fd3c..f853e5c867 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -26,7 +26,7 @@ ../pom.xml maven - Axis :: Maven + Axis Maven Plugins pom Root POM for the Axis Maven plugins. @@ -62,44 +62,58 @@ com.github.veithen.ulog ulog - 0.1.0-SNAPSHOT + 0.1.0 nsmap - maven-wsdl2java-plugin - maven-java2wsdl-plugin - maven-axis-server-plugin + wsdd-maven-plugin + wsdl2java-maven-plugin + java2wsdl-maven-plugin + axis-server-maven-plugin - + - maven-project-info-reports-plugin - 2.4 - - - - index - - - + maven-javadoc-plugin + + + + goal + X + + + phase + X + + + requiresDependencyResolution + X + + + + + + + maven-site-plugin + + + + + maven-plugin-plugin + 2.9 + + + maven-project-info-reports-plugin + 2.6 + + index + + + + - - - - - - veithen-github-mvn-repo - https://raw.github.com/veithen/mvn-repo/master/snapshots/ - - false - - - true - - - - + diff --git a/maven/src/site/site.xml b/maven/src/site/site.xml index 1b0772ebdb..5f46c90780 100644 --- a/maven/src/site/site.xml +++ b/maven/src/site/site.xml @@ -23,9 +23,10 @@ - - - + + + + diff --git a/maven/src/site/xdoc/index.xml b/maven/src/site/xdoc/index.xml new file mode 100644 index 0000000000..45cb23284f --- /dev/null +++ b/maven/src/site/xdoc/index.xml @@ -0,0 +1,70 @@ + + + + + Introduction + + +
    +

    + Starting with version 1.4.1, Axis provides a set of Maven plugins that can be used + as an alternative to the existing Ant tasks. + The plugins also introduce a couple of features not found in the Ant tasks and that + are essential to properly support the Maven build lifecycle. +

    +

    + The following table provides an overview of these plugins and their relationships + with the existing Ant tasks: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Maven pluginDescriptionCorresponding Ant tasks
    wsdl2java-maven-pluginGenerates Java artifacts from a WSDL fileaxis-wsdl2java
    java2wsdl-maven-pluginGenerates a WSDL description from a Java classaxis-java2wsdl
    wsdd-maven-pluginN/A
    axis-server-maven-pluginStarts/stops a stand-alone Axis server
    +
    + +
    diff --git a/maven/maven-axis-server-plugin/pom.xml b/maven/wsdd-maven-plugin/pom.xml similarity index 74% rename from maven/maven-axis-server-plugin/pom.xml rename to maven/wsdd-maven-plugin/pom.xml index 95b1498340..b43ee0af33 100644 --- a/maven/maven-axis-server-plugin/pom.xml +++ b/maven/wsdd-maven-plugin/pom.xml @@ -25,23 +25,24 @@ 1.4.1-SNAPSHOT ../pom.xml - maven-axis-server-plugin + wsdd-maven-plugin maven-plugin - Axis :: Maven :: maven-axis-server-plugin + wsdd-maven-plugin - Axis server Maven plugin. + Maven plugin to process WSDD files. - ${baseUrl}/maven/axis-server + ${baseUrl}/maven/wsdd axis - ${baseSiteUrl}/maven/axis-server + ${baseSiteUrl}/maven/wsdd ${project.groupId} - axis-rt-core + axis-model + ${project.version} org.apache.maven @@ -55,18 +56,5 @@ com.github.veithen.ulog ulog - - org.apache.maven - maven-toolchain - 1.0 - - - - - maven-plugin-plugin - 2.9 - - -
    diff --git a/maven/wsdd-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java b/maven/wsdd-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java new file mode 100644 index 0000000000..6bdd9ee481 --- /dev/null +++ b/maven/wsdd-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java @@ -0,0 +1,142 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.tools.maven.wsdd; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Enumeration; +import java.util.List; + +import org.apache.axis.model.wsdd.Deployment; +import org.apache.axis.model.wsdd.WSDDUtil; +import org.apache.maven.artifact.DependencyResolutionRequiredException; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.project.MavenProject; +import org.xml.sax.InputSource; + +import com.github.veithen.ulog.PlexusLoggerInjector; + +/** + * + * + * @goal generate-wsdd + * @requiresDependencyResolution compile + */ +public class GenerateWSDDMojo extends AbstractMojo { + /** + * @component + */ + // This is necessary to set up logging such that all messages logged by the Axis + // libraries through commons logging are redirected to Plexus logs. + PlexusLoggerInjector loggerInjector; + + /** + * The maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + private MavenProject project; + + /** + * + * + * @parameter + * @required + */ + private String type; + + /** + * A set of WSDD files (typically generated by wsdl2java-maven-plugin) to be merged into the + * output WSDD. If this parameter is not set, then the plug-in will just generate a default + * configuration file. + * + * @parameter + */ + private File[] files; + + /** + * + * @parameter + * @required + */ + private File output; + + public void execute() throws MojoExecutionException, MojoFailureException { + // TODO: copy & paste from AbstractGenerateWsdlMojo + List classpath; + try { + classpath = project.getCompileClasspathElements(); + } catch (DependencyResolutionRequiredException ex) { + throw new MojoExecutionException("Unexpected exception", ex); + } + URL[] urls = new URL[classpath.size()]; + for (int i=0; i>> or <<>> folder in the + (exploded) Axis WAR. + + [[3]] Create a WSDD file (or use the WSDD file generated by wsdl2java) and deploy it using + the admin client. This will add the definitions contained in the submitted WSDD file + to the <<>> file. + + This procedure is described in more details in the {{{../../install.html}Installation Guide}}. + + However, nowadays the preferred approach - especially for enterprise projects - is to have a build + process that packages the Web service(s) together with the Axis libraries into a WAR that is then + deployed to the application server. This requires that the <<>> file is + constructed before the WAR is built. With Axis 1.4, developers would typically maintain that file + by hand, either by editing it directly (and copying the contents of WSDD files created by wsdl2java) + or by using e.g. the Axis 1.4 tooling in Eclipse. The file is then added to the project files under source control + so that it is available during the build. + + This approach is suboptimal because in most cases the <<>> file contains + content generated by wsdl2java. That content should not be under source control. Instead, + the <<>> file should be assembled automatically during the build process, + based on the output of wsdl2java. + + This is exactly what the wsdd-maven-plugin does: it takes a set of WSDD files and merges them + into a single output WSDD. The input WSDD files are typically generated by + {{{../wsdl2java/index.html}wsdl2java-maven-plugin}}, but the set may also contain + manually created WSDD files, e.g. to configure custom handlers or to override configuration properties. diff --git a/maven/wsdd-maven-plugin/src/site/site.xml b/maven/wsdd-maven-plugin/src/site/site.xml new file mode 100644 index 0000000000..06b1870eae --- /dev/null +++ b/maven/wsdd-maven-plugin/src/site/site.xml @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/maven/maven-wsdl2java-plugin/pom.xml b/maven/wsdl2java-maven-plugin/pom.xml similarity index 83% rename from maven/maven-wsdl2java-plugin/pom.xml rename to maven/wsdl2java-maven-plugin/pom.xml index 6e984b02dc..1e463f3be2 100644 --- a/maven/maven-wsdl2java-plugin/pom.xml +++ b/maven/wsdl2java-maven-plugin/pom.xml @@ -25,9 +25,9 @@ 1.4.1-SNAPSHOT ../pom.xml - maven-wsdl2java-plugin + wsdl2java-maven-plugin maven-plugin - Axis :: Maven :: maven-wsdl2java-plugin + wsdl2java-maven-plugin Axis wsdl2java Maven plugin. @@ -82,13 +82,25 @@ + + com.github.veithen.maven + resolver-proxy-maven-plugin + 0.2.0 + + + + start + stop + + + + maven-invoker-plugin integration-test - install run @@ -100,8 +112,6 @@ setup verify - ${project.build.directory}/local-repo - src/it/settings.xml clean install @@ -114,21 +124,4 @@ - - - - maven-plugin-plugin - 2.9 - - - maven-project-info-reports-plugin - 2.4 - - - - - - - - diff --git a/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml b/maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/pom.xml similarity index 97% rename from maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml rename to maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/pom.xml index d648c90deb..df7d538135 100644 --- a/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/pom.xml +++ b/maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/pom.xml @@ -33,7 +33,7 @@ @project.groupId@ - maven-wsdl2java-plugin + wsdl2java-maven-plugin @project.version@ diff --git a/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl b/maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl rename to maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/src/main/wsdl/AddData.wsdl diff --git a/maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh b/maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/verify.bsh similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/writeStubToTestSources/verify.bsh rename to maven/wsdl2java-maven-plugin/src/it/writeStubToTestSources/verify.bsh diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/pom.xml b/maven/wsdl2java-maven-plugin/src/it/wsrf/pom.xml similarity index 98% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/pom.xml rename to maven/wsdl2java-maven-plugin/src/it/wsrf/pom.xml index 2c00dbce24..ce36d32110 100644 --- a/maven/maven-wsdl2java-plugin/src/it/wsrf/pom.xml +++ b/maven/wsdl2java-maven-plugin/src/it/wsrf/pom.xml @@ -33,7 +33,7 @@ @project.groupId@ - maven-wsdl2java-plugin + wsdl2java-maven-plugin @project.version@ diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/addressing.xsd b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/addressing.xsd similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/addressing.xsd rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/addressing.xsd diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/catalog.xml b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/catalog.xml similarity index 90% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/catalog.xml rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/catalog.xml index 67445b69f0..7b8854e242 100644 --- a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/catalog.xml +++ b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/catalog.xml @@ -4,5 +4,4 @@ - diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-BaseFaults-1.2-draft-01.xsd b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-BaseFaults-1.2-draft-01.xsd similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-BaseFaults-1.2-draft-01.xsd rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-BaseFaults-1.2-draft-01.xsd diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01-impl.wsdl b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01-impl.wsdl similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01-impl.wsdl rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01-impl.wsdl diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.xsd b/maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.xsd similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.xsd rename to maven/wsdl2java-maven-plugin/src/it/wsrf/src/main/wsdl/wsrf-WS-ResourceProperties-1.2-draft-01.xsd diff --git a/maven/maven-wsdl2java-plugin/src/it/wsrf/verify.bsh b/maven/wsdl2java-maven-plugin/src/it/wsrf/verify.bsh similarity index 100% rename from maven/maven-wsdl2java-plugin/src/it/wsrf/verify.bsh rename to maven/wsdl2java-maven-plugin/src/it/wsrf/verify.bsh diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java similarity index 98% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java index cfbebaea20..21f83c89c1 100644 --- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java +++ b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java @@ -179,6 +179,13 @@ public abstract class AbstractWsdl2JavaMojo extends AbstractMojo { */ private boolean helperGen; + /** + * + * + * @parameter default-value="false" + */ + private boolean allowInvalidURL; + /** * The location of the deployment WSDD file to be generated. This parameter is ignored if * {@link #generate} is set to client. If this parameter is not specified, then no @@ -269,7 +276,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { // emitter.setQuiet(quiet); emitter.setTypeMappingVersion(typeMappingVersion); emitter.setNowrap(noWrapped); -// emitter.setAllowInvalidURL(allowInvalidURL); + emitter.setAllowInvalidURL(allowInvalidURL); emitter.setWrapArrays(wrapArrays); // if (namespaceMappingFile != null) { // emitter.setNStoPkg(namespaceMappingFile.toString()); diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/CustomizableBaseTypeMapping.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/CustomizableBaseTypeMapping.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/CustomizableBaseTypeMapping.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/CustomizableBaseTypeMapping.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/EmitterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java similarity index 96% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java index b95cb565c1..d910208bef 100644 --- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java +++ b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateSourcesMojo.java @@ -39,7 +39,7 @@ public class GenerateSourcesMojo extends AbstractWsdl2JavaMojo { /** * Flag indicating whether the stub and locator should be written to * {@link #sourceOutputDirectory} (false) or to {@link #testSourceOutputDirectory} - * (false). Set this parameter to true if the main artifact of your + * (true). Set this parameter to true if the main artifact of your * project should not contain client-side code, but you need it in your test cases. Note that * this parameter is only meaningful if generate is set to both. * diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/GenerateTestSourcesMojo.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaBindingWriterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaDeployWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaDeployWriterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaDeployWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaDeployWriterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaGeneratorFactoryEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java similarity index 95% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java index b2085b9882..d19a96c4ad 100644 --- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java +++ b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceIfaceWriterEx.java @@ -35,7 +35,7 @@ protected String getFileName() { if (clientOutputDirectory == null) { return super.getFileName(); } else { - return clientOutputDirectory + File.separator + packageName.replaceAll("\\.", File.separator) + File.separator + className + ".java"; + return clientOutputDirectory + File.separator + packageName.replace('.', File.separatorChar) + File.separator + className + ".java"; } } } diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java similarity index 95% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java index a4bf450195..d4eb7ac9c7 100644 --- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java +++ b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceImplWriterEx.java @@ -35,7 +35,7 @@ protected String getFileName() { if (clientOutputDirectory == null) { return super.getFileName(); } else { - return clientOutputDirectory + File.separator + packageName.replaceAll("\\.", File.separator) + File.separator + className + ".java"; + return clientOutputDirectory + File.separator + packageName.replace('.', File.separatorChar) + File.separator + className + ".java"; } } } diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaServiceWriterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java similarity index 95% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java index d5ca803832..defff71c79 100644 --- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java +++ b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaStubWriterEx.java @@ -35,7 +35,7 @@ protected String getFileName() { if (clientOutputDirectory == null) { return super.getFileName(); } else { - return clientOutputDirectory + File.separator + packageName.replaceAll("\\.", File.separator) + File.separator + className + ".java"; + return clientOutputDirectory + File.separator + packageName.replace('.', File.separatorChar) + File.separator + className + ".java"; } } } diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaTestCaseWriterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaUndeployWriterEx.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaUndeployWriterEx.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaUndeployWriterEx.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaUndeployWriterEx.java diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaXmlTypeMapping.java b/maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaXmlTypeMapping.java similarity index 100% rename from maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaXmlTypeMapping.java rename to maven/wsdl2java-maven-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/JavaXmlTypeMapping.java diff --git a/maven/maven-wsdl2java-plugin/src/site/apt/index.apt b/maven/wsdl2java-maven-plugin/src/site/apt/index.apt similarity index 98% rename from maven/maven-wsdl2java-plugin/src/site/apt/index.apt rename to maven/wsdl2java-maven-plugin/src/site/apt/index.apt index 40ebe1e284..fe0e81fe0a 100644 --- a/maven/maven-wsdl2java-plugin/src/site/apt/index.apt +++ b/maven/wsdl2java-maven-plugin/src/site/apt/index.apt @@ -19,7 +19,7 @@ Introduction ------------ -maven-wsdl2java-plugin +wsdl2java-maven-plugin The wsdl2java plugin is used to generate client and/or server side Java artifacts from a WSDL file. diff --git a/maven/maven-wsdl2java-plugin/src/site/apt/java-xml-type-mappings.apt.vm b/maven/wsdl2java-maven-plugin/src/site/apt/java-xml-type-mappings.apt.vm similarity index 97% rename from maven/maven-wsdl2java-plugin/src/site/apt/java-xml-type-mappings.apt.vm rename to maven/wsdl2java-maven-plugin/src/site/apt/java-xml-type-mappings.apt.vm index 7e9c7f2af5..33db2ddea1 100644 --- a/maven/maven-wsdl2java-plugin/src/site/apt/java-xml-type-mappings.apt.vm +++ b/maven/wsdl2java-maven-plugin/src/site/apt/java-xml-type-mappings.apt.vm @@ -22,7 +22,7 @@ Changing the Java class associated with an XML type - maven-wsdl2java-plugin uses the default mappings between XML types and Java classes determined by the + wsdl2java-maven-plugin uses the default mappings between XML types and Java classes determined by the configured <<>>. However, there may be situations where you might want to represent a given XML type using a Java type other than the one determined by the default mapping. E.g. you might want <<>> to be represented by <<>> diff --git a/maven/maven-wsdl2java-plugin/src/site/site.xml b/maven/wsdl2java-maven-plugin/src/site/site.xml similarity index 96% rename from maven/maven-wsdl2java-plugin/src/site/site.xml rename to maven/wsdl2java-maven-plugin/src/site/site.xml index 907f765393..a34d38f5e9 100644 --- a/maven/maven-wsdl2java-plugin/src/site/site.xml +++ b/maven/wsdl2java-maven-plugin/src/site/site.xml @@ -17,7 +17,7 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + diff --git a/pom.xml b/pom.xml index f2519666a8..8b1e9df86d 100644 --- a/pom.xml +++ b/pom.xml @@ -57,26 +57,40 @@ 2000 + apidocs axis axis-ant axis-codegen axis-jaxrpc + axis-model + axis-rt-compat axis-rt-core + axis-rt-jws axis-rt-databinding-castor + axis-rt-databinding-xmlbeans + axis-rt-management axis-rt-provider-bsf + axis-rt-soapmonitor + axis-rt-transport-http-hc3 axis-rt-transport-http-javanet axis-rt-transport-jms + axis-rt-transport-mail axis-saaj axis-standalone-server axis-testutils axis-tools axis-war + daemon-launcher distribution integration - interop interop-mock + jetty-daemon maven samples + soapmonitor-applet + soapmonitor-client + tcpmon + tests @@ -85,10 +99,20 @@ activation 1.1 + + javax.mail + mail + 1.4.1 + junit junit - 3.8.2 + 4.12 + + + com.google.truth + truth + 0.40 xmlunit @@ -105,11 +129,49 @@ commons-io 1.4 + + org.apache.ws.commons.axiom + testutils + 1.2.15 + + + commons-lang + commons-lang + 2.6 + + + commons-daemon + commons-daemon + 1.0.10 + + + commons-cli + commons-cli + 1.2 + + + + org.mortbay.jetty + jetty + 6.1.26 + 3.0.3 + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + false + + + true + + + @@ -127,14 +189,21 @@ maven-javadoc-plugin + 3.0.0 - 1.4 + false + ${javaVersion} + true maven-surefire-plugin - 2.11 + 2.21.0 + + alphabetical + true + false + alphabetical + true + false - org.apache.axis.soap.MessageFactoryImpl org.apache.axis.soap.SOAPFactoryImpl org.apache.axis.soap.SOAPConnectionFactoryImpl @@ -164,7 +236,7 @@ maven-site-plugin - 3.0 + 3.4 maven-assembly-plugin @@ -172,7 +244,7 @@ maven-dependency-plugin - 2.4 + 2.6 org.codehaus.mojo @@ -182,12 +254,43 @@ maven-invoker-plugin 1.7 + + + ${argLine} + org.mortbay.jetty jetty-maven-plugin 7.5.4.v20111024 + + maven-war-plugin + 2.1.1 + + + org.codehaus.gmaven + gmaven-plugin + 1.2 + + + maven-shade-plugin + 2.3 + + + maven-eclipse-plugin + 2.9 + + + com.github.veithen.filecheck + filecheck-maven-plugin + 0.1 + + + com.github.veithen.alta + alta-maven-plugin + 0.6.2 + @@ -210,49 +313,211 @@ + + maven-compiler-plugin + 3.7.0 + + ${javaVersion} + ${javaVersion} + + + + org.jacoco + jacoco-maven-plugin + 0.8.2 + + + + prepare-agent + + + + + + com.github.veithen.maven + jacoco-report-maven-plugin + 0.1.1 + + + + process + + + + + + org.codehaus.gmaven + gmaven-plugin + + + select-java-signatures + verify + + execute + + + + javaVersion = project.properties['javaVersion'] + if (javaVersion == '1.4') { + artifactId = 'java14-sun' + } else if (javaVersion == '1.5') { + artifactId = 'java15-sun' + } else if (javaVersion == '1.6') { + artifactId = 'java16-sun' + } + project.properties['signatureArtifactId'] = artifactId + project.properties['signatureVersion'] = '1.0' + + + + + + + + maven-source-plugin + + + source-jars + + jar-no-fork + + + + + true + + + + + maven-site-plugin + false + + + + maven-project-info-reports-plugin + 2.8 + + index + issue-tracking + mailing-list + + scm + + + + + + + org.apache.maven.plugins + maven-site-plugin + + + true + + + + org.apache.maven.plugins + maven-scm-publish-plugin + 1.0-beta-2 + + + com.github.veithen.maven + hermetic-maven-plugin + 0.5.0 + + + + generate-policy + + + true + + + + + + + apache-release + + + + maven-source-plugin + + + + attach-sources + none + + jar + + + + + + + + + + eclipse + + true + + + install + + + maven-eclipse-plugin + + + + prepare-package + + eclipse + + + true + + + + + + + + + maven-project-info-reports-plugin - 2.4 + 2.8 index - issue-tracking - mailing-list - - scm + summary + dependencies - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - - aggregate - - aggregate - - - 1.4 - test.*:samples.* - apiDocs - - - + + false + + 1.4 http://axis.apache.org/axis/java - - dav:http://localhost/sites/axis + scm:svn:https://svn.apache.org/repos/asf/axis/site/axis/java diff --git a/samples/addr-sample/pom.xml b/samples/addr-sample/pom.xml new file mode 100644 index 0000000000..7e47928667 --- /dev/null +++ b/samples/addr-sample/pom.xml @@ -0,0 +1,164 @@ + + + + 4.0.0 + + org.apache.axis + samples + 1.4.1-SNAPSHOT + ../pom.xml + + addr-sample + Addressbook Sample + + + ${project.groupId} + axis-rt-core + ${project.version} + + + junit + junit + test + + + + + + ${project.groupId} + wsdl2java-maven-plugin + ${project.version} + + + samples-addr + + generate-sources + + + src/main/wsdl/AddressBook.wsdl + both + 1.1 + true + session + + + urn:AddressFetcher2 + samples.addr + + + ${project.build.directory}/wsdd/AddressBook.wsdd + + + + + + maven-surefire-plugin + + + default-test + + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + pre-integration-test + + + test.functional.ServicePort + + + + + attach-wsdd + package + + attach-artifact + + + + + ${project.build.directory}/wsdd/AddressBook.wsdd + wsdd + deploy + + + + + + + + ${project.groupId} + axis-server-maven-plugin + ${project.version} + + + start-server + + start-server + + + ${test.functional.ServicePort} + + + ${project.build.directory}/wsdd + + + + + + stop-server + + stop-all + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + **/*TestCase.java + + + ${test.functional.ServicePort} + + + + + + + + diff --git a/distribution/src/main/files/samples/addr/AddressBookSOAPBindingImpl.java b/samples/addr-sample/src/main/java/samples/addr/AddressBookSOAPBindingImpl.java similarity index 100% rename from distribution/src/main/files/samples/addr/AddressBookSOAPBindingImpl.java rename to samples/addr-sample/src/main/java/samples/addr/AddressBookSOAPBindingImpl.java diff --git a/distribution/src/main/files/samples/addr/DOMUtils.java b/samples/addr-sample/src/main/java/samples/addr/DOMUtils.java similarity index 100% rename from distribution/src/main/files/samples/addr/DOMUtils.java rename to samples/addr-sample/src/main/java/samples/addr/DOMUtils.java diff --git a/distribution/src/main/files/samples/addr/Main.java b/samples/addr-sample/src/main/java/samples/addr/Main.java similarity index 100% rename from distribution/src/main/files/samples/addr/Main.java rename to samples/addr-sample/src/main/java/samples/addr/Main.java diff --git a/distribution/src/main/files/samples/addr/AddressBook.wsdl b/samples/addr-sample/src/main/wsdl/AddressBook.wsdl similarity index 100% rename from distribution/src/main/files/samples/addr/AddressBook.wsdl rename to samples/addr-sample/src/main/wsdl/AddressBook.wsdl diff --git a/distribution/src/main/files/samples/addr/AddressBookTestCase.java b/samples/addr-sample/src/test/java/samples/addr/AddressBookTestCase.java similarity index 94% rename from distribution/src/main/files/samples/addr/AddressBookTestCase.java rename to samples/addr-sample/src/test/java/samples/addr/AddressBookTestCase.java index a189692b5e..c3c9291a59 100644 --- a/distribution/src/main/files/samples/addr/AddressBookTestCase.java +++ b/samples/addr-sample/src/test/java/samples/addr/AddressBookTestCase.java @@ -32,7 +32,7 @@ public AddressBookTestCase(String name) { } public void doTest () throws Exception { - String[] args = {}; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080") }; Main.main(args); } diff --git a/samples/attachments-sample/pom.xml b/samples/attachments-sample/pom.xml index d4c434337c..64699e59e9 100644 --- a/samples/attachments-sample/pom.xml +++ b/samples/attachments-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -91,7 +86,8 @@ src/main/wsdd - **/*.wsdd + attachdeploy.wsdd + testref.wsdd diff --git a/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java b/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java index bd02ae7dba..c821c47cca 100644 --- a/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java +++ b/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java @@ -31,27 +31,27 @@ protected void setUp() throws Exception { } public void testAttachments1() throws Exception { - boolean res = new EchoAttachment(opts).echo(false, System.getProperty("basedir") + "/pom.xml"); + boolean res = new EchoAttachment(opts).echo(false, "pom.xml"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachmentsD1() throws Exception { - boolean res = new EchoAttachment(opts).echo(true, System.getProperty("basedir") + "/pom.xml"); + boolean res = new EchoAttachment(opts).echo(true, "pom.xml"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachmentsDimeLeaveEmpty() throws Exception { - boolean res = new EchoAttachment(opts).echo(true, System.getProperty("basedir") + "/src/test/files/leaveempty.txt"); + boolean res = new EchoAttachment(opts).echo(true, "src/test/files/leaveempty.txt"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachments2() throws Exception { - boolean res = new EchoAttachment(opts).echoDir(false, System.getProperty("basedir") + "/src/main/java/samples/attachments"); + boolean res = new EchoAttachment(opts).echoDir(false, "src/main/java/samples/attachments"); assertEquals("Didn't process attachments correctly", res, true); } public void testAttachmentsD2() throws Exception { - boolean res = new EchoAttachment(opts).echoDir(true, System.getProperty("basedir") + "/src/main/java/samples/attachments"); + boolean res = new EchoAttachment(opts).echoDir(true, "src/main/java/samples/attachments"); assertEquals("Didn't process attachments correctly", res, true); } diff --git a/samples/bidbuy-sample/pom.xml b/samples/bidbuy-sample/pom.xml index 878bb3815a..5b050ed369 100644 --- a/samples/bidbuy-sample/pom.xml +++ b/samples/bidbuy-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} diff --git a/samples/echo-sample/pom.xml b/samples/echo-sample/pom.xml index 71338f94a5..4eba15d5cd 100644 --- a/samples/echo-sample/pom.xml +++ b/samples/echo-sample/pom.xml @@ -43,7 +43,7 @@ ${project.groupId} - maven-wsdl2java-plugin + wsdl2java-maven-plugin ${project.version} @@ -69,14 +69,33 @@ + + ${project.groupId} + wsdd-maven-plugin + ${project.version} + + + + generate-test-sources + + generate-wsdd + + + server + ${project.build.directory}/server-config.wsdd + + + + maven-surefire-plugin default-test - - ${project.build.directory}/work + + ${project.build.directory}/server-config.wsdd + diff --git a/samples/echo-sample/src/test/java/test/functional/TestEchoSample.java b/samples/echo-sample/src/test/java/test/functional/TestEchoSample.java index 5ea5ee918c..770b3081d9 100644 --- a/samples/echo-sample/src/test/java/test/functional/TestEchoSample.java +++ b/samples/echo-sample/src/test/java/test/functional/TestEchoSample.java @@ -43,7 +43,7 @@ public void testEchoService () throws Exception { // deploy the echo service String[] args = {"-l", "local:///AdminService", - System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd"}; + "src/main/wsdd/deploy.wsdd"}; AdminClient.main(args); // define the tests using JUnit assert facilities, and tell client to diff --git a/samples/encoding-sample/pom.xml b/samples/encoding-sample/pom.xml index d9edb8b7b8..bac3a45821 100644 --- a/samples/encoding-sample/pom.xml +++ b/samples/encoding-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -91,7 +86,7 @@ src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/faults-sample/pom.xml b/samples/faults-sample/pom.xml index 2e07be0964..6a00eb4830 100644 --- a/samples/faults-sample/pom.xml +++ b/samples/faults-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -91,7 +86,7 @@ src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/faults-sample/src/main/java/samples/faults/EmployeeClient.java b/samples/faults-sample/src/main/java/samples/faults/EmployeeClient.java index 87d5e24cc5..e85e6b1fb7 100644 --- a/samples/faults-sample/src/main/java/samples/faults/EmployeeClient.java +++ b/samples/faults-sample/src/main/java/samples/faults/EmployeeClient.java @@ -2,10 +2,7 @@ import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.encoding.ser.BeanDeserializerFactory; -import org.apache.axis.AxisFault; import org.apache.axis.utils.Options; -import org.apache.axis.transport.http.SimpleAxisWorker; -import org.apache.axis.description.OperationDesc; import javax.xml.rpc.ServiceFactory; import javax.xml.rpc.Service; @@ -14,8 +11,6 @@ import javax.xml.rpc.encoding.TypeMapping; import javax.xml.namespace.QName; import java.net.URL; -import java.util.Map; -import java.util.Iterator; import samples.faults.Employee; diff --git a/samples/handler-sample/pom.xml b/samples/handler-sample/pom.xml index 8e2f559791..9f5a5534ea 100644 --- a/samples/handler-sample/pom.xml +++ b/samples/handler-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} diff --git a/samples/integrationguide-sample/pom.xml b/samples/integrationguide-sample/pom.xml index ad93742ad4..95955e7c08 100644 --- a/samples/integrationguide-sample/pom.xml +++ b/samples/integrationguide-sample/pom.xml @@ -64,6 +64,7 @@ + @@ -71,6 +72,7 @@ + diff --git a/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example1/VerifyFilesTest.java b/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example1/VerifyFilesTest.java index fe05d23382..5ccea7209d 100644 --- a/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example1/VerifyFilesTest.java +++ b/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example1/VerifyFilesTest.java @@ -26,7 +26,7 @@ public class VerifyFilesTest extends TestCase { public void testDeployUseless() throws Exception { - File file = new File(System.getProperty("basedir", "."), "target/work/example1/com/examples/www/wsdl/HelloService_wsdl/Hello_Service.lst"); + File file = new File("target/work/example1/com/examples/www/wsdl/HelloService_wsdl/Hello_Service.lst"); assertTrue(file.exists()); assertEquals("Hello_Port", FileUtils.readFileToString(file).trim()); } diff --git a/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example2/VerifyFilesTest.java b/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example2/VerifyFilesTest.java index fb13998960..18422ddb01 100644 --- a/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example2/VerifyFilesTest.java +++ b/samples/integrationguide-sample/src/test/java/samples/integrationGuide/example2/VerifyFilesTest.java @@ -26,7 +26,7 @@ public class VerifyFilesTest extends TestCase { public void testDeployUseless() throws Exception { - File file = new File(System.getProperty("basedir", "."), "target/work/example2/com/examples/www/wsdl/HelloService_wsdl/deploy.useless"); + File file = new File("target/work/example2/com/examples/www/wsdl/HelloService_wsdl/deploy.useless"); assertTrue(file.exists()); assertEquals("Hi ho! Hi ho! It's off to work we go.", FileUtils.readFileToString(file).trim()); } diff --git a/samples/jaxm-sample/pom.xml b/samples/jaxm-sample/pom.xml index de488611e5..1044245b51 100644 --- a/samples/jaxm-sample/pom.xml +++ b/samples/jaxm-sample/pom.xml @@ -38,5 +38,127 @@ junit test + + ${project.groupId} + interop-mock + ${project.version} + war + test + + + + + src/main/resources + true + + + + + maven-surefire-plugin + + + default-test + + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + pre-integration-test + + + jetty.httpPort + jetty.stopPort + + + + + + + com.github.veithen.alta + alta-maven-plugin + + + pre-integration-test + + generate-properties + + + %artifactId%.location + %file% + + test + + *:*:war:* + + + + + + + + org.mortbay.jetty + jetty-maven-plugin + + ${interop-mock.location} + foo + ${jetty.stopPort} + + + ${jetty.httpPort} + 60000 + + + + + + start-jetty + pre-integration-test + + deploy-war + + + true + + + + stop-jetty + post-integration-test + + stop + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + **/Test*.java + + + ${jetty.httpPort} + + + + + + + diff --git a/samples/jaxm-sample/src/main/java/samples/jaxm/DelayedStockQuote.java b/samples/jaxm-sample/src/main/java/samples/jaxm/DelayedStockQuote.java index cc68ac91f2..9929392d98 100644 --- a/samples/jaxm-sample/src/main/java/samples/jaxm/DelayedStockQuote.java +++ b/samples/jaxm-sample/src/main/java/samples/jaxm/DelayedStockQuote.java @@ -30,6 +30,16 @@ import java.util.Iterator; public class DelayedStockQuote { + private final String url; + + public DelayedStockQuote() { + this("http://64.124.140.30/soap"); + } + + public DelayedStockQuote(String url) { + this.url = url; + } + public static void main(String[] args) throws Exception { DelayedStockQuote stockQuote = new DelayedStockQuote(); System.out.print("The last price for SUNW is " + stockQuote.getStockQuote("SUNW")); @@ -57,7 +67,7 @@ public String getStockQuote(String tickerSymbol) throws Exception { SOAPElement symbol = gltp.addChildElement(name); symbol.addTextNode(tickerSymbol); - URLEndpoint endpoint = new URLEndpoint("http://64.124.140.30/soap"); + URLEndpoint endpoint = new URLEndpoint(url); SOAPMessage response = con.call(message, endpoint); con.close(); diff --git a/samples/jaxm-sample/src/main/java/samples/jaxm/UddiPing.java b/samples/jaxm-sample/src/main/java/samples/jaxm/UddiPing.java index ef62d8463e..102a68184f 100644 --- a/samples/jaxm-sample/src/main/java/samples/jaxm/UddiPing.java +++ b/samples/jaxm-sample/src/main/java/samples/jaxm/UddiPing.java @@ -60,8 +60,8 @@ public static void searchUDDI(String name, String url) throws Exception { msg.saveChanges(); SOAPMessage reply = connection.call(msg, endpoint); - //System.out.println("Received reply from: " + endpoint); - //reply.writeTo(System.out); + System.out.println("Received reply from: " + endpoint); + reply.writeTo(System.out); connection.close(); } } diff --git a/samples/jaxm-sample/src/test/java/test/functional/TestJAXMSamples.java b/samples/jaxm-sample/src/test/java/test/functional/TestJAXMSamples.java index b5326d792d..bb38ec1a43 100644 --- a/samples/jaxm-sample/src/test/java/test/functional/TestJAXMSamples.java +++ b/samples/jaxm-sample/src/test/java/test/functional/TestJAXMSamples.java @@ -17,23 +17,10 @@ package test.functional; import junit.framework.TestCase; -import org.apache.axis.AxisFault; import org.apache.axis.components.logger.LogFactory; import org.apache.commons.logging.Log; import samples.jaxm.DelayedStockQuote; - -import javax.xml.messaging.URLEndpoint; -import javax.xml.soap.MessageFactory; -import javax.xml.soap.Name; -import javax.xml.soap.SOAPBody; -import javax.xml.soap.SOAPBodyElement; -import javax.xml.soap.SOAPConnection; -import javax.xml.soap.SOAPConnectionFactory; -import javax.xml.soap.SOAPElement; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPMessage; -import java.net.SocketException; - +import samples.jaxm.UddiPing; /** * Test the JAX-RPC compliance samples. @@ -45,63 +32,13 @@ public TestJAXMSamples(String name) { super(name); } // ctor -// // This is timing out for some reason - removed for the nonce. -// // -- gdaniels, 4/21/2003 -// public void testUddiPing() throws Exception { -// try { -// log.info("Testing JAXM UddiPing sample."); -// UddiPing.searchUDDI("IBM", "http://www-3.ibm.com/services/uddi/testregistry/inquiryapi"); -// log.info("Test complete."); -// } catch (javax.xml.soap.SOAPException e) { -// Throwable t = e.getCause(); -// if (t != null) { -// t.printStackTrace(); -// if (t instanceof AxisFault) { -// AxisFault af = (AxisFault) t; -// if ((af.detail instanceof SocketException) || -// (af.getFaultCode().getLocalPart().equals("HTTP")) ) { -// System.out.println("Connect failure caused JAXM UddiPing to be skipped."); -// return; -// } -// } -// throw new Exception("Fault returned from test: " + t); -// } else { -// e.printStackTrace(); -// throw new Exception("Exception returned from test: " + e); -// } -// } catch (Throwable t) { -// t.printStackTrace(); -// throw new Exception("Fault returned from test: " + t); -// } -// } // testGetQuote + public void testUddiPing() throws Exception { + UddiPing.searchUDDI("Microsoft", "http://localhost:" + System.getProperty("jetty.httpPort") + "/uddi_v1"); + } // testGetQuote public void testDelayedStockQuote() throws Exception { - try { - log.info("Testing JAXM DelayedStockQuote sample."); - DelayedStockQuote stockQuote = new DelayedStockQuote(); - System.out.print("The last price for SUNW is " + stockQuote.getStockQuote("SUNW")); - log.info("Test complete."); - } catch (javax.xml.soap.SOAPException e) { - Throwable t = e.getCause(); - if (t != null) { - t.printStackTrace(); - if (t instanceof AxisFault) { - AxisFault af = (AxisFault) t; - if ((af.detail instanceof SocketException) - || (af.getFaultCode().getLocalPart().equals("HTTP"))) { - System.out.println("Connect failure caused JAXM DelayedStockQuote to be skipped."); - return; - } - } - throw new Exception("Fault returned from test: " + t); - } else { - e.printStackTrace(); - throw new Exception("Exception returned from test: " + e); - } - } catch (Throwable t) { - t.printStackTrace(); - throw new Exception("Fault returned from test: " + t); - } + DelayedStockQuote stockQuote = new DelayedStockQuote("http://localhost:" + System.getProperty("jetty.httpPort") + "/xmethods/delayed-quotes"); + assertEquals("3.67", stockQuote.getStockQuote("SUNW")); } // testGetQuote public static void main(String args[]) throws Exception { diff --git a/samples/jaxrpc-sample/pom.xml b/samples/jaxrpc-sample/pom.xml index c731414156..754aa53c65 100644 --- a/samples/jaxrpc-sample/pom.xml +++ b/samples/jaxrpc-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - ${project.groupId} stock-sample @@ -65,7 +60,7 @@ ${project.groupId} - maven-wsdl2java-plugin + wsdl2java-maven-plugin ${project.version} @@ -111,7 +106,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -125,13 +120,13 @@ src/main/wsdd - **/*.wsdd + **/deploy.wsdd ../stock-sample/src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/jms-sample/pom.xml b/samples/jms-sample/pom.xml new file mode 100644 index 0000000000..a113aee5ab --- /dev/null +++ b/samples/jms-sample/pom.xml @@ -0,0 +1,210 @@ + + + + 4.0.0 + + org.apache.axis + samples + 1.4.1-SNAPSHOT + ../pom.xml + + jms-sample + JMS Sample + + + ${project.groupId} + axis-rt-core + ${project.version} + + + ${project.groupId} + axis-rt-transport-jms + ${project.version} + + + ${project.groupId} + stock-sample + ${project.version} + + + junit + junit + + + org.apache.activemq + activemq-core + 5.4.3 + test + + + commons-daemon + commons-daemon + test + + + + + + ${project.groupId} + wsdl2java-maven-plugin + ${project.version} + + + + generate-sources + + + src/main/wsdl/GetQuote.wsdl + client + 1.1 + session + true + + + urn:xmltoday-delayed-quotes + samples.jms.stub.xmltoday_delayed_quotes + + + urn:xmltoday-delayed-quotes + samples.jms.stub.xmltoday_delayed_quotes + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + pre-integration-test + + reserve-network-port + + + + test.brokerPort + + + + + + + maven-resources-plugin + + + pre-integration-test + + copy-resources + + + + + src/test/conf + true + + + ${project.build.directory}/conf + + + + + + ${project.groupId} + axis-server-maven-plugin + ${project.version} + + + start-broker + + start-daemon + + + samples.jms.ActiveMQDaemon + + ${test.brokerPort} + + + + + stop-broker + + stop-all + + + + + + maven-antrun-plugin + + + integration-test + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/distribution/src/main/files/samples/jms/JMSTest.java b/samples/jms-sample/src/main/java/samples/jms/JMSTest.java similarity index 99% rename from distribution/src/main/files/samples/jms/JMSTest.java rename to samples/jms-sample/src/main/java/samples/jms/JMSTest.java index 07389e0c0b..45adbc6578 100644 --- a/distribution/src/main/files/samples/jms/JMSTest.java +++ b/samples/jms-sample/src/main/java/samples/jms/JMSTest.java @@ -120,6 +120,7 @@ public static void main(String args[]) throws Exception { catch(AxisFault af) { System.out.println(af.dumpToString()); + System.exit(1); } } diff --git a/distribution/src/main/files/samples/jms/dii/JMSURLTest.java b/samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java similarity index 84% rename from distribution/src/main/files/samples/jms/dii/JMSURLTest.java rename to samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java index 31b12cd1eb..409ba464e4 100644 --- a/distribution/src/main/files/samples/jms/dii/JMSURLTest.java +++ b/samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java @@ -6,7 +6,6 @@ import org.apache.axis.configuration.XMLStringProvider; import org.apache.axis.deployment.wsdd.WSDDConstants; import org.apache.axis.encoding.XMLType; -import org.apache.axis.transport.jms.JMSConstants; import org.apache.axis.transport.jms.JMSTransport; import org.apache.axis.transport.jms.SimpleJMSListener; import org.apache.axis.utils.Options; @@ -36,24 +35,7 @@ public class JMSURLTest { ""; // the JMS URL target endpoint address - static String sampleJmsUrl = "jms:/MyQ?" + - "vendor=JNDI" + - "&java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory" + - "&java.naming.provider.url=file:///c:/JNDIStore" + - "&ConnectionFactoryJNDIName=MyCF" + - "&deliveryMode=persistent" + - "&priority=5" + - "&ttl=10000" + - "&debug=true"; - /* - // example using Sonic - static String sampleJmsUrl = "jms:/SampleQ1?" + - "vendor=SonicMQ" + - "&brokerURL=localhost:2506" + - "&deliveryMode=persistent" + - "&priority=5" + - "&ttl=10000"; - */ + static String sampleJmsUrl; public static void main(String args[]) throws Exception { Options opts = new Options( args ); @@ -69,6 +51,11 @@ public static void main(String args[]) throws Exception { HashMap cfMap = SimpleJMSListener.createCFMap(opts); String destination = opts.isValueSet('d'); + sampleJmsUrl = opts.isValueSet('e'); + if (sampleJmsUrl == null) { + printUsage(); + } + // create the jms listener SimpleJMSListener listener = new SimpleJMSListener(connectorMap, cfMap, @@ -92,6 +79,7 @@ public static void main(String args[]) throws Exception { catch(AxisFault af) { System.out.println(af.dumpToString()); + System.exit(1); } } @@ -102,7 +90,7 @@ public static void main(String args[]) throws Exception { // note: this is optional, as all connectors will be closed upon exit JMSTransport.closeMatchingJMSConnectors(sampleJmsUrl, username, password); - System.exit(1); + System.exit(0); } public static Float getQuote(String ticker, String username, String password) @@ -151,6 +139,7 @@ public static void printUsage() System.out.println(" -c connection factory properties filename"); System.out.println(" -d destination"); System.out.println(" -t topic [absence of -t indicates queue]"); + System.out.println(" -e the JMS endpoint URL to use for the client"); System.out.println(); System.out.println(" -u username"); System.out.println(" -w password"); diff --git a/distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java b/samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java similarity index 87% rename from distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java rename to samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java index 58814a4ca0..be4402dad0 100644 --- a/distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java +++ b/samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java @@ -25,6 +25,8 @@ import junit.framework.AssertionFailedError; import junit.framework.TestCase; +import java.net.MalformedURLException; +import java.net.URL; import java.rmi.RemoteException; import javax.xml.rpc.ServiceException; @@ -44,17 +46,23 @@ public JMSURLStubTest(String name) { super(name); } - public static Float getQuote(String ticker) throws AxisFault { + public static Float getQuote(String endptAddr, String ticker) throws AxisFault { float quote = -1.0F; GetQuoteServiceLocator locator = new GetQuoteServiceLocator(); GetQuote getQuote; + if (endptAddr == null) { + endptAddr = locator.getGetQuoteAddress(); + } + try { - getQuote = locator.getGetQuote(); + getQuote = locator.getGetQuote(new URL(endptAddr)); } catch (ServiceException e) { throw new AxisFault("JAX-RPC ServiceException caught: ", e); + } catch (MalformedURLException e) { + throw new AxisFault("MalformedURLException caught: ", e); } assertTrue("getQuote is null", getQuote != null); @@ -64,7 +72,6 @@ public static Float getQuote(String ticker) throws AxisFault { // close matching connectors // note: this is optional, as all connectors will be closed upon exit - String endptAddr = locator.getGetQuoteAddress(); JMSTransport.closeMatchingJMSConnectors(endptAddr, null, null); } catch (RemoteException e) { @@ -82,6 +89,7 @@ public static void printUsage() System.out.println(" -c connection factory properties filename"); System.out.println(" -d destination"); System.out.println(" -t topic [absence of -t indicates queue]"); + System.out.println(" -e the JMS endpoint URL to use for the client"); System.out.println(); System.out.println(" -u username"); System.out.println(" -w password"); @@ -110,6 +118,8 @@ public static void main(String[] args) throws Exception HashMap cfMap = SimpleJMSListener.createCFMap(opts); String destination = opts.isValueSet('d'); + String endptAddr = opts.isValueSet('e'); + args = opts.getRemainingArgs(); if ( args == null || args.length == 0) printUsage(); @@ -129,17 +139,18 @@ public static void main(String[] args) throws Exception { try { - Float quote = stubTest.getQuote(args[i]); + Float quote = stubTest.getQuote(endptAddr, args[i]); System.out.println(args[i] + ": " + quote); } catch(AxisFault af) { System.out.println(af.dumpToString()); + System.exit(1); } } listener.shutdown(); - System.exit(1); + System.exit(0); } } diff --git a/distribution/src/main/files/samples/jms/client-config.wsdd b/samples/jms-sample/src/main/wsdd/client-config.wsdd similarity index 100% rename from distribution/src/main/files/samples/jms/client-config.wsdd rename to samples/jms-sample/src/main/wsdd/client-config.wsdd diff --git a/distribution/src/main/files/samples/jms/server-config.wsdd b/samples/jms-sample/src/main/wsdd/server-config.wsdd similarity index 100% rename from distribution/src/main/files/samples/jms/server-config.wsdd rename to samples/jms-sample/src/main/wsdd/server-config.wsdd diff --git a/distribution/src/main/files/samples/jms/stub/GetQuote.wsdl b/samples/jms-sample/src/main/wsdl/GetQuote.wsdl similarity index 100% rename from distribution/src/main/files/samples/jms/stub/GetQuote.wsdl rename to samples/jms-sample/src/main/wsdl/GetQuote.wsdl diff --git a/samples/jms-sample/src/test/conf/activemq-connection-factory.properties b/samples/jms-sample/src/test/conf/activemq-connection-factory.properties new file mode 100644 index 0000000000..e00afa0de4 --- /dev/null +++ b/samples/jms-sample/src/test/conf/activemq-connection-factory.properties @@ -0,0 +1,3 @@ +java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory +java.naming.provider.url=tcp://localhost:${test.brokerPort} +transport.jms.ConnectionFactoryJNDIName=ConnectionFactory diff --git a/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java new file mode 100644 index 0000000000..db1978294e --- /dev/null +++ b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package samples.jms; + +import org.apache.activemq.broker.BrokerFactory; +import org.apache.activemq.broker.BrokerService; +import org.apache.commons.daemon.Daemon; +import org.apache.commons.daemon.DaemonContext; +import org.apache.commons.daemon.DaemonInitException; + +public class ActiveMQDaemon implements Daemon { + private BrokerService broker; + + public void init(DaemonContext context) throws DaemonInitException, Exception { + broker = BrokerFactory.createBroker("broker:(tcp://localhost:" + context.getArguments()[0] + ")?useJmx=false&persistent=false"); + } + + public void start() throws Exception { + broker.start(); + } + + public void stop() throws Exception { + broker.stop(); + } + + public void destroy() { + broker = null; + } +} diff --git a/samples/message-sample/pom.xml b/samples/message-sample/pom.xml index d14d8d5628..d86601e394 100644 --- a/samples/message-sample/pom.xml +++ b/samples/message-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -91,7 +86,7 @@ src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/misc-sample/pom.xml b/samples/misc-sample/pom.xml index 5e16a465e4..b7fb0b4b01 100644 --- a/samples/misc-sample/pom.xml +++ b/samples/misc-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -91,7 +86,7 @@ src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/mtomstub-sample/pom.xml b/samples/mtomstub-sample/pom.xml index 1d11d2a068..b50d225b98 100644 --- a/samples/mtomstub-sample/pom.xml +++ b/samples/mtomstub-sample/pom.xml @@ -54,6 +54,11 @@ junit test + + org.apache.ws.commons.axiom + testutils + test + @@ -94,7 +99,7 @@ ${project.groupId} - maven-wsdl2java-plugin + wsdl2java-maven-plugin ${project.version} diff --git a/samples/mtomstub-sample/src/test/java/samples/mtomstub/TestDownloadFile.java b/samples/mtomstub-sample/src/test/java/samples/mtomstub/TestDownloadFile.java index 8cb3ecd8ef..c09c2461f3 100644 --- a/samples/mtomstub-sample/src/test/java/samples/mtomstub/TestDownloadFile.java +++ b/samples/mtomstub-sample/src/test/java/samples/mtomstub/TestDownloadFile.java @@ -4,6 +4,8 @@ import javax.xml.ws.Endpoint; +import org.apache.axiom.testutils.PortAllocator; + import junit.framework.TestCase; import samples.mtomstub.service.DownloadFileImpl; import samples.mtomstub.stub.DownloadFile; @@ -11,8 +13,7 @@ public class TestDownloadFile extends TestCase { public void test() throws Exception { - // TODO: allocate random port here - String url = "http://localhost:8080/DownloadFile"; + String url = "http://localhost:" + PortAllocator.allocatePort() + "/DownloadFile"; Endpoint endpoint = Endpoint.publish(url, new DownloadFileImpl()); DownloadFile downloadFile = new DownloadFileServiceLocator().getDownloadFilePort(new URL(url)); downloadFile.getFile().getFile().writeTo(System.out); diff --git a/samples/pom.xml b/samples/pom.xml index e088606d87..9c7d2908ef 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -32,6 +32,7 @@ Root POM for the Axis samples. + addr-sample attachments-sample bidbuy-sample echo-sample @@ -41,6 +42,7 @@ integrationguide-sample jaxm-sample jaxrpc-sample + jms-sample message-sample mtomstub-sample misc-sample diff --git a/samples/proxy-sample/pom.xml b/samples/proxy-sample/pom.xml index b54470db95..ca3e39c764 100644 --- a/samples/proxy-sample/pom.xml +++ b/samples/proxy-sample/pom.xml @@ -49,11 +49,6 @@ ${project.version} test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -88,7 +83,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} diff --git a/samples/stock-sample/pom.xml b/samples/stock-sample/pom.xml index b56f66f45d..bbad7e2157 100644 --- a/samples/stock-sample/pom.xml +++ b/samples/stock-sample/pom.xml @@ -38,11 +38,6 @@ junit test - - ${project.groupId} - axis-standalone-server - ${project.version} - @@ -77,7 +72,7 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} @@ -99,7 +94,7 @@ src/main/wsdd - **/*.wsdd + deploy.wsdd diff --git a/samples/stock-sample/src/test/java/test/functional/TestStockSample.java b/samples/stock-sample/src/test/java/test/functional/TestStockSample.java index 819feb1c8f..6332109ec2 100644 --- a/samples/stock-sample/src/test/java/test/functional/TestStockSample.java +++ b/samples/stock-sample/src/test/java/test/functional/TestStockSample.java @@ -29,11 +29,14 @@ public void testStockJWS () throws Exception { "-uuser1", "-wpass1", "XXX", "-saxis/StockQuoteService.jws" }; float val = new GetQuote().getQuote(args); assertEquals("TestStockSample.doTestStockJWS(): stock price should be 66.25", val, 66.25, 0.01); - + } + + public void testStockJWSInvalidURL() throws Exception { // This should FAIL - args[5] = "-sjws/AltStockQuoteService.jws"; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), + "-uuser1", "-wpass1", "XXX", "-sjws/StockQuoteService.jws" }; try { - val = new GetQuote().getQuote(args); + new GetQuote().getQuote(args); } catch (AxisFault e) { // Don't print stack trace unless there is an error // e.printStackTrace(); diff --git a/samples/transport-sample/pom.xml b/samples/transport-sample/pom.xml index a6eaada7f3..acb4de809e 100644 --- a/samples/transport-sample/pom.xml +++ b/samples/transport-sample/pom.xml @@ -44,9 +44,22 @@ ${project.version} test + + commons-daemon + commons-daemon + test + + + com.github.veithen.maven + hermetic-maven-plugin + + + true + + maven-surefire-plugin @@ -78,16 +91,16 @@ ${project.groupId} - maven-axis-server-plugin + axis-server-maven-plugin ${project.version} start-server - start-process + start-daemon - samples.transport.tcp.TCPListener + samples.transport.tcp.TCPListenerDaemon -p ${test.functional.TCPListenerPort} @@ -103,6 +116,24 @@ + + ${project.groupId} + wsdd-maven-plugin + ${project.version} + + + + pre-integration-test + + generate-wsdd + + + server + ${project.build.directory}/server-config.wsdd + + + + maven-failsafe-plugin @@ -115,9 +146,8 @@ **/Test*.java - - ${project.build.directory}/work + ${project.build.directory}/server-config.wsdd ${test.functional.TCPListenerPort} diff --git a/samples/transport-sample/src/main/java/samples/transport/tcp/AdminClient.java b/samples/transport-sample/src/main/java/samples/transport/tcp/AdminClient.java index edcbb82379..348c2aa0db 100644 --- a/samples/transport-sample/src/main/java/samples/transport/tcp/AdminClient.java +++ b/samples/transport-sample/src/main/java/samples/transport/tcp/AdminClient.java @@ -19,7 +19,7 @@ import org.apache.axis.EngineConfiguration; import org.apache.axis.SimpleTargetedChain; import org.apache.axis.client.Call; -import org.apache.axis.configuration.DefaultEngineConfigurationFactory; +import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.configuration.SimpleProvider; /** @@ -38,8 +38,7 @@ public static void main(String args[]) { // Deploy the transport on top of the default client configuration. EngineConfiguration defaultConfig = - (new DefaultEngineConfigurationFactory()). - getClientEngineConfig(); + EngineConfigurationFactoryFinder.newFactory().getClientEngineConfig(); SimpleProvider config = new SimpleProvider(defaultConfig); SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender()); config.deployTransport("tcp", c); diff --git a/samples/transport-sample/src/main/java/samples/transport/tcp/GetQuote.java b/samples/transport-sample/src/main/java/samples/transport/tcp/GetQuote.java index d87aa84a60..209dc7b473 100644 --- a/samples/transport-sample/src/main/java/samples/transport/tcp/GetQuote.java +++ b/samples/transport-sample/src/main/java/samples/transport/tcp/GetQuote.java @@ -21,7 +21,7 @@ import org.apache.axis.SimpleTargetedChain; import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.configuration.DefaultEngineConfigurationFactory; +import org.apache.axis.configuration.EngineConfigurationFactoryFinder; import org.apache.axis.configuration.SimpleProvider; import org.apache.axis.encoding.XMLType; import org.apache.axis.utils.Options; @@ -55,8 +55,7 @@ public float getQuote (String args[]) throws Exception { symbol = args[0] ; EngineConfiguration defaultConfig = - (new DefaultEngineConfigurationFactory()). - getClientEngineConfig(); + EngineConfigurationFactoryFinder.newFactory().getClientEngineConfig(); SimpleProvider config = new SimpleProvider(defaultConfig); SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender()); config.deployTransport("tcp", c); diff --git a/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java b/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java index 35b517d4c1..9035184dff 100644 --- a/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java +++ b/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java @@ -59,7 +59,7 @@ public class TCPListener implements Runnable { private AxisEngine engine = null ; // becomes true when we want to quit - private boolean done = false; + private volatile boolean done = false; static final String wsdd = " + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + soapmonitor-applet + SOAP Monitor Applet + ${baseUrl}/soapmonitor/applet + + + axis + ${baseSiteUrl}/soapmonitor/applet + + + diff --git a/axis-war/src/main/webapp/SOAPMonitorApplet.java b/soapmonitor-applet/src/main/java/SOAPMonitorApplet.java similarity index 99% rename from axis-war/src/main/webapp/SOAPMonitorApplet.java rename to soapmonitor-applet/src/main/java/SOAPMonitorApplet.java index 08b0ce1cdb..4dfd72cccb 100644 --- a/axis-war/src/main/webapp/SOAPMonitorApplet.java +++ b/soapmonitor-applet/src/main/java/SOAPMonitorApplet.java @@ -25,8 +25,6 @@ import javax.swing.event.*; import javax.swing.table.*; -import org.apache.axis.monitor.SOAPMonitorConstants; - /** * This is a SOAP Mointor Applet class. This class provides * the user interface for displaying data from the SOAP @@ -36,6 +34,8 @@ * */ public class SOAPMonitorApplet extends JApplet { + private static final int SOAP_MONITOR_REQUEST = 0; + private static final int SOAP_MONITOR_RESPONSE = 1; /** * Private data @@ -435,7 +435,7 @@ public void run() { message_type = (Integer) in.readObject(); // Process the data depending on its type switch (message_type.intValue()) { - case SOAPMonitorConstants.SOAP_MONITOR_REQUEST: + case SOAP_MONITOR_REQUEST: // Get the id, target and soap info id = (Long) in.readObject(); target = (String) in.readObject(); @@ -450,7 +450,7 @@ public void run() { valueChanged(null); } break; - case SOAPMonitorConstants.SOAP_MONITOR_RESPONSE: + case SOAP_MONITOR_RESPONSE: // Get the id and soap info id = (Long) in.readObject(); soap = (String) in.readObject(); diff --git a/soapmonitor-applet/src/site/site.xml b/soapmonitor-applet/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/soapmonitor-applet/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/soapmonitor-client/pom.xml b/soapmonitor-client/pom.xml new file mode 100644 index 0000000000..b3de22cf92 --- /dev/null +++ b/soapmonitor-client/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + soapmonitor-client + SOAP Monitor Client + ${baseUrl}/soapmonitor/client + + + axis + ${baseSiteUrl}/soapmonitor/client + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + ${project.groupId} + axis-rt-soapmonitor + ${project.version} + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/SOAPMonitor.java b/soapmonitor-client/src/main/java/org/apache/axis/utils/SOAPMonitor.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/utils/SOAPMonitor.java rename to soapmonitor-client/src/main/java/org/apache/axis/utils/SOAPMonitor.java diff --git a/soapmonitor-client/src/site/site.xml b/soapmonitor-client/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/soapmonitor-client/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/src/site/apt/building-axis.apt b/src/site/apt/building-axis.apt new file mode 100644 index 0000000000..c83e6d1855 --- /dev/null +++ b/src/site/apt/building-axis.apt @@ -0,0 +1,38 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + + ---------------------- + Guide to building Axis + ---------------------- + + The current Axis trunk uses {{{http://maven.apache.org/}Maven 3}} and the build is fully automated. + To build Axis, first check out the sources from SVN: + +--------------------------------------------------------- +svn checkout https://svn.apache.org/repos/asf/axis/axis1/java/trunk axis +--------------------------------------------------------- + + Then change to the <<>> directory and execute the Maven build: + +--------------------------------------------------------- +mvn clean install +--------------------------------------------------------- + + At the time of writing, the Axis build requires at least Maven 3.0.4 and Java 1.5. The build + is configured to fail early if an incompatible Maven or Java version is detected. + Note that the compatibility of the produced artifacts with Java 1.4 is enforced using the + {{{http://mojo.codehaus.org/animal-sniffer-maven-plugin/}Animal Sniffer Plugin}}. diff --git a/src/site/apt/changelogs/1_4_1.apt b/src/site/apt/changelogs/1_4_1.apt index 6ae6ba0ee6..13ab1e8887 100644 --- a/src/site/apt/changelogs/1_4_1.apt +++ b/src/site/apt/changelogs/1_4_1.apt @@ -40,9 +40,16 @@ Changes from 1.4 final earlier Java versions. * It is now possible to change the Java class associated with an XML type when generating a client stub. - Note that this is only supported by the maven-wsdl2java-plugin, but not by the corresponding Ant task + Note that this is only supported by the wsdl2java-maven-plugin, but not by the corresponding Ant task or command line tool. The feature can be used to consume MTOM enabled services. Check the - {{{../maven/maven-wsdl2java-plugin/java-xml-type-mappings.html}plugin documentation}} for more information. + {{{../maven/wsdl2java-maven-plugin/java-xml-type-mappings.html}plugin documentation}} for more information. * WSDL4J has been upgraded from 1.5.1 to 1.6.2. - + + * Support for Java 1.3 has been dropped. + + * <<>> no longer attempts to register the Axis MBeans automatically. To enable them, add + <<>> as a dependency and register <<>> + as a listener in <<>>. + + * The JWS support was updated to use the <<>> API, which requires Java 6. diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt new file mode 100644 index 0000000000..c942c40aa2 --- /dev/null +++ b/src/site/apt/index.apt @@ -0,0 +1,48 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + + ----- + About + ----- + + Apache Axis\u2122 is a second generation SOAP engine, the successor to the Apache SOAP project, + itself based on the original SOAP4J code that IBM contributed to Apache in April 2000. + In contrast to its predecessor, Axis is fully WSDL aware. It also supports the JAX-RPC API. + +~~ Ref.: http://markmail.org/thread/qa7w2e6onva2sn5m + + Today, Apache Axis is to a large extend superseded by a new generation of SOAP stacks + such as {{{http://axis.apache.org/axis2/java/core/}Apache Axis2}}, + {{{http://cxf.apache.org/}Apache CXF}} and {{{http://metro.java.net/}Metro}}. + However, Axis is still relevant for the following type of projects: + + * Projects that need to use JAX-RPC. There are only two Open Source implementations + of that API: Axis and {{{http://java.net/projects/jax-rpc/}Sun's reference implementation}}. + + * Projects that need to consume or expose Web services that use SOAP encoding. + SOAP encoding has been deprecated and is no longer supported by modern Web service + frameworks. However, there are still legacy services that use type of encoding. + + * Existing projects that were built using Axis and for which the return on investment + of rewriting them using a modern Web service framework would be too low. + + [] + +===================== + + Apache Axis, Axis, Apache, the Apache feather logo, and the Apache Axis project logo are + trademarks of The Apache Software Foundation. \ No newline at end of file diff --git a/src/site/resources/images/AfterTurnOff.jpg b/src/site/resources/images/AfterTurnOff.jpg new file mode 100644 index 0000000000..0a2dbc311a Binary files /dev/null and b/src/site/resources/images/AfterTurnOff.jpg differ diff --git a/src/site/resources/images/AfterTurnOn.jpg b/src/site/resources/images/AfterTurnOn.jpg new file mode 100644 index 0000000000..7604743efb Binary files /dev/null and b/src/site/resources/images/AfterTurnOn.jpg differ diff --git a/src/site/resources/images/ConnectionRefused.jpg b/src/site/resources/images/ConnectionRefused.jpg new file mode 100644 index 0000000000..2392a37620 Binary files /dev/null and b/src/site/resources/images/ConnectionRefused.jpg differ diff --git a/src/site/resources/images/DataLoading.jpg b/src/site/resources/images/DataLoading.jpg new file mode 100644 index 0000000000..34bb6d98be Binary files /dev/null and b/src/site/resources/images/DataLoading.jpg differ diff --git a/src/site/resources/images/DeployStatus.jpg b/src/site/resources/images/DeployStatus.jpg new file mode 100644 index 0000000000..066782e6ce Binary files /dev/null and b/src/site/resources/images/DeployStatus.jpg differ diff --git a/src/site/resources/images/InitialScreen.jpg b/src/site/resources/images/InitialScreen.jpg new file mode 100644 index 0000000000..f9507fcf40 Binary files /dev/null and b/src/site/resources/images/InitialScreen.jpg differ diff --git a/src/site/resources/images/LoginDialog.jpg b/src/site/resources/images/LoginDialog.jpg new file mode 100644 index 0000000000..9f4c2109b8 Binary files /dev/null and b/src/site/resources/images/LoginDialog.jpg differ diff --git a/src/site/resources/images/MonitoringScreen.jpg b/src/site/resources/images/MonitoringScreen.jpg new file mode 100644 index 0000000000..ba52f69664 Binary files /dev/null and b/src/site/resources/images/MonitoringScreen.jpg differ diff --git a/src/site/resources/images/ToDisableMonitoring.jpg b/src/site/resources/images/ToDisableMonitoring.jpg new file mode 100644 index 0000000000..63c29f0d54 Binary files /dev/null and b/src/site/resources/images/ToDisableMonitoring.jpg differ diff --git a/src/site/resources/images/ToEnableMonitoring.jpg b/src/site/resources/images/ToEnableMonitoring.jpg new file mode 100644 index 0000000000..358e49b275 Binary files /dev/null and b/src/site/resources/images/ToEnableMonitoring.jpg differ diff --git a/src/site/resources/images/Unauthorized.jpg b/src/site/resources/images/Unauthorized.jpg new file mode 100644 index 0000000000..7757f4d3a9 Binary files /dev/null and b/src/site/resources/images/Unauthorized.jpg differ diff --git a/src/site/resources/images/UnknownHost.jpg b/src/site/resources/images/UnknownHost.jpg new file mode 100644 index 0000000000..6b294e388c Binary files /dev/null and b/src/site/resources/images/UnknownHost.jpg differ diff --git a/src/site/site.xml b/src/site/site.xml index e8f9c8aa9d..00f8f6501e 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -21,13 +21,15 @@ org.apache.maven.skins maven-fluido-skin - 1.0 + 1.3.0 - true + + ws.apache.org/axis/java + @@ -47,7 +49,7 @@ - + @@ -72,12 +74,14 @@ - - - - - - + + + + + + + + diff --git a/src/site/xdoc/artifacts.xml b/src/site/xdoc/artifacts.xml new file mode 100644 index 0000000000..de3978dca7 --- /dev/null +++ b/src/site/xdoc/artifacts.xml @@ -0,0 +1,164 @@ + + + + + Artifacts and dependencies + + +
    +

    + Axis 1.4 was packaged into four JAR artifacts: axis-saaj, axis-jaxrpc, axis and axis-ant + (respectively named saaj.jar, jaxrpc.jar, axis.jar and axis-ant.jar in the + Axis 1.4 binary distribution). + In Axis 1.4.1, the axis JAR has been split into several smaller artifacts. This reduces the volume of + code that needs to be added to the dependencies of an Axis based project and makes dependency management easier (provided + that the project is built using Maven or a tool that can access Maven repositories). It also makes security auditing easier: + e.g. the axis artifact contains the code for the SOAP monitor, which may be considered as a security risk if it is not properly + disabled in production systems. +

    +

    + Nevertheless, Axis 1.4.1 also contains an all-in-one axis JAR that contains the same components + as in Axis 1.4. This can be used as a drop-in replacement for the axis.jar from earlier versions, + although it is strongly recommended to use the new modularized artifacts. + The table below shows the relationships between the new modularized artifacts and the all-in-one JAR in Axis 1.4.1, + and the artifacts included in Axis 1.4. + Note that new components introduced in Axis 1.4.1 are not included in the all-in-one JAR. +

    +

    + To see the dependencies of an artifact, click on the artifact's name. +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Axis 1.4Axis 1.4.1
    All-in-oneModularized
    SAAJ APIaxis-saaj
    JAX-RPC APIaxis-jaxrpc
    Runtime Coreaxisaxis-rt-core
    Castor Databindingaxis-rt-databinding-castor
    XmlBeans Databindingaxis-rt-databinding-xmlbeans
    JWS Supportaxis-rt-jws
    JMX Supportaxis-rt-management
    BSF Provideraxis-rt-provider-bsf
    JMS Transportaxis-rt-transport-jms
    HttpClient 3 Transportaxis-rt-transport-http-hc3
    Mail Transportaxis-rt-transport-mail
    EMF Modelsaxis-model
    Code Generatoraxis-codegen
    Command Line Toolsaxis-tools
    SOAP Monitor Handler/Serviceaxis-rt-soapmonitor
    SOAP Monitor Clientsoapmonitor-client
    TCP Monitortcpmon
    Compatibility Classesaxis-rt-compat
    Ant Tasksaxis-ant
    SOAP Monitor AppletN/A (not included in any JAR)soapmonitor-applet
    Stand-alone ServerN/A (added in Axis 1.4.1)axis-standalone-server
    java.net HTTP Transportaxis-rt-transport-http-javanet
    +

    + All artifacts and dependencies are available from the Maven Central Repository. +

    +
    + +
    diff --git a/src/site/xdoc/overview.xml.vm b/src/site/xdoc/overview.xml.vm index d6d6f53024..a36c1bc5bd 100644 --- a/src/site/xdoc/overview.xml.vm +++ b/src/site/xdoc/overview.xml.vm @@ -46,7 +46,7 @@
      -
    • API Documentation
    • +
    • API Documentation
    • Building Axis - Guidelines for building Axis with/without optional components.
    • Developer's Guide - Collection of guidelines for developing code in Axis.
    • Integration Guide - Description of APIs and development direction to allow integration into an existing web application server.
    • diff --git a/src/site/xdoc/releases.xml b/src/site/xdoc/releases.xml index a8385160fb..c3d9376d47 100644 --- a/src/site/xdoc/releases.xml +++ b/src/site/xdoc/releases.xml @@ -34,7 +34,7 @@ Description - 1.4 + 1.4 April 22, 2006 Final Version 1.4 diff --git a/src/site/xdoc/soapmonitor-user-guide.xml b/src/site/xdoc/soapmonitor-user-guide.xml new file mode 100644 index 0000000000..88c1689471 --- /dev/null +++ b/src/site/xdoc/soapmonitor-user-guide.xml @@ -0,0 +1,207 @@ + + + + + SOAPMonitor User's Guide + + + +
      + + + +
      + +
      + +

      Web service developers often have the need to see the SOAP messages being used to invoke web services along with the results of those messages. The goal of the SOAP Monitor utility is to provide a way for these developers to monitor the SOAP messages being used without requiring any special configuration or restarting of the server.

      + + + +

      It's a utility what can be found in the org.apache.axis.utils package. It provides the monitoring capability described above to Web service developers.

      + +
      + + +

      It's a good opportunity for using this utility that you hope to monitor the SOAP messages for debugging. You can see all SOAP messages of what you want to monitor without any additional developments, special configurations or restarting of the application server.

      +

      Please note that it doesn't display any protocol specific data such as HTTP protocol headers. If you need to do this, you should use the TCP Monitor (tcpmon). Please see the Axis User's Guide for details on tcpmon.

      + +
      + +
      + +
      + + + +
        +
      • step 1: Create an account for the administrator +

        Open and edit the "webapps/axis/WEB-INF/users.lst".
        + The default account for administrator is "admin", set a password to anything you want.

        +

        ex.) Like as follows; - i.e. "admin password".

        + user1 pass1 +user2 +user3 pass3 +admin password +
      • + +
      • step 2: Setting CLASSPATH +

        Before running this utility, you'll need to make sure that your CLASSPATH includes:

        +
          +
        • axis.jar
        • +
        • jaxrpc.jar
        • +
        • saaj.jar
        • +
        • commons-logging.jar
        • +
        • commons-discovery.jar
        • +
        • activation.jar
        • +
        • mail.jar
        • +
        • A JAXP-1.1 compliant XML parser such as Xerces or Crimson
        • +
        +
      • + +
      • That's all.
      • +
      + +
      + + + +
        +
      • step 0: Make sure you have completed the preparation phase.
      • + +
      • step 1: Start the SOAPMonitor application. +

        % java org.apache.axis.utils.SOAPMonitor [-u admin] [-w password] [-l axisURL]

        +

        or

        +

        % javaw org.apache.axis.utils.SOAPMonitor [-u admin] [-w password] [-l axisURL]

        +
      • + +
      • step 2: Login +

        Try login with the account which you specified as an administrator.

        +

        +
      • + +
      • step 3: Please wait for a while. +

        +
      • + +
      • step 4: Administration screen will be displayed +

        +
      • + +
      • step 5-a: To enable monitoring +

        Click services to enable monitoring, then push "Turn On" button.

        +

        +

        The following screen should be displayed.

        +

        +
      • + +
      • step 5-b: To disable monitoring +

        Click services to disable monitoring, then push "Turn Off" button.

        +

        +

        The following screen should be displayed.

        +

        +
      • + +
      • step 6: Save changes +

        Push "Save changes" button to save the current state.

        +

        The following screen should be displayed.

        +

        +
      • + +
      • step 7: Monitoring +

        Push "Monitoring" tab to start monitoring with the current settings.

        +

        The following screen should be displayed.

        +

        +
      • +
      + +
      + +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      ItemSOAPMonitorApplet(Old version)SOAPMonitor(This version)
      App TypeAppletSwing application
      SecurityN/A (No authentication)OK (Authentication added)
      Install & Use +
        +
      1. Compile the component, at first
      2. +
      3. Deploy the soapmonitor handler to "server-config.wsdd"
      4. +
      5. Deploy a service which to be monitored with the soapmonitor handler
      6. +
      7. Have an access to "http://localhost:8080/axis/SOAPMonitor"
      8. +
      9. Redeploy the service with no soapmonitor to disable monitoring
      10. +
      +
        +
      • More detail is here.
      • +
      • All of steps are the non-GUI based operations and these process are complicated for users
      • +
      +
      Just do "java org.apache.axis.utils.SOAPMonitor" (within the axis.jar) +
        +
      • All of steps are the GUI based operations
      • +
      +
      + +
      + + + +

      You may meet the following screens, if you have an access denied.

      + +
        +
      • In case of "Unknown host": +

        +
      • +
      • In case of "Port mismatch": +

        +
      • +
      • In case of "Authorization failure": +

        +
      • +
      + +
      + +
      + + +
      diff --git a/src/site/xdoc/user-guide.xml b/src/site/xdoc/user-guide.xml index 4ae1de9147..d99561f644 100644 --- a/src/site/xdoc/user-guide.xml +++ b/src/site/xdoc/user-guide.xml @@ -120,17 +120,16 @@

      See the Axis Installation Guide for instructions on installing Axis as a web application on your J2EE server.

      -

      Before running the examples in this guide, you'll need to make sure that your CLASSPATH includes (Note: If you build Axis from a CVS checkout, these will be in xml-axis/java/build/lib instead of axis-1_2/lib):

      +

      Before running the examples in this guide, you'll need to make sure that your CLASSPATH includes the following elements from the Axis binary distribution:

        -
      • axis-1_2/lib/axis.jar
      • -
      • axis-1_2/lib/jaxrpc.jar
      • -
      • axis-1_2/lib/saaj.jar
      • -
      • axis-1_2/lib/commons-logging.jar
      • -
      • axis-1_2/lib/commons-discovery.jar
      • -
      • axis-1_2/lib/wsdl4j.jar
      • -
      • axis-1_2/ (for the sample code)
      • -
      • A JAXP-1.1 compliant XML parser such as Xerces or Crimson. We recommend Xerces, as it is the one that the product has been tested against.
      • +
      • axis-<version>/lib/axis.jar
      • +
      • axis-<version>/lib/jaxrpc.jar
      • +
      • axis-<version>/lib/saaj.jar
      • +
      • axis-<version>/lib/commons-logging-<version>.jar
      • +
      • axis-<version>/lib/commons-discovery-<version>.jar
      • +
      • axis-<version>/lib/wsdl4j-<version>.jar
      • +
      • axis-<version>/ (for the sample code)
      diff --git a/tcpmon/pom.xml b/tcpmon/pom.xml new file mode 100644 index 0000000000..a6a9f2db57 --- /dev/null +++ b/tcpmon/pom.xml @@ -0,0 +1,44 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + tcpmon + TCP Monitor + ${baseUrl}/tcpmon + + + axis + ${baseSiteUrl}/tcpmon + + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + diff --git a/axis-rt-core/src/main/java/org/apache/axis/utils/tcpmon.java b/tcpmon/src/main/java/org/apache/axis/utils/tcpmon.java similarity index 100% rename from axis-rt-core/src/main/java/org/apache/axis/utils/tcpmon.java rename to tcpmon/src/main/java/org/apache/axis/utils/tcpmon.java diff --git a/axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon.properties b/tcpmon/src/main/resources/org/apache/axis/utils/tcpmon.properties similarity index 100% rename from axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon.properties rename to tcpmon/src/main/resources/org/apache/axis/utils/tcpmon.properties diff --git a/axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon_ja.properties b/tcpmon/src/main/resources/org/apache/axis/utils/tcpmon_ja.properties similarity index 100% rename from axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon_ja.properties rename to tcpmon/src/main/resources/org/apache/axis/utils/tcpmon_ja.properties diff --git a/axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon_ko.properties b/tcpmon/src/main/resources/org/apache/axis/utils/tcpmon_ko.properties similarity index 100% rename from axis-rt-core/src/main/resources/org/apache/axis/utils/tcpmon_ko.properties rename to tcpmon/src/main/resources/org/apache/axis/utils/tcpmon_ko.properties diff --git a/tcpmon/src/site/site.xml b/tcpmon/src/site/site.xml new file mode 100644 index 0000000000..18866594ab --- /dev/null +++ b/tcpmon/src/site/site.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/test/wsdl/groups/GroupsTestCase.java b/test/wsdl/groups/GroupsTestCase.java deleted file mode 100644 index c005e831b5..0000000000 --- a/test/wsdl/groups/GroupsTestCase.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2001-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * This tests the file generation of only the items that are referenced in WSDL - * - * @author Steve Green (steve.green@epok.net) - */ -package test.wsdl.groups; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - - -public class GroupsTestCase extends junit.framework.TestCase { - public GroupsTestCase(String name) { - super(name); - } - - /** - * List of files which should be generated. - */ - protected Set shouldExist() { - HashSet set = new HashSet(); - set.add("GroupsTestCase.java"); - set.add("SomeType.java"); - return set; - } - - /** - * List of files which may or may not be generated. - */ - protected Set shouldNotExist() { - HashSet set = new HashSet(); - set.add("SomeGroup.java"); - return set; - } - - /** - * The directory containing the files that should exist. - */ - protected String rootDir() { - return "build" + File.separator + "work" + File.separator + - "test" + File.separator + "wsdl" + File.separator + - "groups"; - } - - protected String getPrefix(String parent) { - if (parent == null || parent.length() == 0) { - return ""; - } - else { - return parent + File.separator; - } - } - - /** This method returns a array of String file paths, located within the - * supplied root directory. The string values are created relative to the - * specified parent so that the names get returned in the form of - * "file.java", "dir/file.java", "dir/dir/file.java", etc. This feature - * asslows the various file specs to include files in sub-directories as - * well as the root directory. - */ - protected String[] getPaths(File root, String parent) { - File files[] = root.listFiles(); - if (files == null) - fail("Unable to get a list of files from " + root.getPath()); - - Set filePaths = new HashSet(); - for(int i=0; i 0) { - fail("The following files should exist in " + rootDir + - ", but do not: " + shouldExist); - } - - // Test for the proper members - - Class ourClass = Class.forName("test.wsdl.groups.SomeType"); - ourClass.getDeclaredMethod("getA", null); - ourClass.getDeclaredMethod("getB", null); - ourClass.getDeclaredMethod("getZ", null); - - return; - } -} - diff --git a/test/wsdl/groups/SomeType.java b/test/wsdl/groups/SomeType.java deleted file mode 100644 index 0dea748f05..0000000000 --- a/test/wsdl/groups/SomeType.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * SomeType.java - * - * This file was auto-generated from WSDL - * by the Apache Axis 1.2RC1 Oct 20, 2004 (05:49:44 EDT) WSDL2Java emitter. - */ - -package com.epok.auth; - -public class SomeType implements java.io.Serializable { - private java.lang.String z; - private java.lang.String a; - private java.lang.String b; - - public SomeType() { - } - - public SomeType( - java.lang.String z, - java.lang.String a, - java.lang.String b) { - this.z = z; - this.a = a; - this.b = b; - } - - - /** - * Gets the z value for this SomeType. - * - * @return z - */ - public java.lang.String getZ() { - return z; - } - - - /** - * Sets the z value for this SomeType. - * - * @param z - */ - public void setZ(java.lang.String z) { - this.z = z; - } - - - /** - * Gets the a value for this SomeType. - * - * @return a - */ - public java.lang.String getA() { - return a; - } - - - /** - * Sets the a value for this SomeType. - * - * @param a - */ - public void setA(java.lang.String a) { - this.a = a; - } - - - /** - * Gets the b value for this SomeType. - * - * @return b - */ - public java.lang.String getB() { - return b; - } - - - /** - * Sets the b value for this SomeType. - * - * @param b - */ - public void setB(java.lang.String b) { - this.b = b; - } - - private java.lang.Object __equalsCalc = null; - public synchronized boolean equals(java.lang.Object obj) { - if (!(obj instanceof SomeType)) return false; - SomeType other = (SomeType) obj; - if (obj == null) return false; - if (this == obj) return true; - if (__equalsCalc != null) { - return (__equalsCalc == obj); - } - __equalsCalc = obj; - boolean _equals; - _equals = true && - ((this.z==null && other.getZ()==null) || - (this.z!=null && - this.z.equals(other.getZ()))) && - ((this.a==null && other.getA()==null) || - (this.a!=null && - this.a.equals(other.getA()))) && - ((this.b==null && other.getB()==null) || - (this.b!=null && - this.b.equals(other.getB()))); - __equalsCalc = null; - return _equals; - } - - private boolean __hashCodeCalc = false; - public synchronized int hashCode() { - if (__hashCodeCalc) { - return 0; - } - __hashCodeCalc = true; - int _hashCode = 1; - if (getZ() != null) { - _hashCode += getZ().hashCode(); - } - if (getA() != null) { - _hashCode += getA().hashCode(); - } - if (getB() != null) { - _hashCode += getB().hashCode(); - } - __hashCodeCalc = false; - return _hashCode; - } - - // Type metadata - private static org.apache.axis.description.TypeDesc typeDesc = - new org.apache.axis.description.TypeDesc(SomeType.class, true); - - static { - typeDesc.setXmlType(new javax.xml.namespace.QName("urn:auth:epok:com", "SomeType")); - org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("z"); - elemField.setXmlName(new javax.xml.namespace.QName("", "z")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("a"); - elemField.setXmlName(new javax.xml.namespace.QName("", "a")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(elemField); - elemField = new org.apache.axis.description.ElementDesc(); - elemField.setFieldName("b"); - elemField.setXmlName(new javax.xml.namespace.QName("", "b")); - elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); - typeDesc.addFieldDesc(elemField); - } - - /** - * Return type metadata object - */ - public static org.apache.axis.description.TypeDesc getTypeDesc() { - return typeDesc; - } - - /** - * Get Custom Serializer - */ - public static org.apache.axis.encoding.Serializer getSerializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanSerializer( - _javaType, _xmlType, typeDesc); - } - - /** - * Get Custom Deserializer - */ - public static org.apache.axis.encoding.Deserializer getDeserializer( - java.lang.String mechType, - java.lang.Class _javaType, - javax.xml.namespace.QName _xmlType) { - return - new org.apache.axis.encoding.ser.BeanDeserializer( - _javaType, _xmlType, typeDesc); - } - -} diff --git a/test/wsdl/groups/build.xml b/test/wsdl/groups/build.xml deleted file mode 100644 index f8416d2ff9..0000000000 --- a/test/wsdl/groups/build.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - -]> - - - - - - - - &properties; - &paths; - &taskdefs; - &taskdefs_post_compile; - &targets; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/wsdl/multithread/MultithreadTestCase.java b/test/wsdl/multithread/MultithreadTestCase.java deleted file mode 100644 index f4a2aa753f..0000000000 --- a/test/wsdl/multithread/MultithreadTestCase.java +++ /dev/null @@ -1,144 +0,0 @@ -package test.wsdl.multithread; - -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; -import org.apache.axis.AxisFault; -import org.apache.axis.components.logger.LogFactory; -import org.apache.commons.logging.Log; -import samples.addr.Address; -import samples.addr.AddressBook; -import samples.addr.AddressBookSOAPBindingStub; -import samples.addr.AddressBookServiceLocator; -import samples.addr.Phone; -import samples.addr.StateType; - -import javax.xml.rpc.ServiceException; -import java.net.ConnectException; - -/** -* This test calls the stub multiple times from multiple threads. Before the -* stub was made threadsafe, there was a good chance this test would fail with an -* IllegalStateException or "javax.xml.rpc.ServiceException: Number of parameters -* passed in (2) doesn't match the number of IN/INOUT parameters (4) from the -* addParameter() calls" or something else just as cryptic. -*/ - -public class MultithreadTestCase extends TestCase { - private static Log log = - LogFactory.getLog(MultithreadTestCase.class.getName()); - - private AddressBook binding; - private static int successCount = 0; - - static synchronized void addSuccess() - { - successCount++; - } - - public MultithreadTestCase(String name) { - super(name); - } - - private String printAddress (Address ad) { - String out; - if (ad == null) - out = "\t[ADDRESS NOT FOUND!]"; - else - out ="\t" + ad.getStreetNum () + " " + ad.getStreetName () + "\n\t" + ad.getCity () + ", " + ad.getState () + " " + ad.getZip () + "\n\t" + printPhone (ad.getPhoneNumber ()); - return out; - } // printAddress - - private String printPhone (Phone ph) - { - String out; - if (ph == null) - out = "[PHONE NUMBER NOT FOUND!]"; - else - out ="Phone: (" + ph.getAreaCode () + ") " + ph.getExchange () + "-" + ph.getNumber (); - return out; - } // printPhone - - private AssertionFailedError error = null; - - private synchronized void setError(AssertionFailedError error) { - if (this.error == null) { - this.error = error; - } - } // setError - - private static int var = 0; - - public class Run implements Runnable { - public void run() { - try { - for (int i = 0; i < 4; ++i) { - Address address = new Address(); - Phone phone = new Phone(); - address.setStreetNum(var++); - address.setStreetName("2"); - address.setCity("3"); - address.setState(StateType.TX); - address.setZip(var++); - phone.setAreaCode(11); - phone.setExchange("22"); - phone.setNumber("33"); - address.setPhoneNumber(phone); - - binding.addEntry("hi", address); - Address addressRet = binding.getAddressFromName("hi"); - // succeeded, count it. - addSuccess(); - } - } catch (Throwable t) { - // There are bound to be connection refused exceptions when the - // server socket is busy) in a multithreaded environment. I - // don't want to deal with those. Only grab exceptions that are - // likely to have something to do with bad AXIS runtime. - if (!(t instanceof AxisFault && - ((AxisFault) t).detail instanceof ConnectException)) { - - // Log a stack trace as we may not be so lucky next time! - log.fatal("Throwable caught: ", t); - - setError(new AssertionFailedError("Throwable caught: " + t)); - } - } - } // run - } // class Run - - public void testMultithreading() { - try { - binding = new AddressBookServiceLocator().getAddressBook(); - } - catch (ServiceException jre) { - throw new AssertionFailedError("ServiceException caught: " + jre); - } - assertTrue("binding is null", binding != null); - ((AddressBookSOAPBindingStub) binding).setMaintainSession(true); - int NUM_THREADS = 50; - Thread[] threads = new Thread[NUM_THREADS]; - for (int i = 0; i < NUM_THREADS; ++i) { - threads[i] = new Thread(new Run()); - threads[i].start(); - } - for (int i = 0; i < NUM_THREADS; ++i) { - try { - threads[i].join(); - } - catch (InterruptedException ie) { - } - } - System.out.println("Had " + successCount + - " successes (of a possible " + - (NUM_THREADS * 4) + ")"); - if (error != null) { - throw error; - } - } // testMultithreading - - public static void main(String[] args) { - MultithreadTestCase testCase = new MultithreadTestCase("MultithreadTestCase"); - testCase.testMultithreading(); - } -} // class MultithreadTestCase - diff --git a/test/wsdl/multithread/build.xml b/test/wsdl/multithread/build.xml deleted file mode 100644 index 7ec8667abd..0000000000 --- a/test/wsdl/multithread/build.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -]> - - - - - - - - - - &properties; - &paths; - &taskdefs; - &taskdefs_post_compile; - &targets; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/wsdl/terra/build.xml b/test/wsdl/terra/build.xml deleted file mode 100644 index 2a51fa35f9..0000000000 --- a/test/wsdl/terra/build.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - -]> - - - - - - - - &properties; - &paths; - &taskdefs; - &taskdefs_post_compile; - &targets; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/wsdl/types/build.xml b/test/wsdl/types/build.xml deleted file mode 100644 index 37d3d24e7f..0000000000 --- a/test/wsdl/types/build.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - -]> - - - - - - - - &properties; - &paths; - &taskdefs; - &taskdefs_post_compile; - &targets; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/wsdl/webref/build.xml b/test/wsdl/webref/build.xml deleted file mode 100644 index 9d03c9e909..0000000000 --- a/test/wsdl/webref/build.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - -]> - - - - - - - - &properties; - &paths; - &taskdefs; - &taskdefs_post_compile; - &targets; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/interop/pom.xml b/tests/interop-tests/pom.xml similarity index 82% rename from interop/pom.xml rename to tests/interop-tests/pom.xml index 01f1b28f01..f007484eb3 100644 --- a/interop/pom.xml +++ b/tests/interop-tests/pom.xml @@ -21,11 +21,11 @@ 4.0.0 org.apache.axis - axis-project + tests 1.4.1-SNAPSHOT ../pom.xml - interop + interop-tests Interoperability tests @@ -58,7 +58,7 @@ ${project.groupId} - maven-wsdl2java-plugin + wsdl2java-maven-plugin ${project.version} @@ -67,7 +67,7 @@ generate-test-sources - ../interop-mock/src/main/resources/wsdl/soap12-add-test.wsdl + ../../interop-mock/src/main/resources/wsdl/soap12-add-test.wsdl both @@ -87,7 +87,7 @@ generate-test-sources - ../interop-mock/src/main/resources/wsdl/soap12-test.wsdl + ../../interop-mock/src/main/resources/wsdl/soap12-test.wsdl both @@ -101,6 +101,23 @@ + + terra + + generate-test-sources + + + ../../interop-mock/src/main/resources/wsdl/TerraService.wsdl + client + true + + + http://msrmaps.com/ + test.wsdl.terra + + + + @@ -134,17 +151,23 @@ - maven-dependency-plugin + com.github.veithen.alta + alta-maven-plugin pre-integration-test - copy-dependencies + generate-properties - ${project.build.directory} - war - true + %artifactId%.location + %file% + + test + + *:*:war:* + + @@ -153,7 +176,7 @@ org.mortbay.jetty jetty-maven-plugin - ${project.build.directory}/interop-mock.war + ${interop-mock.location} foo ${jetty.stopPort} @@ -202,19 +225,6 @@ - - maven-deploy-plugin - - true - - - - maven-site-plugin - - true - true - - diff --git a/interop/src/test/java/test/wsdl/soap12/additional/Soap12AddTestDocBindingImpl.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/additional/Soap12AddTestDocBindingImpl.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/additional/Soap12AddTestDocBindingImpl.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/additional/Soap12AddTestDocBindingImpl.java diff --git a/interop/src/test/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/additional/Soap12AddTestRpcBindingImpl.java diff --git a/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java diff --git a/interop/src/test/java/test/wsdl/soap12/assertion/Soap12TestDocBindingImpl.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/Soap12TestDocBindingImpl.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/assertion/Soap12TestDocBindingImpl.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/Soap12TestDocBindingImpl.java diff --git a/interop/src/test/java/test/wsdl/soap12/assertion/Soap12TestRpcBindingImpl.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/Soap12TestRpcBindingImpl.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/assertion/Soap12TestRpcBindingImpl.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/Soap12TestRpcBindingImpl.java diff --git a/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java b/tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java similarity index 100% rename from interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java rename to tests/interop-tests/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java diff --git a/test/wsdl/terra/TerraServiceTestCase.java b/tests/interop-tests/src/test/java/test/wsdl/terra/TerraServiceTestCase.java similarity index 78% rename from test/wsdl/terra/TerraServiceTestCase.java rename to tests/interop-tests/src/test/java/test/wsdl/terra/TerraServiceTestCase.java index b01cd36c6f..4df37f66fa 100644 --- a/test/wsdl/terra/TerraServiceTestCase.java +++ b/tests/interop-tests/src/test/java/test/wsdl/terra/TerraServiceTestCase.java @@ -7,19 +7,17 @@ package test.wsdl.terra; -import org.apache.axis.AxisFault; - -import java.net.ConnectException; +import java.net.URL; public class TerraServiceTestCase extends junit.framework.TestCase { public TerraServiceTestCase(java.lang.String name) { super(name); } - public void test11TerraServiceSoapGetPlaceList() { + public void test11TerraServiceSoapGetPlaceList() throws Exception { TerraServiceSoap binding; try { - binding = new TerraServiceLocator().getTerraServiceSoap(); + binding = new TerraServiceLocator().getTerraServiceSoap(new URL("http://localhost:" + System.getProperty("mock.httpPort", "9080") + "/terraservice")); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); @@ -43,14 +41,6 @@ public void test11TerraServiceSoapGetPlaceList() { } } catch (java.rmi.RemoteException re) { - if (re instanceof AxisFault) { - AxisFault fault = (AxisFault) re; - if (fault.detail instanceof ConnectException || - fault.getFaultCode().getLocalPart().equals("HTTP")) { - System.err.println("TerraService HTTP error: " + fault); - return; - } - } throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } diff --git a/tests/pom.xml b/tests/pom.xml new file mode 100644 index 0000000000..dd6769dbcd --- /dev/null +++ b/tests/pom.xml @@ -0,0 +1,79 @@ + + + + 4.0.0 + + org.apache.axis + axis-project + 1.4.1-SNAPSHOT + ../pom.xml + + tests + Tests + pom + + Root POM for the Axis (integration) tests. + + + interop-tests + spring-compat-tests + + + + + maven-deploy-plugin + + true + + + + maven-site-plugin + + true + true + + + + + + + apache-release + + + + + maven-javadoc-plugin + + + attach-javadocs + + jar + + + true + + + + + + + + + diff --git a/tests/spring-compat-tests/pom.xml b/tests/spring-compat-tests/pom.xml new file mode 100644 index 0000000000..3fee5e4b0e --- /dev/null +++ b/tests/spring-compat-tests/pom.xml @@ -0,0 +1,159 @@ + + + + 4.0.0 + + org.apache.axis + tests + 1.4.1-SNAPSHOT + ../pom.xml + + spring-compat-tests + Spring Compatibility Tests + + Contains a set of tests that check that Axis remains compatible with Spring (remoting). + + + 1.5 + + + + ${project.groupId} + axis-rt-core + ${project.version} + + + org.springframework + spring-remoting + 2.0.8 + + + junit + junit + test + + + + + + ${project.groupId} + wsdl2java-maven-plugin + ${project.version} + + + + generate-sources + + + src/main/wsdl/OrderService.wsdl + both + application + org.apache.axis.test.spring.OrderEndpoint + true + ${project.build.directory}/wsdd/OrderService.wsdd + + + + + + ${project.groupId} + wsdd-maven-plugin + ${project.version} + + + package + + generate-wsdd + + + server + + ${project.build.directory}/wsdd/OrderService.wsdd + + ${project.build.directory}/webapp/WEB-INF/server-config.wsdd + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + pre-integration-test + + + test.httpPort + + + + + + + ${project.groupId} + axis-server-maven-plugin + ${project.version} + + + start-webapp + + start-webapp + + + ${test.httpPort} + 8080 + + src/main/webapp + ${project.build.directory}/webapp + + ${argLine} -Daxis.attachments.Directory=${project.build.directory}/tmp/attachments + + + + stop-all + + stop-all + + + + + + maven-failsafe-plugin + + + + integration-test + verify + + + + ${test.httpPort} + + + + + + + + diff --git a/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderEndpoint.java b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderEndpoint.java new file mode 100644 index 0000000000..29d2cfd7c3 --- /dev/null +++ b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderEndpoint.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.test.spring; + +import java.rmi.RemoteException; + +import org.springframework.remoting.jaxrpc.ServletEndpointSupport; + +public class OrderEndpoint extends ServletEndpointSupport implements OrderManagerPortType { + private OrderManager orderManager; + + protected void onInit() { + orderManager = (OrderManager)getWebApplicationContext().getBean("orderManager"); + } + + public String submitOrder(Order order) throws RemoteException { + return orderManager.submitOrder(order); + } + + public Order getOrder(String orderID) throws RemoteException { + return orderManager.getOrder(orderID); + } +} diff --git a/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManager.java b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManager.java new file mode 100644 index 0000000000..f4350002ff --- /dev/null +++ b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManager.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.test.spring; + +public interface OrderManager { + String submitOrder(Order order); + Order getOrder(String orderID); +} diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManagerBean.java similarity index 57% rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java rename to tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManagerBean.java index 51b08ce7bd..bb161d3452 100644 --- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java +++ b/tests/spring-compat-tests/src/main/java/org/apache/axis/test/spring/OrderManagerBean.java @@ -16,25 +16,24 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.axis.tools.maven.server; +package org.apache.axis.test.spring; -import java.io.File; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; -import org.apache.axis.client.AdminClient; -import org.codehaus.plexus.logging.Logger; - -public class AxisServerStopAction implements ProcessStopAction { - private final AdminClient adminClient; - private final File[] undeployments; - - public AxisServerStopAction(AdminClient adminClient, File[] undeployments) { - this.adminClient = adminClient; - this.undeployments = undeployments; +public class OrderManagerBean implements OrderManager { + private final AtomicInteger orderIDSeq = new AtomicInteger(10000); + private final Map orders = Collections.synchronizedMap(new HashMap()); + + public String submitOrder(Order order) { + String orderID = String.valueOf(orderIDSeq.incrementAndGet()); + orders.put(orderID, order); + return orderID; } - public int execute(Logger logger) throws Exception { - AdminClientUtils.process(logger, adminClient, undeployments); - adminClient.quit(); - return STOPPING; + public Order getOrder(String orderID) { + return (Order)orders.get(orderID); } } diff --git a/tests/spring-compat-tests/src/main/webapp/WEB-INF/applicationContext.xml b/tests/spring-compat-tests/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 0000000000..f356d0a1de --- /dev/null +++ b/tests/spring-compat-tests/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/tests/spring-compat-tests/src/main/webapp/WEB-INF/web.xml b/tests/spring-compat-tests/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..44d4caea5a --- /dev/null +++ b/tests/spring-compat-tests/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,34 @@ + + + + + org.springframework.web.context.ContextLoaderListener + + + axis + org.apache.axis.transport.http.AxisServlet + 1 + + + axis + /axis/* + + diff --git a/tests/spring-compat-tests/src/main/wsdl/OrderService.wsdl b/tests/spring-compat-tests/src/main/wsdl/OrderService.wsdl new file mode 100644 index 0000000000..85e2bd536c --- /dev/null +++ b/tests/spring-compat-tests/src/main/wsdl/OrderService.wsdl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/spring-compat-tests/src/test/java/org/apache/axis/test/spring/RemotingITCase.java b/tests/spring-compat-tests/src/test/java/org/apache/axis/test/spring/RemotingITCase.java new file mode 100644 index 0000000000..fb3840868a --- /dev/null +++ b/tests/spring-compat-tests/src/test/java/org/apache/axis/test/spring/RemotingITCase.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis.test.spring; + +import junit.framework.TestCase; + +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class RemotingITCase extends TestCase { + public void test() { + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("context.xml"); + OrderManager orderManager = (OrderManager)context.getBean("orderManager"); + String orderID = orderManager.submitOrder(new Order("1234", new OrderItem[] { new OrderItem("2345", 2) })); + System.out.println(orderManager.getOrder(orderID)); + context.close(); + } +} diff --git a/tests/spring-compat-tests/src/test/resources/context.properties b/tests/spring-compat-tests/src/test/resources/context.properties new file mode 100644 index 0000000000..9be03fdde0 --- /dev/null +++ b/tests/spring-compat-tests/src/test/resources/context.properties @@ -0,0 +1 @@ +test.httpPort=8080 diff --git a/tests/spring-compat-tests/src/test/resources/context.xml b/tests/spring-compat-tests/src/test/resources/context.xml new file mode 100644 index 0000000000..87d0a0da6a --- /dev/null +++ b/tests/spring-compat-tests/src/test/resources/context.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file