Thanks for the catch...Meant to remove it before comitting. Crept in by mistake. Hope
you have a
good sabbatical.
-- dims
--- Tom Jordahl <[EMAIL PROTECTED]> wrote:
>
> Dims,
>
> Are you sure you need to wrap the target exception in AxisFault (this changes the
> class in an
> must-recompile way), it is already stored in the 'detail' element of the parent
> class.
>
> I am not sure about this, since you named the member 'detail2'. Why do we need to
> track this
> separate?
>
> Just double checking...
>
> sorry this change was so much trouble. serves me right trying to fix one last bug.
> I can't believe how many files this changes!!! I would be -0 on this if it wasn't
> already done.
>
> Will any of the bugs we have be as simple as the patches we get for them? :-(
>
> --
> Tom Jordahl
> who is going to leave tomorrow and stop checking email.... :-)
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Sent: 5/28/2003 11:34 AM
> Subject: cvs commit: xml-axis/java/test/functional TestFaultsSample.java
> FunctionalTests.java
>
> dims 2003/05/28 11:34:18
>
> Modified: java/src/org/apache/axis AxisFault.java
> java/src/org/apache/axis/client Call.java
> java/src/org/apache/axis/message SOAPFault.java
> SOAPFaultBuilder.java
> SOAPFaultDetailsBuilder.java
> java/test/functional FunctionalTests.java
> Added: java/samples/faults Employee.java EmployeeClient.java
> EmployeeInfo.java NoSuchEmployeeFault.java
> build.xml deploy.wsdd undeploy.wsdd
> java/test/functional TestFaultsSample.java
> Log:
> Fix and test case for Bug 19682 - non-AxisFault exceptions don't have
> details serialized
>
> Revision Changes Path
> 1.1 xml-axis/java/samples/faults/Employee.java
>
> Index: Employee.java
> ===================================================================
> /**
> * Employee.java
> *
> * This file was auto-generated from WSDL
> * by the Apache Axis WSDL2Java emitter.
> */
>
> package samples.faults;
>
> public class Employee {
> private java.lang.String employeeID;
> private java.lang.String employeeName;
>
> public Employee() {
> }
>
> public java.lang.String getEmployeeID() {
> return employeeID;
> }
>
> public void setEmployeeID(java.lang.String employeeID) {
> this.employeeID = employeeID;
> }
>
> public java.lang.String getEmployeeName() {
> return employeeName;
> }
>
> public void setEmployeeName(java.lang.String employeeName) {
> this.employeeName = employeeName;
> }
> }
>
>
>
> 1.1 xml-axis/java/samples/faults/EmployeeClient.java
>
> Index: EmployeeClient.java
> ===================================================================
> package samples.faults;
>
> import org.apache.axis.encoding.ser.BeanSerializerFactory;
> import org.apache.axis.encoding.ser.BeanDeserializerFactory;
> import org.apache.axis.AxisFault;
> import org.apache.axis.utils.Options;
> import org.apache.axis.transport.http.SimpleAxisWorker;
> import org.apache.axis.description.OperationDesc;
>
> import javax.xml.rpc.ServiceFactory;
> import javax.xml.rpc.Service;
> import javax.xml.rpc.Call;
> import javax.xml.rpc.encoding.TypeMappingRegistry;
> import javax.xml.rpc.encoding.TypeMapping;
> import javax.xml.namespace.QName;
> import java.net.URL;
> import java.util.Map;
> import java.util.Iterator;
>
> import samples.faults.Employee;
>
> public class EmployeeClient {
> public static void main(String[] args) throws Exception {
> Options opts = new Options(args);
> String uri = "http://faults.samples";
> String serviceName = "EmployeeInfoService";
> ServiceFactory serviceFactory = ServiceFactory.newInstance();
> Service service = serviceFactory.createService(new QName(uri,
> serviceName));
>
> TypeMappingRegistry registry =
> service.getTypeMappingRegistry();
> TypeMapping map = registry.getDefaultTypeMapping();
>
> QName employeeQName = new QName("http://faults.samples",
> "Employee");
> map.register(Employee.class, employeeQName, new
> BeanSerializerFactory(Employee.class, employeeQName), new
> BeanDeserializerFactory(Employee.class, employeeQName));
>
> QName faultQName = new QName("http://faults.samples",
> "NoSuchEmployeeFault");
> map.register(NoSuchEmployeeFault.class, faultQName, new
> BeanSerializerFactory(NoSuchEmployeeFault.class, faultQName), new
> BeanDeserializerFactory(NoSuchEmployeeFault.class, faultQName));
>
> Call call = service.createCall();
> call.setTargetEndpointAddress(new
> URL(opts.getURL()).toString());
> call.setProperty(Call.SESSION_MAINTAIN_PROPERTY,
> Boolean.TRUE);
> call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
> call.setProperty(Call.SOAPACTION_URI_PROPERTY,
> "http://faults.samples");
> call.setOperationName( new QName(uri, "getEmployee") );
>
> String[] args2 = opts.getRemainingArgs();
> System.out.println("Trying :" + args2[0]);
> Employee emp = (Employee) call.invoke(new Object[]{ args2[0]
> });
> System.out.println("Got :" + emp.getEmployeeID());
> }
> }
>
>
>
> 1.1 xml-axis/java/samples/faults/EmployeeInfo.java
>
> Index: EmployeeInfo.java
> ===================================================================
> package samples.faults;
>
> import samples.faults.Employee;
>
> import java.util.Collection;
> import java.util.HashMap;
>
> public class EmployeeInfo {
> static HashMap map = new HashMap();
> static {
> Employee emp = new Employee();
> emp.setEmployeeID("#001");
> emp.setEmployeeName("Bill Gates");
> map.put(emp.getEmployeeID(), emp);
> }
>
> public void addEmployee(Employee in) {
> map.put(in.getEmployeeID(), in);
> }
>
> public Employee getEmployee(java.lang.String id) throws
> NoSuchEmployeeFault {
> Employee emp = (Employee) map.get(id);
> if (emp == null) {
> NoSuchEmployeeFault fault = new NoSuchEmployeeFault();
> fault.setInfo("Could not find employee:" + id);
> throw fault;
> }
> return emp;
> }
>
> public Employee[] getEmployees() {
> Collection values = map.values();
> Employee[] emps = new Employee[values.size()];
> values.toArray(emps);
> return emps;
> }
> }
>
>
>
> 1.1
> xml-axis/java/samples/faults/NoSuchEmployeeFault.java
>
> Index: NoSuchEmployeeFault.java
>
=== message truncated ===
=====
Davanum Srinivas - http://webservices.apache.org/~dims/
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com