aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java8
-rw-r--r--src/main/resources/mzs/app2mzs.xsd4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java
index 0a3afb5..0e01e03 100644
--- a/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java
+++ b/src/main/java/at/gv/egiz/moazs/scheme/Msg2MzsConverter.java
@@ -21,6 +21,7 @@
*******************************************************************************/
package at.gv.egiz.moazs.scheme;
+import at.gv.egiz.moazs.util.NullCoalesce;
import at.gv.zustellung.app2mzs.xsd.DeliveryNotificationType;
import at.gv.zustellung.app2mzs.xsd.*;
import at.gv.zustellung.msg.xsd.*;
@@ -89,6 +90,7 @@ public class Msg2MzsConverter {
}
private ErrorType convert(DeliveryRequestStatusType.Error error, Optional<byte[]> signedStatus, RelayedViaERV relayed) {
+
var builder = errorTypeBuilder()
.withAppDeliveryID(error.getAppDeliveryID())
.withDeliverySystem(error.getDeliverySystem())
@@ -97,9 +99,9 @@ public class Msg2MzsConverter {
.withSignedDeliveryRequestStatus(signedStatus.orElse(null))
.withPreAdviceNoteSent(error.getPreAdviceNoteSent())
.withRelayedViaERV(relayed)
- .withCode(new BigInteger(error.getErrorInfo().getCode()));
+ .withCode(error.getErrorInfo().getCode());
- if(error.getErrorInfo().getText() != null) builder.withText(error.getErrorInfo().getText());
+ if (error.getErrorInfo().getText() != null) builder.withText(error.getErrorInfo().getText());
return builder.build();
}
@@ -142,7 +144,7 @@ public class Msg2MzsConverter {
.withZSDeliveryID(msgNotification.getZSDeliveryID())
.withGZ(msgNotification.getGZ())
.withSignedDeliveryRequestStatus(signedNotification.orElse(null))
- .withCode(new BigInteger(error.getErrorInfo().getCode()))
+ .withCode(error.getErrorInfo().getCode())
.withText(error.getErrorInfo().getText())
.build();
}
diff --git a/src/main/resources/mzs/app2mzs.xsd b/src/main/resources/mzs/app2mzs.xsd
index c188faa..6a4ffda 100644
--- a/src/main/resources/mzs/app2mzs.xsd
+++ b/src/main/resources/mzs/app2mzs.xsd
@@ -238,7 +238,7 @@
<xs:complexContent>
<xs:extension base="MessageType">
<xs:sequence>
- <xs:element name="Code" type="xs:integer"/>
+ <xs:element name="Code" type="xs:string"/>
<xs:element name="Text" type="xs:string"/>
<xs:element ref="msg:PreAdviceNoteSent" minOccurs="0"/>
</xs:sequence>
@@ -252,7 +252,7 @@
<xs:sequence>
<xs:element ref="AppDeliveryID"/>
<xs:element ref="msg:DeliverySystem"/>
- <xs:element ref="msg:ZSDeliveryID" />
+ <xs:element ref="msg:ZSDeliveryID" minOccurs="0" />
<xs:element ref="msg:GZ" minOccurs="0"/>
<xs:element ref="msg:RelayedViaERV" minOccurs="0"/>
<xs:element name="SignedDeliveryRequestStatus" type="xs:base64Binary" minOccurs="0"/>