Skip to content

Decoding exception from valid(?) parameter #597

@Harkonn

Description

@Harkonn

Bug Report

Q A
BC Break yes/no
Version 4.5.0

Summary

The mapping for Code inside of FristtypErweiterbar throws an exception:

Phpro\SoapClient\Exception\SoapException: Failed decoding type Soap\Encoding\Xml\Node\Element as {http://xoev.de/schemata/xzufi/2_2_0:leistungen.antwort.leistung.040104}. Failed at path "parameters.antwort.ergebnis.leistung.modulFrist.frist.typ.code". in Phpro\SoapClient\Exception\SoapException::fromThrowable() (line 19 of projectpath/vendor/phpro/soap-client/src/Phpro/SoapClient/Exception/SoapException.php).

Snipped SOAP responce code for struktur (full code is below):

<xzufi:modulFrist>
	<xzufi:frist>
		<xzufi:typ>
			<xzufi:code listURI="urn:xoev-de:fim:codeliste:xzufi.fristtyp" listVersionID="1.2">
				<code>005</code>
			</xzufi:code>
		</xzufi:typ>

Current behavior

The mapped hierarchy looks good to me. Maybe something is off that i just don't see and understand from the thrown exception. Maybe a type is not getting mapped properly.

class Code
{
    private string $code;
    private ?string $name = null;
    private ?string $listURI = null;
    private ?string $listVersionID = null;

    // more code
class FristtypErweiterbar
{
    private ?namespace\Type\Code $code = null;

    // more code
class FristMitTyp
{
    private namespace\Type\FristtypErweiterbar $typ;

    // more code
}
class Fristmodul extends Leistungsmodul
{
    /**
     * Strukturiert erfasste Fristen zur Leistung
     *
     * @var array<int<0,max>, namespace\Type\FristMitTyp>
     */
    private array $frist;

    // more code
class Leistung
{
    private ?namespace\Type\Fristmodul $modulFrist = null;

    // more code

The generated classmap contains these types, although code is written in lowercase. I don't know if this is important, but changing it to Code did not do anything for me:

    // stripped classmap code
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'FristMitTyp', Type\FristMitTyp::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'FristOhneTyp', Type\FristOhneTyp::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'FristStichtag', Type\FristStichtag::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'von', Type\Von::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'bis', Type\Bis::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'Fristmodul', Type\Fristmodul::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'Fristtyp_Erweiterbar', Type\FristtypErweiterbar::class),
	new ClassMap('http://xoev.de/schemata/xzufi/2_2_0', 'code', Type\Code::class),

How to reproduce

  1. Configure soap-client.php with setTypeReplacementStrategy from Generated types that use enums have wrong parameters #594.
  2. Run ./vendor/bin/soap-client generate:types --config config/soap-client.php for https://xzufi-v2-2-0-nw-schul.infodienste.de/?wsdl (warning: it will generate 1400 files...)
  3. Run ./vendor/bin/soap-client generate:classmap --config config/soap-client.php for https://xzufi-v2-2-0-nw-schul.infodienste.de/?wsdl
  4. Use this snipped Response to start the mapping process:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<xzufi:leistungen.antwort.leistung.040104 xmlns:ns8="http://www.isotc211.org/2005/gts" xmlns:ns7="http://www.isotc211.org/2005/gmd" xmlns:ns6="http://www.isotc211.org/2005/gco" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns4="http://www.opengis.net/gml/3.2" xmlns:xzufi="http://xoev.de/schemata/xzufi/2_2_0" produktbezeichnung="XZufi" produkthersteller="Test" produktversion="3.18.005" xzufiVersion="2.2.0">
			<xzufi:nachrichtenkopf>
				<xzufi:nachrichtUUID>4f04238b-9479-49a3-9618-b464a137b268</xzufi:nachrichtUUID>
				<xzufi:erstelltDatumZeit>2025-11-26T08:58:44.269+01:00</xzufi:erstelltDatumZeit>
				<xzufi:sender>Infodienste Nordrhein-Westfalen (Schul)</xzufi:sender>
			</xzufi:nachrichtenkopf>
			<xzufi:antwort>
				<xzufi:antwortnummer>REQ-TEST-0001</xzufi:antwortnummer>
				<xzufi:antwortrueckgabecode listURI="urn:xoev-de:fim:codeliste:xzufi.nachrichtantwortcode" listVersionID="1.1">
					<code>000</code>
				</xzufi:antwortrueckgabecode>
				<xzufi:anfrage>
					<xzufi:anfragenummer>REQ-TEST-0001</xzufi:anfragenummer>
					<xzufi:zusatzinformation>Manueller Test</xzufi:zusatzinformation>
					<xzufi:suchprofil>
						<xzufi:id schemeAgencyID="GK_LEIKA" schemeID="LEIKA_LEISTUNG_SCHLUESSEL">99085001012000</xzufi:id>
						<xzufi:elementfilterSprache>de</xzufi:elementfilterSprache>
						<xzufi:kennzeichenNurBasisinformation>false</xzufi:kennzeichenNurBasisinformation>
					</xzufi:suchprofil>
				</xzufi:anfrage>
				<xzufi:ergebnis>
					<xzufi:leistung>
						<xzufi:id schemeAgencyID="Test_schemeAgencyID" schemeAgencyName="Test_schemeAgencyName" schemeID="Test_schemeID" schemeName="Test_schemeName">121370768</xzufi:id>
						<xzufi:struktur xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xzufi:LeistungsstrukturObjektMitVerrichtung">
							<xzufi:leistungsgruppierung>
								<xzufi:leistungsgruppierungIndividuell>
									<xzufi:klasse>
										<xzufi:id>LEISTUNGSGRUPPIERUNG</xzufi:id>
										<xzufi:bezeichnung languageCode="de-DE">Individuelle Leistungsgruppierung</xzufi:bezeichnung>
									</xzufi:klasse>
									<xzufi:id schemeID="LEISTUNGSGRUPPIERUNG">085</xzufi:id>
									<xzufi:bezeichnung languageCode="de-DE">Reisepass</xzufi:bezeichnung>
								</xzufi:leistungsgruppierungIndividuell>
							</xzufi:leistungsgruppierung>
							<xzufi:leistungsobjektID>121178548</xzufi:leistungsobjektID>
							<xzufi:verrichtung>
								<xzufi:verrichtungLeiKa listURI="urn:de:fim:leika:verrichtung" listVersionID="20230523">
									<code>012</code>
									<name>Ausstellung</name>
								</xzufi:verrichtungLeiKa>
							</xzufi:verrichtung>
						</xzufi:struktur>
						<xzufi:referenzLeiKa listURI="urn:de:fim:leika:leistung" listVersionID="20240721">
							<code>99085001012000</code>
							<name>Reisepass Ausstellung</name>
						</xzufi:referenzLeiKa>
						<xzufi:modulFrist>
							<xzufi:frist>
								<xzufi:typ>
									<xzufi:code listURI="urn:xoev-de:fim:codeliste:xzufi.fristtyp" listVersionID="1.2">
										<code>005</code>
									</xzufi:code>
								</xzufi:typ>
								<xzufi:fristauswahl>
									<xzufi:fristDauer>
										<xzufi:dauer>6</xzufi:dauer>
										<xzufi:einheit listURI="urn:xoev-de:fim:codeliste:xzufi.zeiteinheit" listVersionID="1.1">
											<code>JAHR</code>
										</xzufi:einheit>
										<xzufi:dauerBis>10</xzufi:dauerBis>
										<xzufi:einheitBis listURI="urn:xoev-de:fim:codeliste:xzufi.zeiteinheit" listVersionID="1.1">
											<code>JAHR</code>
										</xzufi:einheitBis>
									</xzufi:fristDauer>
								</xzufi:fristauswahl>
								<xzufi:beschreibung languageCode="de-DE">- Antragsteller unter 24 Jahre: 6 Jahre
Antragsteller ab 24 Jahre: 10 Jahre</xzufi:beschreibung>
								<xzufi:positionDarstellung>0</xzufi:positionDarstellung>
							</xzufi:frist>
						</xzufi:modulFrist>
					</xzufi:leistung>
				</xzufi:ergebnis>
			</xzufi:antwort>
		</xzufi:leistungen.antwort.leistung.040104>
	</soap:Body>
</soap:Envelope>

Expected behavior

There should be no exception :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions