Skip to content

Commit 7aa1c89

Browse files
committed
SWS-292 in 1.0 branch
1 parent 41457d2 commit 7aa1c89

File tree

1 file changed

+53
-40
lines changed

1 file changed

+53
-40
lines changed

src/docbkx/server.xml

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -915,49 +915,60 @@ public class AnnotationOrderEndpoint {
915915
<para>
916916
Besides implementing the <classname>EndpointExceptionResolver</classname> interface, which is only a
917917
matter of implementing the <methodname>resolveException(MessageContext, endpoint, Exception)</methodname>
918-
method, you may also use one of the default implementations.
918+
method, you may also use one of the provided implementations.
919919
The simplest implementation is the <classname>SimpleSoapExceptionResolver</classname>, which just
920920
creates a SOAP 1.1 Server or SOAP 1.2 Receiver Fault, and uses the exception message as the fault string.
921+
The <classname>SimpleSoapExceptionResolver</classname> is the default, but it can be overriden by
922+
explicitly adding another resolver.
921923
</para>
922-
<para>
923-
The <classname>SoapFaultMappingExceptionResolver</classname> is a more sophisticated implementation.
924-
This resolver enables you to take the class name of any exception that might be thrown and map it to a
925-
SOAP Fault, like so:
926-
</para>
927-
<programlisting><![CDATA[<beans>
924+
<section>
925+
<title><classname>SoapFaultMappingExceptionResolver</classname></title>
926+
<para>
927+
The <classname>SoapFaultMappingExceptionResolver</classname> is a more sophisticated implementation.
928+
This resolver enables you to take the class name of any exception that might be thrown and map it to a
929+
SOAP Fault, like so:
930+
</para>
931+
<programlisting><![CDATA[<beans>
928932
<bean id="exceptionResolver"
929933
class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
930-
<property name="defaultFault" value="SERVER">
931-
</property>
932-
<property name="exceptionMappings">
933-
org.springframework.oxm.ValidationFailureException=CLIENT,Invalid request
934-
</property>
934+
<property name="defaultFault" value="SERVER">
935+
</property>
936+
<property name="exceptionMappings">
937+
org.springframework.oxm.ValidationFailureException=CLIENT,Invalid request
938+
</property>
935939
</bean>
936940
</beans>]]></programlisting>
937-
<para>
938-
The key values and default endpoint use the format <literal>faultCode,faultString,locale</literal>, where
939-
only the fault code is required. If the fault string is not set, it will default to the exception message.
940-
If the language is not set, it will default to English. The above configuration will map exceptions of
941-
type <classname>ValidationFailureException</classname> to a client-side SOAP Fault with a fault string
942-
<literal>"Invalid request"</literal>, as can be seen in the following response:
943-
</para>
944-
<programlisting><![CDATA[<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
941+
<para>
942+
The key values and default endpoint use the format <literal>faultCode,faultString,locale</literal>, where
943+
only the fault code is required. If the fault string is not set, it will default to the exception message.
944+
If the language is not set, it will default to English. The above configuration will map exceptions of
945+
type <classname>ValidationFailureException</classname> to a client-side SOAP Fault with a fault string
946+
<literal>"Invalid request"</literal>, as can be seen in the following response:
947+
</para>
948+
<programlisting><![CDATA[<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
945949
<SOAP-ENV:Body>]]><emphasis role="bold"><![CDATA[
946950
<SOAP-ENV:Fault>
947951
<faultcode>SOAP-ENV:Client</faultcode>
948952
<faultstring>Invalid request</faultstring>
949953
</SOAP-ENV:Fault>]]></emphasis><![CDATA[
950954
</SOAP-ENV:Body>
951955
</SOAP-ENV:Envelope>]]></programlisting>
952-
<para>
953-
If any other exception occurs, it will return the default fault: a server-side fault with the exception
954-
message as fault string.
955-
Finally, it is also possible to annotate exception classes with the <interfacename>@SoapFault</interfacename>
956-
annotation, to indicate the SOAP Fault that should be returned whenever that exception is thrown.
957-
The elements of the annotation include a fault code enumeration, fault string or reason, and language. Here
958-
is an example exception:
959-
</para>
960-
<programlisting><![CDATA[package samples;
956+
<para>
957+
If any other exception occurs, it will return the default fault: a server-side fault with the exception
958+
message as fault string.
959+
</para>
960+
</section>
961+
<section>
962+
<title><classname>SoapFaultAnnotationExceptionResolver</classname></title>
963+
<para>
964+
Finally, it is also possible to annotate exception classes with the
965+
<interfacename>@SoapFault</interfacename> annotation, to indicate the SOAP Fault that should be returned
966+
whenever that exception is thrown. In order for these annotations to be picked up, you need to add the
967+
<classname>SoapFaultAnnotationExceptionResolver</classname> to your application context.
968+
The elements of the annotation include a fault code enumeration, fault string or reason, and language.
969+
Here is an example exception:
970+
</para>
971+
<programlisting><![CDATA[package samples;
961972
962973
import org.springframework.ws.soap.server.endpoint.annotation.FaultCode;
963974
import org.springframework.ws.soap.server.endpoint.annotation.SoapFault;
@@ -969,17 +980,19 @@ public class MyBusinessException extends Exception {
969980
super(message);
970981
}
971982
}]]></programlisting>
972-
<para>
973-
Whenever the <classname>MyBusinessException</classname> is thrown with the constructor string
974-
<literal>"Oops!"</literal> during endpoint invocation, it will result in the following response:
975-
</para>
976-
<programlisting><![CDATA[<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
977-
<SOAP-ENV:Body>
978-
<SOAP-ENV:Fault>
979-
<faultcode>SOAP-ENV:Server</faultcode>
980-
<faultstring>Oops!</faultstring>
981-
</SOAP-ENV:Fault>
982-
</SOAP-ENV:Body>
983+
<para>
984+
</para>
985+
<para>
986+
Whenever the <classname>MyBusinessException</classname> is thrown with the constructor string
987+
<literal>"Oops!"</literal> during endpoint invocation, it will result in the following response:
988+
</para>
989+
<programlisting><![CDATA[<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
990+
<SOAP-ENV:Body>
991+
<SOAP-ENV:Fault>
992+
<faultcode>SOAP-ENV:Server</faultcode>
993+
<faultstring>Oops!</faultstring>
994+
</SOAP-ENV:Fault>
995+
</SOAP-ENV:Body>
983996
</SOAP-ENV:Envelope>]]></programlisting>
984997
</section>
985998
</chapter>

0 commit comments

Comments
 (0)