[doc-en] master: Document the return value requirement of the SOAP typemap to_xml callback (#6065)

From: Date: Thu, 12 Nov 2026 10:16:19 +0000
Subject: [doc-en] master: Document the return value requirement of the SOAP typemap to_xml callback (#6065)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23940@lists.php.net to get a copy of this message
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-12T11:16:15+01:00 Commit: https://github.com/php/doc-en/commit/3e3ce447badbc0cf74b37a7fcd31b10a3d4c5fba Raw diff: https://github.com/php/doc-en/commit/3e3ce447badbc0cf74b37a7fcd31b10a3d4c5fba.diff Document the return value requirement of the SOAP typemap to_xml callback (#6065) Changed paths: M reference/soap/soapclient/construct.xml M reference/soap/soapserver/construct.xml Diff: diff --git a/reference/soap/soapclient/construct.xml b/reference/soap/soapclient/construct.xml index 4b40a7ec831f..3e6e80f95675 100644 --- a/reference/soap/soapclient/construct.xml +++ b/reference/soap/soapclient/construct.xml @@ -395,6 +395,15 @@ <literal>to_xml</literal> (<type>callable</type> accepting one object parameter and returning a string). </para> + <simpara> + The string returned by <literal>to_xml</literal> must be a + well-formed XML element, which is copied into the SOAP message with + its attributes and children. It must not start with a document type + declaration or a processing instruction. If the callback returns + anything else, such as plain text, a string that cannot be parsed + as XML, or a non-string value, an empty element is sent, and no + error or warning is raised. + </simpara> </listitem> </varlistentry> <varlistentry xml:id="soapclient.construct.options.exceptions"> diff --git a/reference/soap/soapserver/construct.xml b/reference/soap/soapserver/construct.xml index 0884ea9ae02f..0bbe42f17be7 100644 --- a/reference/soap/soapserver/construct.xml +++ b/reference/soap/soapserver/construct.xml @@ -57,6 +57,14 @@ (callback accepting one string parameter) and <literal>to_xml</literal> (callback accepting one object parameter). </para> + <simpara> + The string returned by <literal>to_xml</literal> must be a well-formed + XML element, which is copied into the SOAP message with its attributes + and children. It must not start with a document type declaration or a + processing instruction. If the callback returns anything else, such as + plain text, a string that cannot be parsed as XML, or a non-string + value, an empty element is sent, and no error or warning is raised. + </simpara> <para> The <literal>cache_wsdl</literal> option is one of <constant>WSDL_CACHE_NONE</constant>,

« previous php.doc.cvs (#23940) next »