T
T
Torna2015-07-25 20:19:12
PHP
Torna, 2015-07-25 20:19:12

How to correctly form a soap request?

There is a soap request

<PolicyOptions>
      <ValueInfo>
        <Code>EffectiveDate</Code>
        <Value>2015-08-04T00:00:00+04:00</Value>
      </ValueInfo>
      <ValueInfo>
        <Code>DriversCount</Code>
        <Value>one</Value>
      </ValueInfo>
</PolicyOptions>

It turns out that for the request you need to create an array of this kind
"PolicyOptions" => [
        "ValueInfo" => (object)[
          "Code" => "EffectiveDate",
          "Value" => "2015-08-04T00:00:00+04:00",
        ],
        "ValueInfo" => (object)[
          "Code" => "DriversCount",
          "Value" => "one",
        ],
];

BUT this array is not correct, it has 2 identical keys and at the output I will get only the last key.
Soap operates with objects, maybe there is another form of notation that allows this.
I really need advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Torna, 2015-07-26
@Torn

decision.

[PolicyOptions] => stdClass Object
        (
            [Option] => stdClass Object
                (
                    [Code] => Quote
                    [ValueInfo] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [Code] => EffectiveDate
                                    [Value] => 2015-08-04T00:00:00+04:00
                                )

                            [1] => stdClass Object
                                (
                                    [Code] => DriversCount
                                    [Value] => one
                                )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question