php.net |  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
 [2021-01-22 09:49 UTC] r dot b dot paulson at protonmail dot com
Description:
------------
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:
---------------
https://gist.github.com/tinmrn/7978a170acb65a9f597cbc69e3ae3153

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

Actual result:
--------------
7.4.14
struct directDebitPaymentInput {
 string35 holderName;
 bic bic;
 iban iban;
 string35 mandateNumber;
}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.docdatapayments.com/services/paymentservice/1_3/"><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>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] requinix@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 20:03:17 2021 UTC