Skip to content

ext/soap: GH-21981 auto-encode DateTimeInterface from SoapServer.#21996

Open
devnexen wants to merge 2 commits intophp:masterfrom
devnexen:gh21981
Open

ext/soap: GH-21981 auto-encode DateTimeInterface from SoapServer.#21996
devnexen wants to merge 2 commits intophp:masterfrom
devnexen:gh21981

Conversation

@devnexen
Copy link
Copy Markdown
Member

No description provided.

When a SoapServer handler returns a bare DateTime/DateTimeImmutable
without wrapping it in SoapVar, the encoder dispatched on IS_OBJECT
and emitted xsi:type="SOAP-ENC:Struct" (a serialized object graph)
instead of an xsd:dateTime instant. Hook guess_xml_convert to detect
DateTimeInterface and route to XSD_DATETIME. This only fires on the
unknown-type fallback path; an explicit WSDL-bound encoder still wins.
@devnexen devnexen changed the title Gh21981 ext/soap: GH-21981 auto-encode DateTimeInterface from SoapServer. May 10, 2026
@devnexen devnexen force-pushed the gh21981 branch 2 times, most recently from 98fc02e to 3406fa6 Compare May 10, 2026 12:45
Opt-in, decodes xsd:dateTime/date/time to DateTimeImmutable on both
SoapClient and SoapServer. Typemap entries still take precedence.
@devnexen devnexen marked this pull request as ready for review May 10, 2026 14:22
@devnexen devnexen requested a review from kocsismate as a code owner May 10, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Soap] [DateTime] SoapVar mandatory for Datetime? Also from_xml still needed in SoapClient?

1 participant