Skip to content

Commit

Permalink
feat: overhaul error handling
Browse files Browse the repository at this point in the history
- Messages now contain a clearer format with a new element.
- Many pipes are replaced by two pipes instead.
- Now uses a single XSLT.
- Removal of excess documents.
  • Loading branch information
DelanoWAF committed Jul 6, 2023
1 parent 887c2d3 commit a916d3c
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 366 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL

<SoapWrapperPipe name="Unwrapper" direction="UNWRAP" removeOutputNamespaces="true">
<Forward name="success" path="CheckOperation" />
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="SoapWrapper" />
</SoapWrapperPipe>

<XmlSwitchPipe
Expand Down Expand Up @@ -89,7 +89,7 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL
javaListener="VersionAction">
</IbisLocalSender>
<Forward name="success" path="SUCCESS" />
<Forward name="exception" path="BackEndError" />
<Forward name="exception" path="SoapWrapper" />
</SenderPipe>

<SenderPipe
Expand All @@ -99,7 +99,7 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL
javaListener="opslaanInkNatuurlijkPersoon">
</IbisLocalSender>
<Forward name="success" path="SUCCESS" />
<Forward name="exception" path="WrapFo03ResponseNew" />
<Forward name="exception" path="SoapWrapper" />
</SenderPipe>

<SenderPipe
Expand All @@ -109,14 +109,14 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL
javaListener="opslaanInkNietNatuurlijkPersoon">
</IbisLocalSender>
<Forward name="success" path="SUCCESS" />
<Forward name="exception" path="WrapFo03ResponseNew" />
<Forward name="exception" path="SoapWrapper" />
</SenderPipe>

<!-- OperationChecker adds a few random variables on top of the message.
To mitigate this, we get the originalMessage and unwrap it. -->
<SoapWrapperPipe name="UnwrapBijlageRequest" direction="UNWRAP" removeOutputNamespaces="true" getInputFromSessionKey="originalMessage">
<Forward name="success" path="CallopslaanBijlage" />
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="SoapWrapper" />
</SoapWrapperPipe>

<SenderPipe
Expand All @@ -126,7 +126,7 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL
javaListener="opslaanBijlage">
</IbisLocalSender>
<Forward name="success" path="SUCCESS" />
<Forward name="exception" path="WrapFo03ResponseNew" />
<Forward name="exception" path="SoapWrapper" />
</SenderPipe>

<SenderPipe
Expand All @@ -136,33 +136,12 @@ Attribuut name is nodig om een zinnige operation name=... te krijgen in de WSDL
javaListener="InfoAction">
</IbisLocalSender>
<Forward name="success" path="SUCCESS" />
<Forward name="exception" path="WrapFo03ResponseNew" />
<Forward name="exception" path="SoapWrapper" />
</SenderPipe>

<SoapWrapperPipe
name="WrapFo03ResponseNew"
soapBodyStyleSheet="xsl/CreateFo03ResponseNew.xslt"
>
<Forward name="success" path="SUCCESS" />
</SoapWrapperPipe>

<PutInSessionPipe name="BackEndError" unlessSessionKey="errorCode">
<Param name="errorCode" styleSheetName="xsl/BackEndError.xsl" />
<Param name="errorReason" xpathExpression="/error/reason"/>
<Param name="errorDetailText" xpathExpression="concat(/error/code, ' ', /error/reason, ' ', /error/details)"/>
<Forward name="success" path="WrapFo03Response" />
</PutInSessionPipe>

<SoapWrapperPipe
name="WrapFo03Response"
soapBodyStyleSheet="xsl/CreateFo03Response.xslt"
>
<Param name="errorCode" sessionKey="errorCode" />
<Param name="errorReason" sessionKey="errorReason"/>
<Param name="errorDetailText" sessionKey="errorDetailText"/>
<Forward name="success" path="SUCCESS" />
<SoapWrapperPipe name="SoapWrapper">
<Forward name="success" path="EXCEPTION" />
</SoapWrapperPipe>

</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Localhost URL so testing can be done with the SoapUI Mockservice.
corsa.url=http://localhost:8080/

stub4testtool.configuration=true
stub4testtool.configuration=false
33 changes: 33 additions & 0 deletions configurations/WebformulierenVerwerker/xsl/CreateErrorResponse.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" />
<xsl:param name="corsaRequest" select="''" as="xs:string" />
<xsl:param name="corsaResponse" select="''" as="xs:string" />
<xsl:param name="soapAction" select="''" as="xs:string" />
<xsl:param name="corsaErrorMessage" as="xs:string" />

<xsl:template match="/">
<Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>
<xsl:value-of select="$corsaErrorMessage" />
</faultstring>
<detail>
<xsl:value-of
select="
concat(
concat(
concat(
concat(codepoints-to-string(10),'Soap Action: '),
$soapAction),
concat(
concat(codepoints-to-string(10),'Request: '),
$corsaRequest)),
concat(
concat(codepoints-to-string(10),'Response: '),
$corsaResponse))" />
</detail>
</Fault>
</xsl:template>
</xsl:stylesheet>
25 changes: 0 additions & 25 deletions configurations/WebformulierenVerwerker/xsl/CreateFo03Response.xslt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit a916d3c

Please sign in to comment.