You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by oh <wa...@sm.sony.co.jp> on 2001/07/27 10:19:19 UTC

How to output by throw SOAPException?

I want to output error code/message and detail error message in
my soap service program.

I found that I can output the following message by throwing SOAPException:

------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>1010</faultcode>
            <faultstring>test error</faultstring>
            <faultactor>/is2/soap/servlet/rpcrouter</faultactor>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------------------------------------------------------------

but I need to output message like:

------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>Env:Server</faultcode>
            <faultstring>Server error</faultstring>
            <faultactor>/is2/soap/servlet/rpcrouter</faultactor>
            <detail>
                 <e:myfaultdetails xmlns:e="http://temp.com/faults">
                    <message>ap error1</message>
                    <errorcode>1010</message>
                </e:myfaultdetails>
            </detail>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

------------------------------------------------------------

may be I should define an encoding style by a java class to process
the details?
any suggestions?

Thanks a lot.


Huimin Wang
Globus,Inc Japan