Bug #80658 [Opn->Csd]: SoapClient ignores element children when the XSD has a "group" include
| From: | r dot b dot paulson at protonmail dot com | Date: | Fri, 22 Jan 2021 11:11:34 +0000 |
| Subject: | Bug #80658 [Opn->Csd]: SoapClient ignores element children when the XSD has a "group" include | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231705@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80658&edit=1
ID: 80658
User updated by: r dot b dot paulson at protonmail dot com
Reported by: r dot b dot paulson at protonmail dot com
Summary: SoapClient ignores element children when the XSD has
a "group" include
-Status: Open
+Status: Closed
Type: Bug
Package: SOAP related
Operating System: Linux
PHP Version: 7.4.14
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2021-01-22 09:49:02] 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>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80658&edit=1