Hi Tom,

Can you tell exactly what was added?
What if I have my custom exception thrown? How does it know what to put
in DETAIL section?

regards,
Ruslan

-----Original Message-----
From: tomj 
Sent: October 18, 2002 1:16 PM
To: Ruslan Zenin; butek; chappell; dug; igors; nakamury; tomj
Subject: RE: Question about fault code and detail in AXIS 1.0



Try the latest CVS tree or nightly build.
Fault data handling was added post-1.0.

--
Tom Jordahl
Macromedia Server Development



-----Original Message-----
From: Ruslan.Zenin
Sent: Friday, October 18, 2002 11:36 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Question about fault code and detail in AXIS 1.0


Dear AXIS development team,

I'm writing to you as the ones of the authors of  AXIS.

I could not find information anywhere (doc,user lists/groups) on how
correctly to
handle application specific exceptions on AXIS SOAP server side?

I have a dirty trick:
---------
...
    org.apache.xerces.dom.CoreDocumentImpl doc = new
org.apache.xerces.dom.CoreDocumentImpl();
    org.w3c.dom.Element d1 = new
org.apache.xerces.dom.ElementImpl(doc,"myDetail1");
    org.w3c.dom.Element d2 = new
org.apache.xerces.dom.ElementImpl(doc,"myDetail2");
    org.w3c.dom.Element[] buf = new org.w3c.dom.Element[2];
    buf[0] = d1;
    buf[1] = d2;

    if (symbol == null || symbol.lenght == 0)
      throw new AxisFault("MYAPP.SERVER.SYSTEM_ERROR",
                  "SYMBOL IN NOT PROVIDED!",
                  "StockQuoteService", buf);
...
---------
This produces back the expected exception message:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode
xmlns:ns1="http://xml.apache.org/axis/";>ns1:MYAPP.SERVER.SYSTEM_ERROR</f
aultcode>
   <faultstring>SYMBOL IN NOT PROVIDED!</faultstring>
   <faultactor>StockQuoteService</faultactor>
   <detail>
    <myDetail1/>
    <myDetail2/>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>

But I'm not convinced that this is correct way of doing that. (I
understand also that in SOAP1.2 it is more defined - detail items)
In order to achieve this I had to explicitly create AxisFault exception
with populated fields.
This makes my SOAP server AXIS specific.

Is there any way to specify mapping (in WSDD) for my Custom exceptions
to faultcode/faultstring/detail?
So by doing that, I can ensure that my application code will not be
polluted SOAP implementation specific calls.

Or may be I should write and register a HANDLER for AXIS to handle all
my exceptions and transform them in AxisFault?
Do you have any support for that (or planning to have)?
Ideally WSDD should have this ability of mapping (so no code changes in
the app)

I will appreciate your reply.
 
best regards,
Ruslan Zenin



Reply via email to