D
D
Darkhan Kamaliev2021-06-18 07:57:31
PHP
Darkhan Kamaliev, 2021-06-18 07:57:31

How to format this XML in params for soapClient?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loc="http://localhost" xmlns:xdto="http://localhost/xdto">
   <soapenv:Header/>
   <soapenv:Body>
      <loc:PaymentByAcquiring>
         <loc:Invoices>
            <!--Zero or more repetitions:-->
            <xdto:List>
               <xdto:invoice_id>2</xdto:invoice_id>
               <xdto:invoice_date>2020-10-29T00:00:00</xdto:invoice_date>
               <xdto:pay_sum>5000</xdto:pay_sum>
               <xdto:iin>00000000000000</xdto:iin>
               <xdto:id_paynet>2</xdto:id_paynet>
               <xdto:partial_payment>0</xdto:partial_payment>
            </xdto:List>
         </loc:Invoices>
         <loc:Acquirer>test</loc:Acquirer>
         <loc:CheckNumber>1</loc:CheckNumber>
      </loc:PaymentByAcquiring>
   </soapenv:Body>
</soapenv:Envelope>


Tried to do it like this
60cc27acc0ac8920173768.jpeg
But got "message" error: "SOAP-ERROR: Encoding: object has no 'Invoices' property",

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2021-06-18
@toxa82

Most likely you will need to register your types in the "classmap" settings of the soap or even in the "typemap" describe how to turn xml into objects and vice versa in the "to_xml" / "from_xml" keys
https://www.php.net/manual/ro /soapclient.soapclient.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question