Steve Loughran wrote:
I've also tried to use child nodes for "why" and it works. The only
thing is that I would like to have :
    <why>Just to test BadRecord</why>
instead of :
    <why value="Just to test BadRecord"/>
but I can't find a way to do that (I've tried with setUserObject and
setNodeValue but it doesn't work).
    

in CVS_HEAD, AxisFault has a method to take a Qname "foo:mydetail" and a
string "not enough data" and create an element <foo:mydetail>not enough
data</foo:mydetail>, then add it to the detail list. If you cant use axis1.1
you can always steal the code and use it in your axis1.0 service. There is
also some code to look up an element in the fault detail given the qname,
which is kind of useful too.
  
Thanks, Steve, but I still have a problem...

I've tried this (with Axis CVS) :
          AxisFault af = new AxisFault(code, faultString, actor, null);
          af.addFaultDetail(new QName(Constants.NS_URI_AXIS, "why"), e.why);
          throw af;

It compiles, but when I call it, it raises this exception :

java.lang.reflect.InvocationTargetException
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:127)
        (...)
        at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         (...)
        at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:332)
        ... 38 more
Caused by: java.lang.NoSuchMethodError: org.apache.axis.AxisFault.addFaultDetail(Ljavax/xml/namespace/QName;Ljava/lang/String;)V
        at ProxyExceptions.bar(ProxyExceptions.java:191)
        ... 45 more

I think it's not a classpath problem, because it compiles... I don't know if the problem comes from me or from Axis (have you already tested this method ?).

And another point :
With this "addFaultDetail" method, it seems impossible to use a tree for the detail elements :
<detail>
   <why>
        <reason>Because it's out of bound</reason>
    </why>
</detail>

Thanks,
Olivier




Reply via email to