Skip to content

Commit

Permalink
refactor: scaffold zds 1.2 soap-endpoint BeantwoordVraag (#134)
Browse files Browse the repository at this point in the history
* Implement "genereerBesluitIdentificatie_Di02" SOAP-action

* add besluit to configmap and add soapTestCase

* refactor VrijeBerichten_v2 soapendpointrouter to use new template

* Add SoapEndPointRouter template

* Add SwitchPipe

* Add  ontvangAsynchroon_v2 to Configmap.yaml

* Add Propper exception handling
  • Loading branch information
MikeErkemey authored Jul 27, 2023
1 parent 1ebc868 commit efdcb33
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/zaakbrug/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ data:
zaakbrug.soap.ontvang-asynchroon.endpoint: {{ .endpoint }}
zaakbrug.soap.ontvang-asynchroon.validation-soft-fail: "{{ .validationSoftFail }}"
{{- end }}
{{- with .ontvangAsynchroon_v2 }}
zaakbrug.soap.ontvang-asynchroon.v2.endpoint: {{ .endpoint }}
zaakbrug.soap.ontvang-asynchroon.v2.validation-soft-fail: "{{ .validationSoftFail }}"
{{- end }}
{{- with .vrijeBerichten }}
zaakbrug.soap.vrije-berichten.endpoint: {{ .endpoint }}
zaakbrug.soap.vrije-berichten.validation-soft-fail: "{{ .validationSoftFail }}"
Expand Down
3 changes: 3 additions & 0 deletions charts/zaakbrug/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ zaakbrug:
beantwoordVraag:
endpoint: "translate/generic/zds/BeantwoordVraag"
validationSoftFail: false
beantwoordVraag_v2:
endpoint: "translate/generic/zds/v2/BeantwoordVraag"
validationSoftFail: false
ontvangAsynchroon:
endpoint: "translate/generic/zds/OntvangAsynchroon"
validationSoftFail: false
Expand Down
2 changes: 2 additions & 0 deletions src/main/configurations/Translate/Configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<!ENTITY PutZgwZaakDocument SYSTEM "./Configuration_PutZgwZaakDocument.xml">
<!ENTITY SetResultaatAndStatus SYSTEM "./Configuration_SetResultaatAndStatus.xml">
<!ENTITY SoapEndpointRouter_BeantwoordVraag SYSTEM "./Configuration_SoapEndpointRouter_BeantwoordVraag.xml">
<!ENTITY SoapEndpointRouter_BeantwoordVraag_v2 SYSTEM "./Configuration_SoapEndpointRouter_BeantwoordVraag_v2.xml">
<!ENTITY SoapEndpointRouter_OntvangAsynchroon SYSTEM "./Configuration_SoapEndpointRouter_OntvangAsynchroon.xml">
<!ENTITY SoapEndpointRouter_VrijeBerichten SYSTEM "./Configuration_SoapEndpointRouter_VrijeBerichten.xml">
<!ENTITY SoapEndpointRouter_VrijeBerichten_v2 SYSTEM "./Configuration_SoapEndpointRouter_VrijeBerichten_v2.xml">
Expand Down Expand Up @@ -119,6 +120,7 @@
&PutZgwZaakDocument;
&SetResultaatAndStatus;
&SoapEndpointRouter_BeantwoordVraag;
&SoapEndpointRouter_BeantwoordVraag_v2;
&SoapEndpointRouter_OntvangAsynchroon;
&SoapEndpointRouter_VrijeBerichten;
&SoapEndpointRouter_VrijeBerichten_v2;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../FrankConfig.xsd">
<Adapter name="SoapEndpointRouter_BeantwoordVraag_v2"
active="${SoapEndpointRouter_BeantwoordVraag_v2.Active}"
description="">
<Receiver name="SoapEndpointRouter_BeantwoordVraag_v2">
<WebServiceListener name="SoapEndpointRouter_BeantwoordVraag_v2" address="${zaakbrug.soap.beantwoord-vraag.v2.endpoint}" soap="false"/>
<JdbcErrorStorage
name="JdbcErrorStorage"
datasourceName="jdbc/${database.instance.name}"
slotId="${instance.name}/beantwoordVraag_v2"/>
</Receiver>
<Pipeline>
<Exits>
<Exit name="EXIT" state="SUCCESS"/>
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<WsdlXmlValidatorPipe
name="ValidateInput"
wsdl="Common/xsd/Zaak-_Documentservices_1_2/zds0120/berichten/zds0120_beantwoordVraag_zs-dms.wsdl"
>
<Forward name="success" path="UnwrapSoapMessage"/>
<Forward name="failure" path="WsdlValidationSoftFailForwarder"/>
</WsdlXmlValidatorPipe>

<XmlSwitchPipe
name="WsdlValidationSoftFailForwarder"
xpathExpression="$SoftFail = true()"
>
<Param name="SoftFail" value="${zaakbrug.soap.beantwoord-vraag.v2.validation-soft-fail}" type="BOOLEAN"/>
<Forward name="true" path="UnwrapSoapMessage" />
<Forward name="false" path="InvalidXml" />
</XmlSwitchPipe>

<SoapWrapperPipe
name="UnwrapSoapMessage"
storeResultInSessionKey="UnwrapMessageResult"
direction="UNWRAP"
removeOutputNamespaces="true">
<Forward name="success" path="SanitizeSoapAction"/>
</SoapWrapperPipe>

<XsltPipe
name="SanitizeSoapAction"
xpathExpression="replace($Action, '/', '_')"
storeResultInSessionKey="SatitizedSoapAction"
>
<Param name="Action" sessionKey="SOAPAction"/>
<Forward name="success" path="ActionSwitch"/>
<Forward name="error" path="BackEndError"/>
</XsltPipe>

<XmlSwitchPipe name="ActionSwitch"
forwardNameSessionKey="SatitizedSoapAction"
notFoundForwardName="UnsupportedSoapActionError"
/>

<!-- SenderPipes -->

<!-- SoapWrapperPipes -->

<!-- ERRORS -->
<XsltPipe
name="UnsupportedSoapActionError"
emptyInputReplacement="&lt;EmptyInput/&gt;"
styleSheetName="Common/xsl/BuildError.xsl"
>
<Param name="code" value="TechnicalError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="reason" pattern="Unsupported SOAP-action. No implementation found for: {SOAPAction}" />
<!-- <Param name="details" sessionKey="" /> -->
<!-- <Param name="detailsXml" type="DOMDOC" /> -->
<Forward name="success" path="BackEndError" />
<Forward name="exception" path="BackEndError" />
</XsltPipe>

<PutInSessionPipe name="InvalidXml">
<Param name="errorCode" value="INVALID_XML"/>
<Param name="errorReason" value="XML was invalid"/>
<Forward name="success" path="WrapFo03Response" />
</PutInSessionPipe>

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

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

<SoapWrapperPipe
name="WrapFo03Response"
soapBodyStyleSheet="Common/xsl/CreateFo03Response.xslt"
>
<Param name="UnwrapMessageResult" sessionKey="UnwrapMessageResult" type="DOMDOC"/>
<Param name="errorCode" sessionKey="errorCode"/>
<Param name="errorReason" sessionKey="errorReason"/>
<Param name="errorDetailText" sessionKey="errorDetailText"/>
<Param name="errorDetailXML" sessionKey="errorDetailXML" type="DOMDOC"/>
<Forward name="success" path="EXIT"/>
</SoapWrapperPipe>
</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@
>
<Param name="Action" sessionKey="SOAPAction"/>
<Forward name="success" path="ActionSwitch"/>
<Forward name="error" path="EXCEPTION"/>
<Forward name="error" path="BackEndError"/>
</XsltPipe>

<XmlSwitchPipe name="ActionSwitch"
forwardNameSessionKey="SanitizedSoapAction"
notFoundForwardName="UnsupportedSoapActionError"
/>

<SenderPipe
Expand Down Expand Up @@ -81,6 +82,18 @@


<!-- ERRORS -->
<XsltPipe
name="UnsupportedSoapActionError"
emptyInputReplacement="&lt;EmptyInput/&gt;"
styleSheetName="Common/xsl/BuildError.xsl"
>
<Param name="code" value="TechnicalError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="reason" pattern="Unsupported SOAP-action. No implementation found for: {SOAPAction}" />
<!-- <Param name="details" sessionKey="" /> -->
<!-- <Param name="detailsXml" type="DOMDOC" /> -->
<Forward name="success" path="BackEndError" />
<Forward name="exception" path="BackEndError" />
</XsltPipe>
<PutInSessionPipe name="InvalidXml">
<Param name="errorCode" value="INVALID_XML"/>
<Param name="errorReason" value="XML was invalid"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PostZgwLock.Active=true
PutZgwZaakDocument.Active=true
SetResultaatAndStatus.Active=true
SoapEndpointRouter_BeantwoordVraag.Active=true
SoapEndpointRouter_BeantwoordVraag_v2.Active=true
SoapEndpointRouter_OntvangAsynchroon.Active=true
SoapEndpointRouter_VrijeBerichten.Active=true
SoapEndpointRouter_VrijeBerichten_v2.Active=true
Expand Down Expand Up @@ -99,6 +100,9 @@ zaakbrug.zgw.besluit-identificatie-template=BS{datetime:[Y0001]}-{id:D5}
zaakbrug.soap.beantwoord-vraag.endpoint=translate/generic/zds/BeantwoordVraag
zaakbrug.soap.beantwoord-vraag.validation-soft-fail=false

zaakbrug.soap.beantwoord-vraag.v2.endpoint=translate/generic/zds/v2/BeantwoordVraag
zaakbrug.soap.beantwoord-vraag.v2.validation-soft-fail=false

zaakbrug.soap.ontvang-asynchroon.endpoint=translate/generic/zds/OntvangAsynchroon
zaakbrug.soap.ontvang-asynchroon.validation-soft-fail=false

Expand Down

0 comments on commit efdcb33

Please sign in to comment.