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 sc...@apache.org on 2006/11/10 03:09:14 UTC

svn commit: r473168 [2/2] - in /webservices/axis2/trunk/java/modules/jaxws: ./ src/org/apache/axis2/jaxws/ src/org/apache/axis2/jaxws/i18n/ src/org/apache/axis2/jaxws/marshaller/ src/org/apache/axis2/jaxws/marshaller/impl/ src/org/apache/axis2/jaxws/me...

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault1_Exception.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,55 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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 = "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/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/DerivedFault2_Exception.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,55 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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 = "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/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/EqualFault.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,55 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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 = "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/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsService.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,63 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+
+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(".").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/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServicePortType.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,94 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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;
+
+
+/**
+ * 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
+     * @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, 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/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/FaultsServiceSoapBindingImpl.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,107 @@
+//
+// IBM Confidential OCO Source Material
+// (C) COPYRIGHT International Business Machines Corp. 2006
+// The source code for this program is not published or otherwise divested
+// of its trade secrets, irrespective of what has been deposited with the
+// U.S. Copyright Office.
+//
+// Change History:
+// Date        UserId         Defect            Description
+// ----------------------------------------------------------------------------
+// 08/28/2006  mzheng         LIDB3296-46.01    New File
+//
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceException;
+import javax.jws.WebService;
+
+
+/**
+ * This class provides server side implementation for the 
+ * FaultsServicePortType.
+ */
+@WebService (targetNamespace="http://org/test/polymorphicfaults",
+             wsdlLocation="WEB-INF/wsdl/FaultsService.wsdl",
+             serviceName="FaultsService",
+             portName="FaultsPort",
+             endpointInterface="org.apache.axis2.jaxws.sample.faultsservice.FaultsServicePortType")
+
+public class FaultsServiceSoapBindingImpl implements FaultsServicePortType {
+
+    /**
+     * Throws wrapper exceptions for fault beans
+     */
+    public float getQuote(String tickerSymbol) throws 
+        BaseFault_Exception, DerivedFault1_Exception, 
+        DerivedFault2_Exception, InvalidTickerFault, SimpleFault {
+System.out.println("\nIn getQuote(): " + tickerSymbol + "\n");
+        if (tickerSymbol.equals("ABC")) {
+            throw new SimpleFault("Server throws SimpleFault", 100);
+        } else if (tickerSymbol.equals("XYZ")) {
+            throw new InvalidTickerFault("Server throws InvalidTickerFault", tickerSymbol);
+        } else if (tickerSymbol.equals("one")) {
+            DerivedFault1 df = new DerivedFault1();
+            df.setA(100);
+            df.setB(tickerSymbol);
+            throw new DerivedFault1_Exception("Server throws DerivedFault1_Exception", df);
+        }  else if (tickerSymbol.equals("two")) {
+            DerivedFault2 df = new DerivedFault2();
+            df.setA(200);
+            df.setB(tickerSymbol);
+            df.setC(80.0F);
+            throw new DerivedFault2_Exception("Server throws DerivedFault2_Exception", df);
+        } else {
+            BaseFault bf = new BaseFault();
+            bf.setA(400);
+            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
+        }
+    }
+
+
+    /**
+     * 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);
+        } 
+        DerivedFault2 df = new DerivedFault2();
+        df.setA(a); 
+        df.setB(b); 
+        df.setC(c); 
+        throw new BaseFault_Exception("Server throws BaseFault_Exception", df);
+    }
+
+
+    /**
+     * 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);
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/InvalidTickerFault.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,55 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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 = "InvalidTickerFault", targetNamespace = "http://org/test/polymorphicfaults")
+public class InvalidTickerFault
+    extends Exception
+{
+
+    /**
+     * Java type that goes as soapenv:Fault detail element.
+     * 
+     */
+    private String faultInfo;
+
+    /**
+     * 
+     * @param message
+     * @param faultInfo
+     */
+    public InvalidTickerFault(String message, String faultInfo) {
+        super(message);
+        this.faultInfo = faultInfo;
+    }
+
+    /**
+     * 
+     * @param cause
+     * @param message
+     * @param faultInfo
+     */
+    public InvalidTickerFault(String message, String faultInfo, Throwable cause) {
+        super(message, cause);
+        this.faultInfo = faultInfo;
+    }
+
+    /**
+     * 
+     * @return
+     *     returns fault bean: java.lang.String
+     */
+    public String getFaultInfo() {
+        return faultInfo;
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java?view=auto&rev=473168
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/faultsservice/SimpleFault.java Thu Nov  9 18:09:13 2006
@@ -0,0 +1,55 @@
+
+package org.apache.axis2.jaxws.sample.faultsservice;
+
+import org.test.polymorphicfaults.*;
+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;
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org