Answer the question
In order to leave comments, you need to log in
How to generate a SOAP request in PHP with multiple parameters with the same name?
I need to generate a SOAP request of this kind, where the status parameter is repeated several times with different values:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ns1:SomeRequest enddate="01-01-2018 00:00:00" authCode="exampleexample">
<ns1:status>STATUS1</ns1:status>
<ns1:status>STATUS2</ns1:status>
</ns1:SomeRequest>
</soapenv:Body>
</soapenv:Envelope>
$this->client = new SoapClient($this->wsdlUrl, [
'trace' => true,
'exception' => true,
'cache_wsdl' => WSDL_CACHE_NONE,
]);
$parameters = [
'authCode' => 'exampleexample',
'enddate' => '01-01-2018 00:00:00',
'status' => ['STATUS1', 'STATUS2']
];
$response = $this->client->SomeSimpleMethod($parameters);
$parameters = [
'authCode' => 'exampleexample',
'enddate' => '01-01-2018 00:00:00',
'status' => 'STATUS1'
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question