Skip to content

Commit

Permalink
perf: base64 to disk before validation & from disk after response wra…
Browse files Browse the repository at this point in the history
…pping
  • Loading branch information
MLenterman committed Aug 28, 2023
1 parent f1ff11d commit 8cf6ca1
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
active="${GeefZaakdocumentLezen_Lv01.Active}"
description="">

<Receiver name="GeefZaakdocumentLezen_Lv01">
<JavaListener name="GeefZaakdocumentLezen_Lv01"/>
<Receiver
name="GeefZaakdocumentLezen_Lv01"
>
<JavaListener
name="GeefZaakdocumentLezen_Lv01"
returnedSessionKeys="ref_inhoud"
/>
<JdbcErrorStorage
name="JdbcErrorStorage"
datasourceName="jdbc/${database.instance.name}"
Expand Down Expand Up @@ -99,10 +104,13 @@

<SenderPipe
name="CallGetBas64Inhoud"
storeResultInSessionKey="Bas64Inhoud">
storeResultInSessionKey="Bas64Inhoud"
>
<IbisLocalSender
name="CallGetBas64InhoudSender"
javaListener="GetBas64Inhoud">
javaListener="GetBas64Inhoud"
returnedSessionKeys="ref_inhoud"
>
<Param name="Url" xpathExpression="$ZgwEnkelvoudigInformatieObject/ZgwEnkelvoudigInformatieObject/inhoud">
<Param name="ZgwEnkelvoudigInformatieObject" sessionKey="ZgwEnkelvoudigInformatieObject" type="DOMDOC"/>
</Param>
Expand All @@ -111,12 +119,12 @@
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<!-- TODO: Improve error handling for when "GetBas64Inhoud" throws an error -->
<XmlSwitchPipe
name="CheckForGetBas64InhoudResult"
getInputFromFixedValue="&lt;dummy/&gt;"
xpathExpression="string-length($Bas64Inhoud) &gt; 0"
>
<!-- <Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" type="BASE64"/> -->
<Param name="Bas64Inhoud" sessionKey="Bas64Inhoud"/>
<Forward name="true" path="MapZdsZaakDocumentInhoud"/>
<Forward name="false" path="EXCEPTION"/>
Expand Down Expand Up @@ -150,7 +158,6 @@
>
<Param name="ZgwInformatieObjectType" sessionKey="ZgwInformatieObjectType" type="DOMDOC"/>
<Param name="ZgwZaak" sessionKey="GetZgwZaakResult" type="DOMDOC"/>
<!-- <Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" type="BASE64"/> -->
<Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" />
<Forward name="success" path="EXIT"/>
</XsltPipe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Receiver name="GeefZaakdocumentbewerken_Di02">
<JavaListener
name="GeefZaakdocumentbewerken_Di02"
returnedSessionKeys="ZgwLock"
returnedSessionKeys="ZgwLock,ref_inhoud"
/>
<JdbcErrorStorage
name="JdbcErrorStorage"
Expand Down Expand Up @@ -102,10 +102,13 @@

<SenderPipe
name="CallGetBas64Inhoud"
storeResultInSessionKey="Bas64Inhoud">
storeResultInSessionKey="Bas64Inhoud"
>
<IbisLocalSender
name="CallGetBas64InhoudSender"
javaListener="GetBas64Inhoud">
javaListener="GetBas64Inhoud"
returnedSessionKeys="ref_inhoud"
>
<Param name="Url" xpathExpression="$ZgwEnkelvoudigInformatieObject/ZgwEnkelvoudigInformatieObject/inhoud">
<Param name="ZgwEnkelvoudigInformatieObject" sessionKey="ZgwEnkelvoudigInformatieObject" type="DOMDOC"/>
</Param>
Expand All @@ -114,12 +117,12 @@
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<!-- TODO: Improve error handling for when "GetBas64Inhoud" throws an error -->
<XmlSwitchPipe
name="CheckForGetBas64InhoudResult"
getInputFromFixedValue="&lt;dummy/&gt;"
xpathExpression="string-length($Bas64Inhoud) &gt; 0"
>
<!-- <Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" type="BASE64"/> -->
<Param name="Bas64Inhoud" sessionKey="Bas64Inhoud"/>
<Forward name="true" path="MapZdsZaakDocumentInhoud"/>
<Forward name="false" path="EXCEPTION"/>
Expand Down Expand Up @@ -153,7 +156,6 @@
>
<Param name="ZgwInformatieObjectType" sessionKey="ZgwInformatieObjectType" type="DOMDOC"/>
<Param name="ZgwZaak" sessionKey="GetZgwZaakResult" type="DOMDOC"/>
<!-- <Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" type="BASE64"/> -->
<Param name="Bas64Inhoud" sessionKey="Bas64Inhoud" />
<Forward name="success" path="CheckForLock"/>
</XsltPipe>
Expand Down
52 changes: 44 additions & 8 deletions src/main/configurations/Translate/Configuration_GetBas64Inhoud.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
active="${GetBas64Inhoud.Active}"
description="">

<Receiver name="GetBas64Inhoud">
<JavaListener name="GetBas64Inhoud"/>
<Receiver
name="GetBas64Inhoud"
>
<JavaListener
name="GetBas64Inhoud"
returnedSessionKeys="ref_inhoud"
/>
</Receiver>

<Pipeline>
Expand All @@ -13,8 +18,10 @@
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<SenderPipe name="CallGetBas64Inhoud"
getInputFromFixedValue="&lt;dummy/&gt;">
<SenderPipe
name="CallGetBas64Inhoud"
getInputFromFixedValue="&lt;dummy/&gt;"
>
<HttpSender
name="CallGetBas64InhoudSender"
methodType="GET"
Expand All @@ -28,11 +35,17 @@
<Forward name="success" path="EncodeInhoud" />
<Forward name="exception" path="ErrorJsonToXml" />
</SenderPipe>
<JsonPipe name="ErrorJsonToXml">

<JsonPipe
name="ErrorJsonToXml"
>
<Forward name="success" path="buildErrorMsg" />
</JsonPipe>
<XsltPipe name="buildErrorMsg"
styleSheetName="Common/xsl/ParseNegativeHttpResult.xsl">

<XsltPipe
name="buildErrorMsg"
styleSheetName="Common/xsl/ParseNegativeHttpResult.xsl"
>
<Param name="senderPipeName" value="CallGetBas64Inhoud" />
<Forward name="success" path="EXCEPTION" />
</XsltPipe>
Expand All @@ -41,8 +54,31 @@
name="EncodeInhoud"
lineLength="0"
>
<Forward name="success" path="EXIT" />
<Forward name="success" path="Base64ToXml" />
</Base64Pipe>

<Text2XmlPipe
name="Base64ToXml"
xmlTag="inhoud"
>
<Forward name="success" path="StoreInhoud" />
</Text2XmlPipe>

<EchoPipe
name="StoreInhoud"
elementToMove="inhoud"
removeCompactMsgNamespaces="false"
>
<Forward name="success" path="ReplaceInhoudRefWithBase64EncodedRef" />
</EchoPipe>

<!-- Fixed value is "{sessionKey:ref_inhoud}" encoded to base64, so that it remains valid base64 for validation -->
<FixedResultPipe
name="ReplaceInhoudRefWithBase64EncodedRef"
returnString="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
>
<Forward name="success" path="EXIT" />
</FixedResultPipe>
</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@

<JsonPipe name="XmlToJson"
direction="XML2JSON">
<Forward name="success" path="PutZaakDocument"/>
<Forward name="success" path="ReplaceBase64EncodedRefWithInhoudRef"/>
</JsonPipe>

<ReplacerPipe
name="ReplaceBase64EncodedRefWithInhoudRef"
find="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
replace="{sessionKey:ref_inhoud}"
>
<Forward name="success" path="SubstituteDocumentDataRef" />
</ReplacerPipe>

<EchoPipe
name="SubstituteDocumentDataRef"
restoreMovedElements="true"
>
<Forward name="success" path="PutZaakDocument"/>
</EchoPipe>

<SenderPipe name="PutZaakDocument">
<HttpSender
name="PutZaakDocumentSender"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<EchoPipe
name="StoreInhoud"
elementToMove="inhoud"
removeCompactMsgNamespaces="false"
>
<Forward name="success" path="ReplaceInhoudRefWithBase64EncodedRef" />
</EchoPipe>

<ReplacerPipe
name="ReplaceInhoudRefWithBase64EncodedRef"
storeResultInSessionKey="SafeOriginalMessage"
find="{sessionKey:ref_inhoud}"
replace="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
>
<Forward name="success" path="ValidateInput" />
</ReplacerPipe>

<WsdlXmlValidatorPipe
name="ValidateInput"
wsdl="Common/xsd/Zaak_DocumentServices_1_1_02/zkn0310/zs-dms/zkn0310_beantwoordVraag_zs-dms.wsdl"
Expand Down Expand Up @@ -91,6 +108,7 @@
<IbisLocalSender
name="GeefZaakdocumentLezen_Lv01LocalSender"
javaListener="GeefZaakdocumentLezen_Lv01"
returnedSessionKeys="ref_inhoud"
>
<Param name="DocumentIdentificatie" xpathExpression="/*/gelijk/identificatie" type="STRING" />
</IbisLocalSender>
Expand Down Expand Up @@ -156,9 +174,24 @@
<Param name="Stuurgegevens" sessionKey="Stuurgegevens" type="DOMDOC" />
<Param name="Parameters" sessionKey="Parameters" type="DOMDOC" />
<Param name="ZdsZaakDocumentInhoud" sessionKey="ZdsZaakDocumentInhoud" type="DOMDOC" />
<Forward name="success" path="EXIT"/>
<Forward name="success" path="ReplaceBase64EncodedRefWithInhoudRef"/>
</SoapWrapperPipe>

<ReplacerPipe
name="ReplaceBase64EncodedRefWithInhoudRef"
find="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
replace="{sessionKey:ref_inhoud}"
>
<Forward name="success" path="SubstituteDocumentDataRef" />
</ReplacerPipe>

<EchoPipe
name="SubstituteDocumentDataRef"
restoreMovedElements="true"
>
<Forward name="success" path="EXIT" />
</EchoPipe>

<!-- ERRORS -->
<XsltPipe
name="UnsupportedSoapActionError"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<EchoPipe
name="StoreInhoud"
elementToMove="inhoud"
removeCompactMsgNamespaces="false"
>
<Forward name="success" path="ReplaceInhoudRefWithBase64EncodedRef" />
</EchoPipe>

<ReplacerPipe
name="ReplaceInhoudRefWithBase64EncodedRef"
storeResultInSessionKey="SafeOriginalMessage"
find="{sessionKey:ref_inhoud}"
replace="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
>
<Forward name="success" path="ValidateInput" />
</ReplacerPipe>

<WsdlXmlValidatorPipe
name="ValidateInput"
wsdl="Common/xsd/Zaak_DocumentServices_1_1_02/zkn0310/zs-dms/zkn0310_ontvangAsynchroon_mutatie_zs-dms.wsdl"
Expand Down Expand Up @@ -117,6 +134,7 @@
javaListener="VoegZaakdocumentToe_Lk01"
>
</IbisLocalSender>
<Param name="ref_inhoud" sessionKey="ref_inhoud" />
<Forward name="success" path="WrapBv03Response" />
<Forward name="exception" path="BackEndError" />
</SenderPipe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<EchoPipe
name="StoreInhoud"
elementToMove="inhoud"
removeCompactMsgNamespaces="false"
>
<Forward name="success" path="ReplaceInhoudRefWithBase64EncodedRef" />
</EchoPipe>

<ReplacerPipe
name="ReplaceInhoudRefWithBase64EncodedRef"
storeResultInSessionKey="SafeOriginalMessage"
find="{sessionKey:ref_inhoud}"
replace="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
>
<Forward name="success" path="ValidateInput" />
</ReplacerPipe>

<WsdlXmlValidatorPipe
name="ValidateInput"
wsdl="Common/xsd/Zaak_DocumentServices_1_1_02/zkn0310/zs-dms/zkn0310_vrijeBerichten_zs-dms.wsdl"
Expand Down Expand Up @@ -108,7 +125,7 @@
>
<IbisLocalSender
name="GeefZaakdocumentbewerken_Di02LocalSender"
returnedSessionKeys="ZgwLock"
returnedSessionKeys="ZgwLock,ref_inhoud"
javaListener="GeefZaakdocumentbewerken_Di02"
>
<Param name="DocumentIdentificatie" xpathExpression="/*/edcLv01/gelijk/identificatie" type="STRING" />
Expand Down Expand Up @@ -143,6 +160,7 @@
<Param name="ZdsWasInformatieObject" xpathExpression="/*/edcLk02/object[1]" defaultValue="&lt;object/&gt;" type="DOMDOC" />
<Param name="ZdsWordtInformatieObject" xpathExpression="/*/edcLk02/object[2]" defaultValue="&lt;object/&gt;" type="DOMDOC" />
<Param name="Lock" xpathExpression="/*/parameters/checkedOutId" type="STRING" />
<Param name="ref_inhoud" sessionKey="ref_inhoud" />
</IbisLocalSender>
<Forward name="success" path="WrapUpdateZaakDocument_Di02Response"/>
<Forward name="exception" path="EXCEPTION" />
Expand Down Expand Up @@ -177,9 +195,24 @@
<!-- <Param name="Parameters" sessionKey="Parameters" type="DOMDOC"/> -->
<Param name="ZgwLock" sessionKey="ZgwLock" type="DOMDOC" />
<Param name="ZdsZaakDocumentInhoud" sessionKey="ZdsZaakDocumentInhoud" type="DOMDOC" />
<Forward name="success" path="EXIT"/>
<Forward name="success" path="ReplaceBase64EncodedRefWithInhoudRef"/>
</SoapWrapperPipe>

<ReplacerPipe
name="ReplaceBase64EncodedRefWithInhoudRef"
find="e3Nlc3Npb25LZXk6cmVmX2luaG91ZH0="
replace="{sessionKey:ref_inhoud}"
>
<Forward name="success" path="SubstituteDocumentDataRef" />
</ReplacerPipe>

<EchoPipe
name="SubstituteDocumentDataRef"
restoreMovedElements="true"
>
<Forward name="success" path="EXIT" />
</EchoPipe>

<SoapWrapperPipe
name="WrapCheckOutZaakDocument_Di02Response"
getInputFromFixedValue="&lt;EmptyInput/&gt;"
Expand Down Expand Up @@ -220,7 +253,7 @@

<PutInSessionPipe name="NotWellFormed">
<Param name="errorCode" value="NOT_WELL_FORMED_XML"/>
<Param name="errorReason" value="XML was not according to xsd"/>
<Param name="errorReason" value="XML was not according to xsd"/>
<Forward name="success" path="WrapFo03Response"/>
</PutInSessionPipe>

Expand Down
Loading

0 comments on commit 8cf6ca1

Please sign in to comment.