Class SoapFaultFactory
java.lang.Object
com.sap.gateway.ip.core.customdev.processor.SoapFaultFactory
The methods of this class can be used to throw SOAP fault exceptions in a
script step. A prerequisite is that the sender channel is either a SOAP
channel or an XI channel. Especially it is possible to throw an XI SOAP fault
exception that fulfills the XI protocol. The targeted use case is to enrich
error information in a script step if a receiver channel or any other step
that is not SOAP based returns an exception that cannot be directly used to
generate a SOAP fault message. Now such an exception can be caught and
enriched by additional information using a script step. Without such a step
sender SOAP and XI adapter convert this exception to a SOAP fault exception
setting default values for this additional information. The user has here the
possibility to enrich the error information according to his needs and the
sender channels will not convert the exception.
- Author:
- D026992
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidthrowSoapFault(SoapFaultParam param) This method should be used for SOAP sender channels.static voidThis method should be used for SOAP sender channels.static voidthrowXiSoapFault(XiSoapFaultParam param) This method should be used for XI sender channels.
-
Field Details
-
SOAP11_NAMESPACE
- See Also:
-
SOAP12_NAMESPACE
- See Also:
-
-
Method Details
-
throwSoapFault
public static void throwSoapFault(SoapFaultParam param) throws UnknownSoapVersionException, UnknownFaultCodeException This method should be used for SOAP sender channels. It allows setting all attributes the SOAP specification describes. For details see the SOAP specification. Especially the SOAP version can be set. Be aware that there are some differences between SOAP 1.1 and SOAP 1.2, especially SOAP 1.2 only allows certain fault codes.- Parameters:
param- : Object to set all parameters according to the SOAP specification. The parameter detail is expected to be an Element object of a DOM tree. The parameter namespaces can be use to add additional namespace declarations for parameter detail if required.- Throws:
UnknownSoapVersionExceptionUnknownFaultCodeException
-
throwSoapFault
public static void throwSoapFault(String faultstring, Element detail, Map<String, String> namespaces) This method should be used for SOAP sender channels. It provides a minimum set of parameters to just set text parameters. All other parameter are set to defaults. The SOAP version is set to SOAP 1.1.- Parameters:
faultstring- : see also the SOAP specification. This is simple error text.detail- : see also the SOAP specification. Here additional information can be set. The SOAP fault exception object of the SOAP adapter require heres an Element object of a DOM tree.namespaces- : If the detail parameter requires additional namespace declarations then they can be set here.
-
throwXiSoapFault
This method should be used for XI sender channels. It throws a SOAP fault exception that fulfills the XI protocol specification. This specification basically restricts the detail attribute of the SOAP fault to a certain format. For the SOAP adapter this can be freely chosen. In the XI adapter the detail has to follow the the XI error header specification. In addition the SAP category is always set to 'XIServer' and the SAP code is set to 'INTERNAL.MESSAGE'. All other codes and categories are reserved. P1 to P4, additional text and stack can be freely chosen.- Parameters:
param- : Object to set all possible attributes of an XI SOAP fault.- Throws:
XMLStreamException
-