Jump to content

Soap client not sending array


herbrubin

Recommended Posts

I have a mostly working PHP Soap client program. Its fine when using strings to send parameters to the Soap Server.

 

But when I send arrays of objects it acts like an empty array. Here's my request sent:

 

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ActionWebService" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:ConfirmPendingTransfers><transfers xsi:type="SOAP-ENC:Array"/></ns1:ConfirmPendingTransfers></SOAP-ENV:Body></SOAP-ENV:Envelope>

 

Notice the "transfers" array is empty. I've noticed other people run into this empty array problem. My code is this:

 

$res = $client->ConfirmPendingTransfers($transfer_array);

 

Where the contents of $transfer_array is:

 

Telmate\TransferArray Object
(
    [TransferArray:protected] => Array
        (
            [0] => Telmate\Transfer Object
                (
                    [status:protected] => pending

                    [reference_id:protected] =>

                    [source:protected] => Transfer

                    [amount:protected] => -10

                    [telmate_transfer_id:protected] => 702817233

                    [resident_key:protected] => SMC1010-M1

                    [transfer_time:protected] => 2015-06-27T17:22:22-07:00
                )

        )

)

 

This method call requires a TransferArray object. I tried sending a simple array but it rejected it, as it should.

 

Why does the Soap Client think my object is empty? Is this a bug in PHP?

 

Any ideas on how to get past it?

 

 

Link to comment
https://forums.phpfreaks.com/topic/297072-soap-client-not-sending-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.