You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wo...@apache.org on 2008/03/03 19:48:24 UTC
svn commit: r633234 [19/24] - in /webservices/axis2/trunk/java: ./
modules/jaxws-integration/ modules/jaxws-integration/test/
modules/jaxws-integration/test/client/ modules/jaxws-integration/test/org/
modules/jaxws-integration/test/org/apache/ modules/...
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/BaseFault_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/BaseFault_Exception.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/BaseFault_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/BaseFault_Exception.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,73 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+import org.test.polymorphicfaults.BaseFault;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "BaseFault", targetNamespace = "http://org/test/polymorphicfaults")
+public class BaseFault_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private BaseFault faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public BaseFault_Exception(String message, BaseFault faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public BaseFault_Exception(String message, BaseFault faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.test.polymorphicfaults.BaseFault
+ */
+ public BaseFault getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/ComplexFault_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/ComplexFault_Exception.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/ComplexFault_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/ComplexFault_Exception.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,73 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+import org.test.polymorphicfaults.ComplexFault;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "ComplexFault", targetNamespace = "http://org/test/polymorphicfaults")
+public class ComplexFault_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private ComplexFault faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public ComplexFault_Exception(String message, ComplexFault faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public ComplexFault_Exception(String message, ComplexFault faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.test.polymorphicfaults.ComplexFault
+ */
+ public ComplexFault getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,73 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+import org.test.polymorphicfaults.DerivedFault1;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "DerivedFault1", targetNamespace = "http://org/test/polymorphicfaults")
+public class DerivedFault1_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private DerivedFault1 faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public DerivedFault1_Exception(String message, DerivedFault1 faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public DerivedFault1_Exception(String message, DerivedFault1 faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.test.polymorphicfaults.DerivedFault1
+ */
+ public DerivedFault1 getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,73 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+import org.test.polymorphicfaults.DerivedFault2;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "DerivedFault2", targetNamespace = "http://org/test/polymorphicfaults")
+public class DerivedFault2_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private DerivedFault2 faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public DerivedFault2_Exception(String message, DerivedFault2 faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public DerivedFault2_Exception(String message, DerivedFault2 faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.test.polymorphicfaults.DerivedFault2
+ */
+ public DerivedFault2 getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,73 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+import org.test.polymorphicfaults.DerivedFault1;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "DerivedFault1", targetNamespace = "http://org/test/polymorphicfaults")
+public class EqualFault
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private DerivedFault1 faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public EqualFault(String message, DerivedFault1 faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public EqualFault(String message, DerivedFault1 faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: org.test.polymorphicfaults.DerivedFault1
+ */
+ public DerivedFault1 getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,79 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "FaultsService", targetNamespace = "http://org/test/polymorphicfaults", wsdlLocation = "FaultsService.wsdl")
+public class FaultsService
+ extends Service
+{
+
+ private final static URL FAULTSSERVICE_WSDL_LOCATION;
+ private static String wsdlLocation="/test/org/apache/axis2/jaxws/sample/faultsservice/META-INF/FaultsService.wsdl";
+ static {
+ URL url = null;
+ try {
+ try{
+ String baseDir = new File(System.getProperty("basedir",".")).getCanonicalPath();
+ wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath();
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ File file = new File(wsdlLocation);
+ url = file.toURL();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ FAULTSSERVICE_WSDL_LOCATION = url;
+ }
+
+ public FaultsService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public FaultsService() {
+ super(FAULTSSERVICE_WSDL_LOCATION, new QName("http://org/test/polymorphicfaults", "FaultsService"));
+ }
+
+ /**
+ *
+ * @return
+ * returns FaultsServicePortType
+ */
+ @WebEndpoint(name = "FaultsPort")
+ public FaultsServicePortType getFaultsPort() {
+ return (FaultsServicePortType)super.getPort(new QName("http://org/test/polymorphicfaults", "FaultsPort"), FaultsServicePortType.class);
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,112 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+import org.test.polymorphicfaults.DerivedFault1;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "FaultsServicePortType", targetNamespace = "http://org/test/polymorphicfaults")
+public interface FaultsServicePortType {
+
+
+ /**
+ *
+ * @param symbol
+ * @return
+ * returns float
+ * @throws InvalidTickerFault_Exception
+ * @throws DerivedFault2_Exception
+ * @throws BaseFault_Exception
+ * @throws DerivedFault1_Exception
+ * @throws SimpleFault
+ */
+ @WebMethod
+ @WebResult(name = "result", targetNamespace = "")
+ @RequestWrapper(localName = "getQuote", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.GetQuote")
+ @ResponseWrapper(localName = "getQuoteResult", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.GetQuoteResult")
+ public float getQuote(
+ @WebParam(name = "symbol", targetNamespace = "")
+ String symbol)
+ throws BaseFault_Exception, DerivedFault1_Exception, DerivedFault2_Exception, InvalidTickerFault_Exception, SimpleFault
+ ;
+
+ /**
+ *
+ * @param paramC
+ * @param paramB
+ * @param paramA
+ * @return
+ * returns int
+ * @throws BaseFault_Exception
+ * @throws ComplexFault_Exception
+ */
+ @WebMethod
+ @WebResult(targetNamespace = "")
+ @RequestWrapper(localName = "throwFault", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.ThrowFault")
+ @ResponseWrapper(localName = "throwFaultReturn", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.ThrowFaultReturn")
+ public int throwFault(
+ @WebParam(name = "paramA", targetNamespace = "")
+ int paramA,
+ @WebParam(name = "paramB", targetNamespace = "")
+ String paramB,
+ @WebParam(name = "paramC", targetNamespace = "")
+ float paramC)
+ throws BaseFault_Exception, ComplexFault_Exception
+ ;
+
+ /**
+ *
+ * @param paramZ
+ * @param paramY
+ * @param paramX
+ * @param fault
+ * @throws DerivedFault1_Exception
+ * @throws EqualFault
+ */
+ @WebMethod
+ @RequestWrapper(localName = "returnFault", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.ReturnFault")
+ @ResponseWrapper(localName = "returnFaultResponse", targetNamespace = "http://org/test/polymorphicfaults", className = "org.test.polymorphicfaults.ReturnFaultResponse")
+ public void returnFault(
+ @WebParam(name = "paramX", targetNamespace = "")
+ int paramX,
+ @WebParam(name = "paramY", targetNamespace = "")
+ String paramY,
+ @WebParam(name = "paramZ", targetNamespace = "")
+ float paramZ,
+ @WebParam(name = "fault", targetNamespace = "", mode = Mode.INOUT)
+ Holder<DerivedFault1> fault)
+ throws DerivedFault1_Exception, EqualFault
+ ;
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,214 @@
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
+import org.apache.axis2.saaj.SOAPEnvelopeImpl;
+import org.apache.axis2.jaxws.TestLogger;
+import org.test.polymorphicfaults.BaseFault;
+import org.test.polymorphicfaults.ComplexFault;
+import org.test.polymorphicfaults.DerivedFault1;
+import org.test.polymorphicfaults.DerivedFault2;
+
+/**
+ * This class provides server side implementation for the
+ * FaultsServicePortType.
+ */
+
+@WebService (targetNamespace="http://org/test/polymorphicfaults",
+ serviceName="FaultsService",
+ portName="FaultsPort",
+ //wsdlLocation="WEB-INF/wsdl/FaultsService.wsdl",
+ endpointInterface="org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType")
+
+public class FaultsServiceSoapBindingImpl implements FaultsServicePortType {
+
+ private WebServiceContext ctx = null;
+ private boolean init = false;
+
+ /**
+ * Throws wrapper exceptions for fault beans
+ */
+ public float getQuote(String tickerSymbol) throws
+ BaseFault_Exception, DerivedFault1_Exception,
+ DerivedFault2_Exception, InvalidTickerFault_Exception, SimpleFault {
+ TestLogger.logger.debug("\nIn getQuote(): " + tickerSymbol + "\n");
+ if (tickerSymbol.equals("SMPL")) {
+ throw new SimpleFault("Server throws SimpleFault", 100);
+ } else if (tickerSymbol.equals("LEGC")) {
+ throw new InvalidTickerFault_Exception("Server throws InvalidTickerFault_Exception", tickerSymbol, 123);
+ } else if (tickerSymbol.equals("DF1")) {
+ DerivedFault1 df = new DerivedFault1();
+ df.setA(100);
+ df.setB(tickerSymbol);
+ throw new DerivedFault1_Exception("Server throws DerivedFault1_Exception", df);
+ } else if (tickerSymbol.equals("DF2")) {
+ DerivedFault2 df = new DerivedFault2();
+ df.setA(200);
+ df.setB(tickerSymbol);
+ df.setC(80.0F);
+ throw new DerivedFault2_Exception("Server throws DerivedFault2_Exception", df);
+ } else if (tickerSymbol.equals("BASE")) {
+ BaseFault bf = new BaseFault();
+ bf.setA(400);
+ throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
+ } else if (tickerSymbol.equals("INJECTION")) {
+ if (ctx != null && init) {
+ // Only return this value if the context is injected and
+ // the initialization method is invoked
+ return 1234567;
+ }
+ }
+ return 100;
+ }
+
+
+ /**
+ * Throws wrapper exceptions for derived fault beans
+ */
+ public int throwFault(int a, String b, float c) throws
+ BaseFault_Exception, ComplexFault_Exception {
+ if(b.equals("Complex")) {
+ ComplexFault cf = new ComplexFault();
+ cf.setA(a);
+ cf.setB(b);
+ cf.setC(c);
+ cf.setD(5);
+ throw new ComplexFault_Exception("Server throws ComplexFault_Exception", cf);
+ } else if (b.equals("BaseFault")) {
+ BaseFault bf = new BaseFault();
+ bf.setA(a);
+ throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
+ } else if (b.equals("DerivedFault1")) {
+ DerivedFault1 df = new DerivedFault1();
+ df.setA(a);
+ df.setB(b);
+ throw new BaseFault_Exception("Server throws BaseFault_Exception", df);
+ } else if (b.equals("DerivedFault2")) {
+ DerivedFault2 df = new DerivedFault2();
+ df.setA(a);
+ df.setB(b);
+ df.setC(c);
+ throw new BaseFault_Exception("Server throws BaseFault_Exception", df);
+ } else if (b.equals("SOAPFaultException")) {
+ try {
+ SOAPFault soapFault = createSOAPFault();
+ soapFault.setFaultString("hello world");
+ soapFault.setFaultActor("actor");
+ throw new SOAPFaultException(soapFault);
+ } catch (SOAPException se) {}
+ } else if (b.equals("SOAPFaultException2")) {
+ try {
+ SOAPFault soapFault = createSOAPFault();
+ soapFault.setFaultString("hello world2");
+ soapFault.setFaultActor("actor2");
+ Detail detail = soapFault.addDetail();
+ DetailEntry de = detail.addDetailEntry(new QName("urn://sample", "detailEntry"));
+ de.setValue("Texas");
+ throw new SOAPFaultException(soapFault);
+ } catch (SOAPException se) {}
+ } else if (b.equals("NPE")) {
+ throw new NullPointerException();
+ } else if (b.equals("NPE2")) {
+ // Throw NPE with a message
+ throw new NullPointerException("Null Pointer Exception occurred");
+ } else if (b.equals("WSE")) {
+ WebServiceException wsf = new WebServiceException("This is a WebServiceException");
+ throw wsf;
+ }
+ return 0;
+ }
+
+ /**
+ * Returns a fault bean or throws a wrapper exception
+ */
+ public void returnFault(int a, String b, float c,
+ Holder<DerivedFault1> fault) throws EqualFault {
+
+ DerivedFault2 newFault = new DerivedFault2();
+ newFault.setA(fault.value.getA());
+ newFault.setB(fault.value.getB());
+ newFault.setC(c);
+
+ if(fault.value.getB().equals("fault")) {
+ fault.value = newFault;
+ return;
+ } else if (fault.value.getB().equals("exception")) {
+ throw new EqualFault("Server throws EqualFault", newFault);
+ }
+ DerivedFault1 df = new DerivedFault1();
+ df.setA(a + 1);
+ df.setB("Server: " + b);
+ throw new EqualFault("Server throws EqualFault", df);
+ }
+
+ SOAPFault createSOAPFault() throws SOAPException {
+ SOAPFault soapFault = null;
+
+ // REVIEW: The following does not work due to Axis2 SAAJ problems.
+ //
+ // SOAPFactory soapFactory = SOAPFactory.newInstance();
+ // SOAPFault soapFault = soapFactory.createFault();
+
+ // Alternate Approach
+ org.apache.axiom.soap.SOAPFactory asf = DOOMAbstractFactory.getSOAP11Factory();
+ org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl axiomEnv = (org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl) asf.createSOAPEnvelope();
+ javax.xml.soap.SOAPEnvelope env = new SOAPEnvelopeImpl(axiomEnv);
+ SOAPBody body = env.addBody();
+ soapFault = body.addFault();
+ return soapFault;
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ this.init = true;
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+ @Resource
+ private void setCtx(WebServiceContext ctx) {
+ // The setter is private. This should not matter because the engine
+ // should still make it accessible.
+ this.ctx = ctx;
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault_Exception.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault_Exception.java Mon Mar 3 10:47:38 2008
@@ -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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+/**
+ * This is an example of a legacy exception which may be the result of a JAX-RPC emission.
+ * The fault does not have the valid constructors and lacks a getFaultInfo method.
+ * However (in this case) the fault has a @WebFault that identifies the faultbean
+ */
+@WebFault(name = "InvalidTickerFault",
+ targetNamespace = "http://org/test/polymorphicfaults",
+ faultBean="org.test.polymorphicfaults.InvalidTickerFaultExceptionBean")
+
+ // faultBean is intentionally not specified. It should default to
+ // faultBean="org.test.polymorphicfaults.InvalidTickerFault_ExceptionBean"
+public class InvalidTickerFault_Exception
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private String legacyData1;
+ private int legacyData2;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public InvalidTickerFault_Exception(String message, String legacyData1, int legacyData2) {
+ super(message);
+ this.legacyData1 = legacyData1;
+ this.legacyData2 = legacyData2;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public InvalidTickerFault_Exception(String message, String legacyData1, int legacyData2, Throwable cause) {
+ super(message, cause);
+ this.legacyData1 = legacyData1;
+ this.legacyData2 = legacyData2;
+ }
+
+
+ public String getLegacyData1() {
+ return legacyData1;
+ }
+ public int getLegacyData2() {
+ return legacyData2;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,71 @@
+
+/*
+ * 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.axis2.jaxws.sample.faultsservice;
+
+import javax.xml.ws.WebFault;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebFault(name = "SimpleFault", targetNamespace = "http://org/test/polymorphicfaults")
+public class SimpleFault
+ extends Exception
+{
+
+ /**
+ * Java type that goes as soapenv:Fault detail element.
+ *
+ */
+ private int faultInfo;
+
+ /**
+ *
+ * @param message
+ * @param faultInfo
+ */
+ public SimpleFault(String message, int faultInfo) {
+ super(message);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @param cause
+ * @param message
+ * @param faultInfo
+ */
+ public SimpleFault(String message, int faultInfo, Throwable cause) {
+ super(message, cause);
+ this.faultInfo = faultInfo;
+ }
+
+ /**
+ *
+ * @return
+ * returns fault bean: int
+ */
+ public int getFaultInfo() {
+ return faultInfo;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSample.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSample.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSample.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSample.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,65 @@
+
+/*
+ * 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.axis2.jaxws.sample.mtom;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+import org.test.mtom.ImageDepot;
+
+@WebService(name = "MtomSample",
+ targetNamespace = "http://org/apache/axis2/jaxws/sample/mtom",
+ wsdlLocation = "META-INF/ImageDepot.wsdl")
+public interface MtomSample {
+
+
+ /**
+ *
+ * @param input
+ * @return
+ * returns org.test.mtom.ImageDepot
+ */
+ @WebMethod
+ @WebResult(name = "output", targetNamespace = "urn://mtom.test.org")
+ @RequestWrapper(localName = "sendImage", targetNamespace = "urn://mtom.test.org", className = "org.test.mtom.SendImage")
+ @ResponseWrapper(localName = "sendImageResponse", targetNamespace = "urn://mtom.test.org", className = "org.test.mtom.SendImageResponse")
+ public ImageDepot sendImage(
+ @WebParam(name = "input", targetNamespace = "urn://mtom.test.org")
+ ImageDepot input);
+
+ /**
+ *
+ * @param input
+ * @return
+ * returns org.test.mtom.ImageDepot
+ */
+ @WebMethod
+ @WebResult(name = "output", targetNamespace = "urn://mtom.test.org")
+ @RequestWrapper(localName = "sendText", targetNamespace = "urn://mtom.test.org", className = "org.test.mtom.SendText")
+ @ResponseWrapper(localName = "sendTextResponse", targetNamespace = "urn://mtom.test.org", className = "org.test.mtom.SendTextResponse")
+ public ImageDepot sendText(
+ @WebParam(name = "input", targetNamespace = "urn://mtom.test.org")
+ byte[] input);
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleProvider.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleProvider.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleProvider.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.axis2.jaxws.sample.mtom;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.xml.ws.Provider;
+
+public class MtomSampleProvider implements Provider<String> {
+
+ public String invoke(String input) {
+ TestLogger.logger.debug(">> input[" + input + "]");
+ return input;
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleService.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,69 @@
+/*
+ * 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.axis2.jaxws.sample.mtom;
+
+
+import java.awt.Image;
+import java.io.ByteArrayInputStream;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.imageio.ImageIO;
+import javax.jws.WebService;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.axis2.jaxws.provider.DataSourceImpl;
+import org.apache.axis2.jaxws.TestLogger;
+import org.test.mtom.ImageDepot;
+import org.test.mtom.ObjectFactory;
+
+@WebService(serviceName="MtomSampleService",
+ endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample")
+@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
+public class MtomSampleService implements MtomSample {
+
+ public ImageDepot sendImage(ImageDepot input) {
+ TestLogger.logger.debug("[new sendImage request received]");
+ DataHandler data = input.getImageData();
+
+ TestLogger.logger.debug("[contentType] " + data.getContentType());
+ ImageDepot output = (new ObjectFactory()).createImageDepot();
+ Image image = null;
+ try {
+ ByteArrayInputStream stream = (ByteArrayInputStream) data.getContent();
+ image = ImageIO.read(stream);
+
+ DataSource imageDS = new DataSourceImpl("image/jpeg", "test.jpg", image);
+ DataHandler handler = new DataHandler(imageDS);
+ output.setImageData(handler);
+ }
+ catch (Exception e) {
+ throw new WebServiceException(e);
+ }
+ return output;
+ }
+
+ public ImageDepot sendText(byte[] input) {
+ TestLogger.logger.debug("[new sendText request received]");
+ return null;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageInterface.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageInterface.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageInterface.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageInterface.java Mon Mar 3 10:47:38 2008
@@ -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.axis2.jaxws.sample.mtom1;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebServiceException;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "sendImageInterface",
+ targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org",
+ wsdlLocation = "META-INF/samplemtomjpeg.wsdl")
+public interface SendImageInterface {
+
+
+ /**
+ *
+ * @param input
+ * @return
+ * returns org.apache.axis2.jaxws.sample.mtom1.ImageDepot
+ */
+ @WebMethod(action = "sendImage")
+ @WebResult(name = "output", targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org")
+ @RequestWrapper(localName = "invoke", targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org", className = "org.apache.axis2.jaxws.sample.mtom1.Invoke")
+ @ResponseWrapper(localName = "sendImageResponse", targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org", className = "org.apache.axis2.jaxws.sample.mtom1.SendImageResponse")
+ public ImageDepot invoke(
+ @WebParam(name = "input", targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org")
+ ImageDepot input) throws WebServiceException;
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageService.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom1/SendImageService.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,70 @@
+
+/*
+ * 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.axis2.jaxws.sample.mtom1;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.jws.WebService;
+import java.rmi.RemoteException;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+
+
+/**
+ * A JAXB implementation
+ *
+ */
+
+@WebService(
+ targetNamespace = "urn://mtom1.sample.jaxws.axis2.apache.org",
+ serviceName = "SendImageService",
+ portName = "sendImagePort",
+ endpointInterface = "org.apache.axis2.jaxws.sample.mtom1.SendImageInterface")
+@BindingType (SOAPBinding.SOAP11HTTP_MTOM_BINDING)
+public class SendImageService implements SendImageInterface {
+
+
+ /**
+ * Required impl method from JAXB interface
+ *
+ * - No MTOM setting via @BindingType
+ * - Using PAYLOAD mode
+ * - Sending back the same obj it received
+ * - The JAXB object is for image/jpeg MIME type
+ *
+ * @param ImageDepot obj
+ * @return ImageDepot obj
+ */
+ public ImageDepot invoke(ImageDepot request) throws WebServiceException
+ {
+ TestLogger.logger.debug("--------------------------------------");
+ TestLogger.logger.debug("SendImageService");
+
+ if (request == null) {
+ throw new WebServiceException("Null input received.");
+ } else if (request.getImageData() == null) {
+ throw new WebServiceException("Image is null");
+ }
+
+ TestLogger.logger.debug("SendImageService: Request received.");
+ return request;
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/DocLitNonWrapPortTypeImpl.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,126 @@
+/*
+ * 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.axis2.jaxws.sample.nonwrap;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Response;
+
+import org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType;
+import org.test.sample.nonwrap.ObjectFactory;
+import org.test.sample.nonwrap.OneWay;
+import org.test.sample.nonwrap.OneWayVoid;
+import org.test.sample.nonwrap.ReturnType;
+import org.test.sample.nonwrap.TwoWay;
+import org.test.sample.nonwrap.TwoWayHolder;
+
+@WebService(serviceName="DocLitNonWrapService",
+ endpointInterface="org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType")
+public class DocLitNonWrapPortTypeImpl implements DocLitNonWrapPortType {
+
+ /**
+ *
+ */
+ public DocLitNonWrapPortTypeImpl() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#oneWayVoid(org.test.sample.nonwrap.OneWayVoid)
+ */
+ public void oneWayVoid(OneWayVoid allByMyself) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#oneWay(org.test.sample.nonwrap.OneWay)
+ */
+ public void oneWay(OneWay allByMyself) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayHolderAsync(org.test.sample.nonwrap.TwoWayHolder)
+ */
+ public Response<TwoWayHolder> twoWayHolderAsync(TwoWayHolder allByMyself) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayHolderAsync(org.test.sample.nonwrap.TwoWayHolder, javax.xml.ws.AsyncHandler)
+ */
+ public Future<?> twoWayHolderAsync(TwoWayHolder allByMyself,
+ AsyncHandler<TwoWayHolder> asyncHandler) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayHolder(javax.xml.ws.Holder)
+ */
+ public void twoWayHolder(Holder<TwoWayHolder> allByMyself) {
+ //TODO Auto-generated method stub
+ TwoWayHolder twh = allByMyself.value;
+ twh.setTwoWayHolderInt(10);
+ twh.setTwoWayHolderStr("Response String");
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayAsync(org.test.sample.nonwrap.TwoWay)
+ */
+ public Response<ReturnType> twoWayAsync(TwoWay allByMyself) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWayAsync(org.test.sample.nonwrap.TwoWay, javax.xml.ws.AsyncHandler)
+ */
+ public Future<?> twoWayAsync(TwoWay allByMyself,
+ AsyncHandler<ReturnType> asyncHandler) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis2.jaxws.sample.nonwrap.sei.DocLitNonWrapPortType#twoWay(org.test.sample.nonwrap.TwoWay)
+ */
+ public ReturnType twoWay(TwoWay twoWay) {
+
+ String requestString = twoWay.getTwowayStr();
+ ObjectFactory of = new ObjectFactory();
+ ReturnType rt = of.createReturnType();
+ rt.setReturnStr("Acknowledgement : Request String received = "+ requestString);
+
+ return rt;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapPortType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapPortType.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapPortType.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapPortType.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,144 @@
+
+/*
+ * 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.axis2.jaxws.sample.nonwrap.sei;
+
+import java.util.concurrent.Future;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
+import javax.xml.ws.Response;
+
+import org.test.sample.nonwrap.OneWay;
+import org.test.sample.nonwrap.OneWayVoid;
+import org.test.sample.nonwrap.ReturnType;
+import org.test.sample.nonwrap.TwoWay;
+import org.test.sample.nonwrap.TwoWayHolder;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "DocLitNonWrapPortType", targetNamespace = "http://nonwrap.sample.test.org")
+@SOAPBinding(parameterStyle = ParameterStyle.BARE)
+public interface DocLitNonWrapPortType {
+
+
+ /**
+ *
+ * @param allByMyself
+ */
+ @WebMethod(action = "http://nonwrap.sample.test.org/twoWayReturn")
+ @Oneway
+ public void oneWayVoid(
+ @WebParam(name = "oneWayVoid", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ OneWayVoid allByMyself);
+
+ /**
+ *
+ * @param allByMyself
+ */
+ @WebMethod(action = "http://nonwrap.sample.test.org/twoWayReturn")
+ @Oneway
+ public void oneWay(
+ @WebParam(name = "oneWay", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ OneWay allByMyself);
+
+ /**
+ *
+ * @param allByMyself
+ * @return
+ * returns javax.xml.ws.Response<org.test.sample.nonwrap.TwoWayHolder>
+ */
+ @WebMethod(operationName = "twoWayHolder", action = "http://nonwrap.sample.test.org/twoWayReturn")
+ public Response<TwoWayHolder> twoWayHolderAsync(
+ @WebParam(name = "twoWayHolder", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ TwoWayHolder allByMyself);
+
+ /**
+ *
+ * @param allByMyself
+ * @param asyncHandler
+ * @return
+ * returns java.util.concurrent.Future<? extends java.lang.Object>
+ */
+ @WebMethod(operationName = "twoWayHolder", action = "http://nonwrap.sample.test.org/twoWayReturn")
+ public Future<?> twoWayHolderAsync(
+ @WebParam(name = "twoWayHolder", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ TwoWayHolder allByMyself,
+ @WebParam(name = "twoWayHolderResponse", targetNamespace = "", partName = "asyncHandler")
+ AsyncHandler<TwoWayHolder> asyncHandler);
+
+ /**
+ *
+ * @param allByMyself
+ */
+ @WebMethod(action = "http://nonwrap.sample.test.org/twoWayReturn")
+ public void twoWayHolder(
+ @WebParam(name = "twoWayHolder", targetNamespace = "http://nonwrap.sample.test.org", mode = Mode.INOUT, partName = "allByMyself")
+ Holder<TwoWayHolder> allByMyself);
+
+ /**
+ *
+ * @param allByMyself
+ * @return
+ * returns javax.xml.ws.Response<org.test.sample.nonwrap.ReturnType>
+ */
+ @WebMethod(operationName = "twoWay", action = "http://nonwrap.sample.test.org/twoWayReturn")
+ public Response<ReturnType> twoWayAsync(
+ @WebParam(name = "twoWay", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ TwoWay allByMyself);
+
+ /**
+ *
+ * @param allByMyself
+ * @param asyncHandler
+ * @return
+ * returns java.util.concurrent.Future<? extends java.lang.Object>
+ */
+ @WebMethod(operationName = "twoWay", action = "http://nonwrap.sample.test.org/twoWayReturn")
+ public Future<?> twoWayAsync(
+ @WebParam(name = "twoWay", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ TwoWay allByMyself,
+ @WebParam(name = "twoWayResponse", targetNamespace = "", partName = "asyncHandler")
+ AsyncHandler<ReturnType> asyncHandler);
+
+ /**
+ *
+ * @param allByMyself
+ * @return
+ * returns org.test.sample.nonwrap.ReturnType
+ */
+ @WebMethod(action = "http://nonwrap.sample.test.org/twoWayReturn")
+ @WebResult(name = "ReturnType", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ public ReturnType twoWay(
+ @WebParam(name = "twoWay", targetNamespace = "http://nonwrap.sample.test.org", partName = "allByMyself")
+ TwoWay allByMyself);
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapService.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/nonwrap/sei/DocLitNonWrapService.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,80 @@
+
+/*
+ * 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.axis2.jaxws.sample.nonwrap.sei;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "DocLitNonWrapService", targetNamespace = "http://nonwrap.sample.test.org", wsdlLocation = "doclit_nonwrap.wsdl")
+public class DocLitNonWrapService
+ extends Service
+{
+
+ private final static URL DOCLITNONWRAPSERVICE_WSDL_LOCATION;
+ private static String wsdlLocation="/test/org/apache/axis2/jaxws/sample/nonwrap/META-INF/doclit_nonwrap.wsdl";
+ static {
+ URL url = null;
+ try {
+ try{
+ String baseDir = new File(System.getProperty("basedir",".")).getCanonicalPath();
+ wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath();
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ File file = new File(wsdlLocation);
+ url = file.toURL();
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ DOCLITNONWRAPSERVICE_WSDL_LOCATION = url;
+ }
+
+ public DocLitNonWrapService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public DocLitNonWrapService() {
+ super(DOCLITNONWRAPSERVICE_WSDL_LOCATION, new QName("http://nonwrap.sample.test.org", "DocLitNonWrapService"));
+ }
+
+ /**
+ *
+ * @return
+ * returns DocLitNonWrapPortType
+ */
+ @WebEndpoint(name = "DocLitNonWrapPort")
+ public DocLitNonWrapPortType getDocLitNonWrapPort() {
+ return (DocLitNonWrapPortType)super.getPort(new QName("http://nonwrap.sample.test.org", "DocLitNonWrapPort"), DocLitNonWrapPortType.class);
+ }
+
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/CallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/CallbackHandler.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/CallbackHandler.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/CallbackHandler.java Mon Mar 3 10:47:38 2008
@@ -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 org.apache.axis2.jaxws.sample.parallelasync.common;
+
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+/**
+ * Generic Async callback handler. The get method emulates Response.get by
+ * throwning an exception if one is received.
+ */
+public class CallbackHandler<T> implements AsyncHandler<T> {
+
+ private T response = null;
+ private Response<T> resp = null;
+
+ private Exception exception = null;
+
+ public void handleResponse(Response<T> response) {
+
+ try {
+ T res = (T) response.get();
+ this.response = res;
+ this.resp = response;
+ } catch (Exception e) {
+ this.exception = e;
+ }
+ }
+
+ public Response<T> getResponse(){
+ return this.resp;
+ }
+
+ public T get() throws Exception {
+
+ if (exception != null)
+ throw exception;
+ return this.response;
+ }
+
+ /**
+ * Auxiliary method used to wait for a monitor for a certain amount of time
+ * before timing out
+ *
+ * @param monitor
+ */
+ public void waitBlocking(Future<?> monitor) throws Exception {
+ // wait for request to complete
+ int sec = Constants.CLIENT_MAX_SLEEP_SEC;
+ while (!monitor.isDone()) {
+ Thread.sleep(1000);
+ sec--;
+ if (sec <= 0) break;
+ }
+
+ if (sec <= 0)
+ throw new TimeoutException("Stopped waiting for Async response after "
+ + Constants.CLIENT_MAX_SLEEP_SEC + " sec");
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/Constants.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/Constants.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/Constants.java Mon Mar 3 10:47:38 2008
@@ -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.axis2.jaxws.sample.parallelasync.common;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This class holds constant strings such as endpoint addresses and common
+ * conversion methods
+ */
+public class Constants {
+
+ // server hostName and WC port
+ private static final String SERVER = "localhost:6060";
+
+ //public static final String WSDL_NAMESPACE = "http://common.wsfvt.async.jaxws";
+ public static final String WSDL_NAMESPACE = "http://org/test/parallelasync";
+
+ public static final String SOAP11_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope";
+
+ public static final String SOAP12_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
+
+ public static final QName SERVICE_QNAME = new QName(WSDL_NAMESPACE,
+ "AsyncService");
+
+ public static final QName PORT_QNAME = new QName(WSDL_NAMESPACE,
+ "AsyncPort");
+
+ // Endpoint addresses
+ public static final String BASE_ENDPOINT = "http://" + SERVER
+ + "/axis2/services/";
+
+ public static final String DOCLITWR_ASYNC_ENDPOINT = BASE_ENDPOINT
+ + "AsyncService"; //+ "AsyncDocLitWrappedService";
+
+ public static final String DOCLIT_ASYNC_ENDPOINT = BASE_ENDPOINT
+ + "AsyncService"; //+ "AsyncDocLitService";
+
+ public static final String RPCLIT_ASYNC_ENDPOINT = BASE_ENDPOINT
+ + "AsyncService"; //+ "AsyncRpcLitService";
+
+ public static final String THE_STRING = "This Is Just A Test";
+
+ // how long the server should seep for before returning a response
+ public static final long SERVER_SLEEP_SEC = 120;
+
+ // maximum amount of time to wait for async operation to complete
+ public static final int CLIENT_MAX_SLEEP_SEC = 120;
+
+ // maximum amount of time to wait for async operation to complete
+ public static final int CLIENT_SHORT_SLEEP_SEC = 15;
+
+ // maximum number of times the client should check to see if
+ // the server received sleep request
+ public static final int MAX_ISASLEEP_CHECK = 10;
+
+ // number of sec to sleep in between isAsleep checks
+ public static final int SLEEP_ISASLEEP_SEC = 1;
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/KillerThread.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/KillerThread.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/KillerThread.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/KillerThread.java Mon Mar 3 10:47:38 2008
@@ -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.axis2.jaxws.sample.parallelasync.common;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+
+import javax.xml.ws.Service;
+
+public class KillerThread extends Thread{
+
+ private Service svc = null;
+
+ private boolean isKilled = false;
+ private boolean interrupt = false;
+
+ private int waitUntilKillingSec = 30;
+
+ public KillerThread(Service service, int client_max_sleep_sec) {
+ this.waitUntilKillingSec = client_max_sleep_sec;
+ this.svc = service;
+ }
+
+ public void run(){
+ Executor e = svc.getExecutor();
+
+ TestLogger.logger.debug("KillerThread: " + e.getClass().getName());
+ ExecutorService es = (ExecutorService) e;
+
+
+ int i = waitUntilKillingSec;
+ while (i > 0 && !interrupt){
+
+ try {
+ TestLogger.logger.debug("KillerThread: going to sleep");
+ Thread.sleep(1000);
+ i --;
+ } catch (InterruptedException e1) {
+ TestLogger.logger.debug("KillerThread: interrupted");
+ }
+ }
+
+ // force executor to stop
+ if (!interrupt){
+ isKilled = true;
+ es.shutdownNow();
+ }
+ }
+
+ public boolean isKilled() {
+ return isKilled;
+ }
+
+ public void abort(){
+ this.interrupt = true;
+ this.interrupt();
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/PausableExecutor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/PausableExecutor.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/PausableExecutor.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/common/PausableExecutor.java Mon Mar 3 10:47:38 2008
@@ -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.axis2.jaxws.sample.parallelasync.common;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * A custom executor that can be paused for testing of exceptions that occur
+ * before an item is executed. This executor provides absolue control over its
+ * thread size via size parameter in the constructor
+ */
+public class PausableExecutor extends ThreadPoolExecutor {
+ private boolean isPaused;
+
+ private ReentrantLock pauseLock = new ReentrantLock();
+
+ private Condition unpaused = pauseLock.newCondition();
+
+ public PausableExecutor(int size) {
+ super(size, size, 1, TimeUnit.SECONDS,
+ new ArrayBlockingQueue<Runnable>(size));
+ }
+
+ protected void beforeExecute(Thread t, Runnable r) {
+ super.beforeExecute(t, r);
+ pauseLock.lock();
+ try {
+ while (isPaused)
+ unpaused.await();
+ } catch (InterruptedException ie) {
+ t.interrupt();
+ } finally {
+ pauseLock.unlock();
+ }
+ }
+
+ public void pause() {
+ pauseLock.lock();
+ try {
+ isPaused = true;
+ } finally {
+ pauseLock.unlock();
+ }
+ }
+
+ public void resume() {
+ pauseLock.lock();
+ try {
+ isPaused = false;
+ unpaused.signalAll();
+ } finally {
+ pauseLock.unlock();
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org