|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: r dot b dot paulson at protonmail dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 19:01:28 2024 UTC