Skip to content

Stdlib: SoapClient encodes SoapVar as property bag — Zend unwraps enc_value + XSD xsi:type (ext/soap/php_encoding.c) #32190

Description

@PurHur

Category

stdlib · php-src-strict · child of #3724

Problem

SoapVar arguments to SoapClient::__soapCall() are exported as enc_* property bags and then encoded as a nested struct. Zend master_to_xml_int() unwraps enc_value and applies get_conversion(enc_type) (php-src ext/soap/php_encoding.c).

Repro Zend 8.2+ (php_encoding.c) VM (2026-08-18)
new SoapVar(123, XSD_STRING) <param0 xsi:type="xsd:string">123</param0> <param0><enc_type xsi:type="xsd:int">101</enc_type><enc_value …>123</enc_value>…</param0>

Reflection probe of VmSoapClient::encodeParam on the exported bag:

<param0><enc_type xsi:type="xsd:int">101</enc_type><enc_value xsi:type="xsd:int">123</enc_value><enc_stype xsi:nil="true"/>…</param0>

soapVarShape() currently requires enc_stype, so new SoapVar($v, XSD_STRING) (no typeName) is not recognized as a SoapVar.

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_soapvar_xsd_enc_type.php'
# host php-soap required to advertise SoapClient; unit test covers encodeParam without it

Done when

  • SoapVar(123, XSD_STRING) encoded request contains xsi:type="xsd:string" and text 123 (no enc_type/enc_value child elements)
  • Scalar XSD types used in encoded RPC (XSD_STRING, XSD_INT, XSD_BOOLEAN, XSD_FLOAT, XSD_BASE64BINARY, XSD_HEXBINARY) match Zend to_xml_*
  • Compliance .phpt under test/compliance/cases/stdlib/
  • php-src-strict; no php-compiler-strict shortcut
  • VM (+ unit encodeParam). AOT when soap advertised

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions