axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Carklin <>
Subject returning a fault with message style
Date Thu, 05 Aug 2004 13:50:03 GMT
I am using the message style. I have the following method:
public Document processRequest(Document doc) {
        Document res_dom_doc = null;
        try {
            My_Message msg = new My_Message(doc);
            MyConnectionToExternalSystem conn =
            My_Message res = conn.sendAndReceiveMessage(msg, 45000);
            res_dom_doc = res.getMsgAsDOMDocument();
        } catch( Exception e ) {
        return res_dom_doc;

If all goes well on my external system, this works perfectly.
Sometimes the returned Document is a custom fault which I need to return
to the client as a SOAP Fault. I added this code to help:
SOAPBody sb =
SOAPFault fault = sb.addFault();
fault.setFaultString(whatever the string is);
But now I need to add the res_dom_doc, returned by my external system,
as a child of the <detail> element of the soap fault. Can anyone please
explain how I can do this? Using the code above, an empty detail element
in returned and the res_dom_doc xml comes after the closing tag of
soapfault ( </soapenv:Fault> ).


View raw message