tomj 2002/10/04 16:36:34
Modified: java/src/org/apache/axis/wsdl/symbolTable Tag: interop4
SymbolTable.java BindingEntry.java
java/src/org/apache/axis/message Tag: interop4
SOAPFaultDetailsBuilder.java SOAPFault.java
java/src/org/apache/axis/description Tag: interop4
ServiceDesc.java OperationDesc.java FaultDesc.java
java/src/org/apache/axis/client Tag: interop4 Service.java
Call.java
java/src/org/apache/axis/i18n Tag: interop4
resource.properties
java/test/wsdl/interop4/groupH/simpleRPCenc Tag: interop4
build.xml
java/src/org/apache/axis Tag: interop4 AxisFault.java
Log:
Work in progress for Faults - DOESN'T WORK YET.
Now are collecting fault information in the SymbolTable, then using it in the
writers.
Glen and I are still working on it, checking in so we can work on it at home.
Revision Changes Path
No revision
No revision
1.41.4.1 +47 -13
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
Index: SymbolTable.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
retrieving revision 1.41
retrieving revision 1.41.4.1
diff -u -r1.41 -r1.41.4.1
--- SymbolTable.java 24 Sep 2002 20:29:18 -0000 1.41
+++ SymbolTable.java 4 Oct 2002 23:36:32 -0000 1.41.4.1
@@ -68,6 +68,7 @@
import java.util.List;
import java.util.Map;
import java.util.Vector;
+import java.util.ArrayList;
import javax.wsdl.Binding;
import javax.wsdl.BindingFault;
@@ -100,11 +101,13 @@
import javax.wsdl.extensions.http.HTTPBinding;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap.SOAPBody;
+import javax.wsdl.extensions.soap.SOAPFault;
import javax.xml.rpc.holders.BooleanHolder;
import javax.xml.rpc.holders.IntHolder;
import org.apache.axis.Constants;
+import org.apache.axis.wsdl.toJava.JavaDefinitionWriter;
import org.apache.axis.utils.Messages;
import org.apache.axis.utils.XMLUtils;
@@ -1569,34 +1572,65 @@
}
// faults
- HashMap faultMap = new HashMap();
+ HashMap faultMap = new HashMap(); // name to SOAPFault from WSDL4J
+ ArrayList faults = new ArrayList();
Iterator faultMapIter =
bindOp.getBindingFaults().values().iterator();
for (; faultMapIter.hasNext(); ) {
BindingFault bFault = (BindingFault)faultMapIter.next();
// Set default entry for this fault
String faultName = bFault.getName();
- int faultBodyType = BindingEntry.USE_ENCODED;
+ // Check to make sure this fault is named
+ if (faultName == null || faultName.length() == 0) {
+ throw new IOException(
+ Messages.getMessage("unNamedFault00",
+ bindOp.getName(),
+ binding.getQName().toString()));
+ }
+
+ SOAPFault soapFault = null;
Iterator faultIter =
bFault.getExtensibilityElements().iterator();
for (; faultIter.hasNext();) {
Object obj = faultIter.next();
- if (obj instanceof SOAPBody) {
- String use = ((SOAPBody) obj).getUse();
- if (use == null) {
- throw new IOException(Messages.getMessage(
- "noUse", opName));
- }
- if (use.equalsIgnoreCase("literal")) {
- faultBodyType = BindingEntry.USE_LITERAL;
- }
+ if (obj instanceof SOAPFault) {
+ soapFault = (SOAPFault) obj;
break;
}
}
- // Add this fault name and bodyType to the map
- faultMap.put(faultName, new Integer(faultBodyType));
+
+ // Check to make sure we have a soap:fault element
+ if (soapFault == null) {
+ throw new IOException(
+ Messages.getMessage("missingSoapFault00",
+ faultName,
+ bindOp.getName(),
+ binding.getQName().toString()));
+ }
+
+ // TODO error checking:
+ // if use=literal, no use of namespace on the soap:fault
+ // if use=encoded, no use of element on the part
+
+ // Check this fault to make sure it matches the one
+ // in the matching portType Operation
+ Operation operation = bindOp.getOperation();
+ Fault opFault = operation.getFault(bFault.getName());
+ if (opFault == null) {
+ throw new IOException(
+ Messages.getMessage("noPortTypeFault",
+ new String[] {bFault.getName(),
+ bindOp.getName(),
+ binding.getQName().toString()}));
+ }
+ // put the updated entry back in the map
+ faults.add(new JavaDefinitionWriter.FaultInfo(opFault,
+ soapFault));
}
+ // Add this fault name and info to the map
+ faultMap.put(bindOp, faults);
+
// Associate the portType operation that goes with this binding
// with the body types.
attributes.put(bindOp.getOperation(),
1.3.4.1 +21 -4
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/BindingEntry.java
Index: BindingEntry.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/BindingEntry.java,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -r1.3 -r1.3.4.1
--- BindingEntry.java 2 Aug 2002 12:55:33 -0000 1.3
+++ BindingEntry.java 4 Oct 2002 23:36:33 -0000 1.3.4.1
@@ -60,6 +60,7 @@
import javax.wsdl.Binding;
import javax.wsdl.Operation;
+import javax.wsdl.extensions.soap.SOAPFault;
/**
* This class represents a WSDL binding. It encompasses the WSDL4J Binding object
so it can
@@ -86,7 +87,11 @@
private int bindingStyle;
private boolean hasLiteral;
private HashMap attributes;
+ // operation to parameter info (Parameter)
private HashMap parameters = new HashMap();
+
+ // BindingOperation to faults (ArrayList of FaultInfo)
+ private HashMap faults = new HashMap();
// This is a map of a map. It's a map keyed on operation name whose values
// are maps keyed on parameter name.
@@ -236,14 +241,26 @@
}
else {
HashMap m = attr.getFaultBodyTypeMap();
+ SOAPFault soapFault = (SOAPFault) m.get(faultName);
- // Default to encoded if we didn't have a soap:body for the fault
- if ( ! m.containsKey(faultName) ) {
+ // This should never happen (error thrown in SymbolTable)
+ if (soapFault == null) {
return USE_ENCODED;
}
-
- return ((Integer) m.get(faultName)).intValue();
+ String use = soapFault.getUse();
+ if ("literal".equals(use)) {
+ return USE_LITERAL;
+ }
+
+ return USE_ENCODED;
}
+ }
+
+ /**
+ * Return the map of BindingOperations to ArraList of FaultInfo
+ */
+ public HashMap getFaults() {
+ return faults;
}
/**
No revision
No revision
1.1.2.4 +8 -6
xml-axis/java/src/org/apache/axis/message/Attic/SOAPFaultDetailsBuilder.java
Index: SOAPFaultDetailsBuilder.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/message/Attic/SOAPFaultDetailsBuilder.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- SOAPFaultDetailsBuilder.java 3 Oct 2002 14:46:15 -0000 1.1.2.3
+++ SOAPFaultDetailsBuilder.java 4 Oct 2002 23:36:33 -0000 1.1.2.4
@@ -56,6 +56,8 @@
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
+import org.apache.axis.description.OperationDesc;
+import org.apache.axis.description.FaultDesc;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.DeserializationContext;
@@ -105,15 +107,15 @@
// Look up this element in our faultMap
// if we find a match, this element is the fault data
MessageContext msgContext = context.getMessageContext();
- Service service = (Service) msgContext.getProperty(Call.WSDL_SERVICE);
- if (service != null) {
- Service.FaultInfo info = service.getFaultInfoForQName(qn);
- if (info != null && info.cls != null) {
+ OperationDesc op = msgContext.getOperation();
+ if (op != null) {
+ FaultDesc faultDesc = op.getFaultByQName(qn);
+ if (faultDesc != null) {
// Set the class
- builder.setFaultClass(info.cls);
+ builder.setFaultClass(faultDesc.getClass());
builder.setWaiting(true);
// register callback for the data, use the xmlType from fault info
- Deserializer dser = context.getDeserializerForType(info.xmlType);
+ Deserializer dser =
context.getDeserializerForType(faultDesc.getXmlType());
dser.registerValueTarget(new CallbackTarget(this, "faultData"));
return (SOAPHandler)dser;
}
1.8.2.2 +88 -75 xml-axis/java/src/org/apache/axis/message/SOAPFault.java
Index: SOAPFault.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPFault.java,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -r1.8.2.1 -r1.8.2.2
--- SOAPFault.java 1 Oct 2002 20:38:52 -0000 1.8.2.1
+++ SOAPFault.java 4 Oct 2002 23:36:33 -0000 1.8.2.2
@@ -1,61 +1,62 @@
/*
- * The Apache Software License, Version 1.1
- *
- *
- * Copyright (c) 2001 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Axis" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
+* The Apache Software License, Version 1.1
+*
+*
+* Copyright (c) 2001 The Apache Software Foundation. All rights
+* reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* 2. Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in
+* the documentation and/or other materials provided with the
+* distribution.
+*
+* 3. The end-user documentation included with the redistribution,
+* if any, must include the following acknowledgment:
+* "This product includes software developed by the
+* Apache Software Foundation (http://www.apache.org/)."
+* Alternately, this acknowledgment may appear in the software itself,
+* if and wherever such third-party acknowledgments normally appear.
+*
+* 4. The names "Axis" and "Apache Software Foundation" must
+* not be used to endorse or promote products derived from this
+* software without prior written permission. For written
+* permission, please contact [EMAIL PROTECTED]
+*
+* 5. Products derived from this software may not be called "Apache",
+* nor may "Apache" appear in their name, without prior written
+* permission of the Apache Software Foundation.
+*
+* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGE.
+* ====================================================================
+*
+* This software consists of voluntary contributions made by many
+* individuals on behalf of the Apache Software Foundation. For more
+* information on the Apache Software Foundation, please see
+* <http://www.apache.org/>.
+*/
package org.apache.axis.message;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
+import org.apache.axis.description.FaultDesc;
import org.apache.axis.utils.JavaUtils;
import org.apache.axis.utils.Messages;
import org.apache.axis.encoding.DeserializationContext;
@@ -77,33 +78,33 @@
public class SOAPFault extends SOAPBodyElement implements javax.xml.soap.SOAPFault
{
protected AxisFault fault;
-
+
public SOAPFault(String namespace, String localName, String prefix,
- Attributes attrs, DeserializationContext context)
+ Attributes attrs, DeserializationContext context)
{
super(namespace, localName, prefix, attrs, context);
this.fault = fault;
namespaceURI = Constants.URI_SOAP11_ENV;
name = Constants.ELEM_FAULT;
}
-
+
public SOAPFault(AxisFault fault)
{
this.fault = fault;
namespaceURI = Constants.URI_SOAP11_ENV;
name = Constants.ELEM_FAULT;
}
-
+
public void outputImpl(SerializationContext context)
- throws IOException
+ throws IOException
{
context.registerPrefixForURI(prefix, namespaceURI);
context.startElement(new QName(this.getNamespaceURI(),
this.getName()),
attributes);
-
+
// XXX - Can fault be anything but an AxisFault here?
- if (fault instanceof AxisFault) {
+ if (fault instanceof AxisFault) {
AxisFault axisFault = (AxisFault) fault;
if (axisFault.getFaultCode() != null) {
// Do this BEFORE starting the element, so the prefix gets
@@ -113,24 +114,36 @@
context.writeSafeString(faultCode);
context.endElement();
}
-
+
if (axisFault.getFaultString() != null) {
context.startElement(Constants.QNAME_FAULTSTRING, null);
context.writeSafeString(axisFault.getFaultString());
context.endElement();
}
-
+
if (axisFault.getFaultActor() != null) {
context.startElement(Constants.QNAME_FAULTACTOR, null);
context.writeSafeString(axisFault.getFaultActor());
context.endElement();
}
-
+
+ // get the QName for this faults detail element
+ Class cls = fault.getClass();
+ QName qname = null;
+ if (! cls.equals(AxisFault.class)) {
+ FaultDesc faultDesc =
+
context.getMessageContext().getOperation().getFaultByClass(cls);
+ qname = faultDesc.getQName();
+ }
+ if (qname == null) {
+ // not the greatest, but...
+ qname = new QName("", "faultData");
+ }
Element[] faultDetails = axisFault.getFaultDetails();
if (faultDetails != null) {
context.startElement(Constants.QNAME_FAULTDETAILS, null);
// Allow the fault to write its data, if any
- axisFault.writeDetails(context);
+ axisFault.writeDetails(qname, context);
// Then output any other elements
for (int i = 0; i < faultDetails.length; i++) {
context.writeDOMElement(faultDetails[i]);
@@ -138,20 +151,20 @@
context.endElement();
}
}
-
+
context.endElement();
}
-
+
public AxisFault getFault()
{
return fault;
}
-
+
public void setFault(AxisFault fault)
{
this.fault = fault;
}
-
+
/**
* Sets this <CODE>SOAPFaultException</CODE> object with the given
* fault code.
@@ -168,7 +181,7 @@
public void setFaultCode(String faultCode) throws SOAPException {
fault.setFaultCode(faultCode);
}
-
+
/**
* Gets the fault code for this <CODE>SOAPFaultException</CODE>
* object.
@@ -177,7 +190,7 @@
public String getFaultCode() {
return fault.getFaultCode().getLocalPart();
}
-
+
/**
* Sets this <CODE>SOAPFaultException</CODE> object with the given
* fault actor.
@@ -194,7 +207,7 @@
public void setFaultActor(String faultActor) throws SOAPException {
fault.setFaultActor(faultActor);
}
-
+
/**
* Gets the fault actor for this <CODE>SOAPFaultException</CODE>
* object.
@@ -205,7 +218,7 @@
public String getFaultActor() {
return fault.getFaultActor();
}
-
+
/**
* Sets the fault string for this <CODE>SOAPFaultException</CODE>
* object to the given string.
@@ -220,7 +233,7 @@
public void setFaultString(String faultString) throws SOAPException {
fault.setFaultString(faultString);
}
-
+
/**
* Gets the fault string for this <CODE>SOAPFaultException</CODE>
* object.
@@ -230,7 +243,7 @@
public String getFaultString() {
return fault.getFaultString();
}
-
+
/**
* Returns the detail element for this <CODE>SOAPFaultException</CODE>
* object.
@@ -246,7 +259,7 @@
return null;
return (javax.xml.soap.Detail) this.getChildren().get(0);
}
-
+
/**
* Creates a <CODE>Detail</CODE> object and sets it as the
* <CODE>Detail</CODE> object for this <CODE>SOAPFaultException</CODE>
No revision
No revision
1.64.2.2 +1 -0 xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
Index: ServiceDesc.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
retrieving revision 1.64.2.1
retrieving revision 1.64.2.2
diff -u -r1.64.2.1 -r1.64.2.2
--- ServiceDesc.java 3 Oct 2002 18:58:07 -0000 1.64.2.1
+++ ServiceDesc.java 4 Oct 2002 23:36:33 -0000 1.64.2.2
@@ -1154,6 +1154,7 @@
FaultDesc fault = new FaultDesc();
fault.setName(pkgAndClsName);
fault.setParameters(exceptionParams);
+ fault.setClassName(pkgAndClsName);
operation.addFault(fault);
}
}
1.23.2.2 +18 -1 xml-axis/java/src/org/apache/axis/description/OperationDesc.java
Index: OperationDesc.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/description/OperationDesc.java,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -u -r1.23.2.1 -r1.23.2.2
--- OperationDesc.java 3 Oct 2002 18:58:07 -0000 1.23.2.1
+++ OperationDesc.java 4 Oct 2002 23:36:33 -0000 1.23.2.2
@@ -361,15 +361,32 @@
* Returns null if not found.
*/
public FaultDesc getFaultByClass(Class cls) {
+ if (faults == null || cls == null) {
+ return null;
+ }
for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
FaultDesc desc = (FaultDesc) iterator.next();
- if (desc.getClassName().equals(cls.getName())) {
+ if (cls.getName().equals(desc.getClassName())) {
return desc;
}
}
return null;
}
+ /**
+ * Returns the FaultDesc for a QName (which is typically found
+ * in the details element of a SOAP fault).
+ * Returns null if not found.
+ */
+ public FaultDesc getFaultByQName(QName qname) {
+ for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
+ FaultDesc desc = (FaultDesc) iterator.next();
+ if (qname.equals(desc.getQName())) {
+ return desc;
+ }
+ }
+ return null;
+ }
public ParameterDesc getReturnParamDesc() {
return returnDesc;
}
1.3.4.2 +22 -2 xml-axis/java/src/org/apache/axis/description/FaultDesc.java
Index: FaultDesc.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/FaultDesc.java,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -u -r1.3.4.1 -r1.3.4.2
--- FaultDesc.java 3 Oct 2002 18:58:07 -0000 1.3.4.1
+++ FaultDesc.java 4 Oct 2002 23:36:33 -0000 1.3.4.2
@@ -59,13 +59,17 @@
import java.util.ArrayList;
/**
- *
+ * Holds information about a fault for an operation
+ *
* @author Glen Daniels ([EMAIL PROTECTED])
+ * @author Tom Jordahl ([EMAIL PROTECTED])
*/
public class FaultDesc {
private QName qname;
private ArrayList parameters;
private String className;
+ private QName xmlType;
+ private boolean complex;
public QName getQName() {
return qname;
@@ -103,6 +107,22 @@
this.className = className;
}
+ public boolean isComplex() {
+ return complex;
+ }
+
+ public void setComplex(boolean complex) {
+ this.complex = complex;
+ }
+
+ public QName getXmlType() {
+ return xmlType;
+ }
+
+ public void setXmlType(QName xmlType) {
+ this.xmlType = xmlType;
+ }
+
public String toString() {
return toString("");
}
@@ -110,7 +130,7 @@
String text ="";
text+= indent + "qname: " + getQName() + "\n";
text+= indent + "Class: " + getClassName() + "\n";
- for (int i=0; i<parameters.size(); i++) {
+ for (int i=0; parameters != null && i < parameters.size(); i++) {
text+= indent +" ParameterDesc[" + i + "]:\n";
text+= indent + ((ParameterDesc)parameters.get(i)).toString(" ") +
"\n";
}
No revision
No revision
1.76.2.2 +0 -44 xml-axis/java/src/org/apache/axis/client/Service.java
Index: Service.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Service.java,v
retrieving revision 1.76.2.1
retrieving revision 1.76.2.2
diff -u -r1.76.2.1 -r1.76.2.2
--- Service.java 1 Oct 2002 20:38:52 -0000 1.76.2.1
+++ Service.java 4 Oct 2002 23:36:33 -0000 1.76.2.2
@@ -130,11 +130,6 @@
*/
private Hashtable transportImpls = new Hashtable();
- /**
- * A HashMap mapping faultDetails elements (QNames) to exceptions (Class)
- */
- private HashMap faultInfoMap = new HashMap();
-
Definition getWSDLDefinition() {
return( wsdlDefinition );
@@ -775,43 +770,4 @@
return (Transport)transportImpls.get(url);
}
- /**
- * Class that describes a fault, including:
- * <ul>
- * <li>QName of the fault</li>
- * <li>java class of the fault</li>
- * <li>Qname of the XML type</li>
- * <li>flag indicating is this is a complex type fault</li>
- * </ul>
- */
- public class FaultInfo {
- public QName qname;
- public Class cls;
- public QName xmlType;
- public boolean isComplex;
-
- public FaultInfo(QName qname, Class cls, QName xmlType, boolean isComplex) {
- this.qname = qname;
- this.cls = cls;
- this.xmlType = xmlType;
- this.isComplex = isComplex;
- }
- }
- /**
- * Look up QName of a faultDetail element
- * and return any registered Exception class
- */
- public FaultInfo getFaultInfoForQName(QName qname) {
- FaultInfo fi = (FaultInfo)faultInfoMap.get(qname);
- return fi;
- }
-
- /**
- * register a QName of a faultDetail element
- * the Exception class it coresponds to and if it is a complex type
- */
- public void registerFaultInfo(QName qname, Class cls, QName xmlType, boolean
isComplex) {
- FaultInfo fi = new FaultInfo(qname, cls, xmlType, isComplex);
- this.faultInfoMap.put(qname, fi);
- }
}
1.180.2.1 +21 -2 xml-axis/java/src/org/apache/axis/client/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.180
retrieving revision 1.180.2.1
diff -u -r1.180 -r1.180.2.1
--- Call.java 27 Sep 2002 20:46:33 -0000 1.180
+++ Call.java 4 Oct 2002 23:36:33 -0000 1.180.2.1
@@ -65,6 +65,7 @@
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
+import org.apache.axis.description.FaultDesc;
import org.apache.axis.enum.Style;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.SerializationContext;
@@ -1488,8 +1489,12 @@
// If we never set-up any names... then just return what was passed in
//////////////////////////////////////////////////////////////////////
- log.debug( "operation=" + operation);
- if(operation != null) log.debug("operation.getNumParams()="
+operation.getNumParams());
+ if (log.isDebugEnabled()) {
+ log.debug( "operation=" + operation);
+ if (operation != null)
+ log.debug("operation.getNumParams()=" +
+ operation.getNumParams());
+ }
if ( operation.getNumParams() == 0 ) return( params );
// Count the number of IN and INOUT params, this needs to match the
@@ -2233,4 +2238,18 @@
public void addAttachmentPart( Object attachment){
attachmentParts.add(attachment);
}
+
+ /**
+ * Add a fault for this operation
+ *
+ * Note: Not part of JAX-RPC specificaion
+ */
+ public void addFault(QName qname, Class cls, QName xmlType, boolean isComplex) {
+ FaultDesc fault = new FaultDesc();
+ fault.setQName(qname);
+ fault.setClassName(cls.getName());
+ fault.setXmlType(xmlType);
+ fault.setComplex(isComplex);
+ operation.addFault(fault);
+ }
}
No revision
No revision
1.9.2.2 +3 -1 xml-axis/java/src/org/apache/axis/i18n/resource.properties
Index: resource.properties
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -r1.9.2.1 -r1.9.2.2
--- resource.properties 3 Oct 2002 15:00:54 -0000 1.9.2.1
+++ resource.properties 4 Oct 2002 23:36:34 -0000 1.9.2.2
@@ -1032,4 +1032,6 @@
noOperationForQName=Couldn't find an appropriate operation for XML QName {0}
noParmDesc=operation description is missing parameter description!
-noBindingFault=ERROR: Unable to find fault "{0}" in operation "{1}", in binding {2}.
\ No newline at end of file
+noPortTypeFault=ERROR: Unable to match binding fault "{0}" from binding {2},
operation "{1}", to a PortType fault.
+unNamedFault00=ERROR: Fault is missing a name= attribute in operation "{0}", in
binding {1}.
+missingSoapFault00=ERROR: Missing <soap:fault> element inFault "{0}" in operation
"{0}", in binding {1}
No revision
No revision
1.1.2.4 +11 -3
xml-axis/java/test/wsdl/interop4/groupH/simpleRPCenc/Attic/build.xml
Index: build.xml
===================================================================
RCS file:
/home/cvs/xml-axis/java/test/wsdl/interop4/groupH/simpleRPCenc/Attic/build.xml,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- build.xml 3 Oct 2002 14:46:15 -0000 1.1.2.3
+++ build.xml 4 Oct 2002 23:36:34 -0000 1.1.2.4
@@ -32,7 +32,7 @@
</description>
==================================================================== -->
-<project name="Round4" default="main">
+<project name="Round4" default="compile">
<property name="axis.home" location="../../../../.." />
<property name="componentName" value="test/wsdl/interop4/groupH/simpleRPCenc" />
&properties;
@@ -41,8 +41,13 @@
&taskdefs_post_compile;
&targets;
<property name="root.dir" value="../../../../.."/>
+<target name="clean">
+ <echo message="Removing ${build.dir}/classes/${componentName} and
${build.dir}/work/${componentName}" />
+ <delete dir="${build.dir}/classes/${componentName}"/>
+ <delete dir="${build.dir}/work/${componentName}"/>
+</target>
- <target name="main">
+ <target name="compile">
<property name="testname" value="simpleRPCenc"/>
<!-- generate skeletons -->
@@ -64,8 +69,11 @@
<javac srcdir="${build.dir}/work"
destdir="${build.dest}" debug="on">
<classpath refid="classpath" />
- <include name="test/wsdl/interop4/groupH/simpleRPCenc/groupH/*.java" />
+ <include name="test/wsdl/interop4/groupH/simpleRPCenc/*.java" />
</javac>
</target>
+<target name="run" >
+ <antcall target="execute-Component" />
+</target>
</project>
No revision
No revision
1.58.2.2 +1 -1 xml-axis/java/src/org/apache/axis/AxisFault.java
Index: AxisFault.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisFault.java,v
retrieving revision 1.58.2.1
retrieving revision 1.58.2.2
diff -u -r1.58.2.1 -r1.58.2.2
--- AxisFault.java 1 Oct 2002 20:38:51 -0000 1.58.2.1
+++ AxisFault.java 4 Oct 2002 23:36:34 -0000 1.58.2.2
@@ -359,7 +359,7 @@
/**
* Writes any exception data to the faultDetails
*/
- public void writeDetails(org.apache.axis.encoding.SerializationContext context)
throws java.io.IOException {
+ public void writeDetails(QName qname, SerializationContext context) throws
java.io.IOException {
// no data in default Axis fault
}