|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80658 SoapClient ignores element children when the XSD has a "group" include
Submitted: 2021-01-22 09:49 UTC Modified: 2021-01-22 15:22 UTC
From: r dot b dot paulson at protonmail dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 7.4.14 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 - 5 = ?
Subscribe to this entry?

 [2021-01-22 09:49 UTC] r dot b dot paulson at protonmail dot com
The WSDL I'm using has a <complexType name="directDebitPaymentInput"> element with a <group ref="ddp:directDebitPaymentInputGroup"> include.

SoapClient understands that this means the resulting directDebitPaymentInput field should include the fields from the group, as well as the direct child element 'mandateNumber'. You can see this in the sample code.

However when I make the actual request, the 'mandateNumber' field is not included in the request XML.

Test script:

Expected result:
I expect the directDebitPaymentInput element to contain the mandateNumber element, as supplied in the input.

Actual result:
struct directDebitPaymentInput {
 string35 holderName;
 bic bic;
 iban iban;
 string35 mandateNumber;
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1=""><SOAP-ENV:Body><ns1:startRequest><ns1:merchant name="bogus" password="bogus"/><ns1:paymentOrderKey>bogus</ns1:paymentOrderKey><ns1:payment><ns1:paymentMethod>bogus</ns1:paymentMethod><ns1:directDebitPaymentInput><ns1:bic>test-bic</ns1:bic><ns1:iban>test-iban</ns1:iban></ns1:directDebitPaymentInput></ns1:payment></ns1:startRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-22 11:11 UTC] r dot b dot paulson at protonmail dot com
-Status: Open +Status: Closed
 [2021-01-22 11:11 UTC] r dot b dot paulson at protonmail dot com
Actually I see that the <group> is part of a <choice>, and so only one of them is required... But when I only supply the mandateNumber, SoapClient dies with:

PHP Fatal error:  Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'iban' property

When I manually send a request that has *only* a mandateNumber element, the service accepts it.

Closing because the problem changed.
 [2021-01-22 15:22 UTC]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Apr 01 15:03:39 2023 UTC