How to pass SOAP service with complex type?


Configure interfaces with third party service and I can't seem to properly pass parameters to it. The service gives error about invalid parameter.

Here's a piece of the WSDL document
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" xmlns:soap12bind="" xmlns:soapbind="" xmlns:tns="" xmlns:wsp="" xmlns:wsu="" xmlns:xsd="" xmlns:xsd1="" xmlns:xsd2="" name="test_name_OS" targetNamespace="">

 <xs:schema xmlns:xs="" xmlns:xs1="" xmlns:xs2="" targetNamespace="" attributeFormDefault="unqualified" elementFormDefault="qualified">
 <xs:complexType name="Parameters">
 <xs:element name="TypeRequest" type="tns:TypeRequest"/>
 <xs:element name="TypeSelect">
 <xs:restriction base="xs:string">
 <xs:enumeration value="Changed"/>
 <xs:enumeration value="Period"/>
 <xs:element name="PeriodStart" type="xs:dateTime" nillable="true" minOccurs="0"/>
 <xs:element name="OnlyGUID" type="xs:boolean" nillable="true" minOccurs="0"/>
 <xs:element name="ExecutionDate" type="xs:date" nillable="true" minOccurs="0"/>
 <xs:simpleType name="TypeRequest">
 <xs:restriction base="xs:string">
 <xs:enumeration value="DocumentRequest"/>
 <xs:enumeration value="ActionRequest"/>
 <xs:element name="GetInfo">
 <xs:element name="Parameters" type="tns:Parameters"/>

 <message name="GetInfoRequestMessage">
 <part name="parameters" element="tns:GetInfo"/>

 <portType name="test_name_OSPortType">
 <operation name="GetInfo">
 <input message="tns:GetInfoRequestMessage"/>

 <binding name="test_name_OSSoap12Binding" type="tns:test_name_OSPortType">
 <operation name="GetInfo">
 <soap12bind:operation style="document" soapAction=""/>
 <soap12bind:body use="literal"/>

 <service name="test_name__OS">
 <port name="test_name__OSSoap12" binding="tns:test_name__OSSoap12Binding">
 <soap12bind:address location=""/>


and php code to execute the method

try {
 $client = new SoapClient("http://service.wsdl", [
 'login' => $login,
 'password' => $password,
 'soap_version' => SOAP_1_2,
 'cache_wsdl' => WSDL_CACHE_NONE,
 'trace' => true,
 'features' => SOAP_USE_XSI_ARRAY_TYPE,
 'use' => SOAP_LITERAL
 $param = [
 "Parameters" => [
 "TypeRequest" => "DocumentRequest",
 "TypeSelect" => "Changed",
 "ExecutionDate" => "2019-12-15",
 $result = $client->GetData($param);

} catch (Exception $e) {
 echo $e->getMessage();

Swears on incorrect parameter "TypeSelect". I understand that I convey it wrong.
How to pass complex types to a SOAP service?

Advance all grateful for the help!!!
April 3rd 20 at 18:42
1 answer
April 3rd 20 at 18:44
$param = [
 "Parameters" => [
 "TypeRequest" => "DocumentRequest",
 "TypeSelect" =>[ 
 "ExecutionDate" => "2019-12-15",
I tried, but the result is the same(( - victoria.Hegmann30 commented on April 3rd 20 at 18:47

$param = [
 "Parameters" => [
 "TypeRequest" =>[ "DocumentRequest"],
 "TypeSelect" =>[ "Changed"],
 "ExecutionDate" => "2019-12-15",


here is a copy of your problem, maybe something will help: - cameron_Lesch commented on April 3rd 20 at 18:50
Thanks, sorry no reply ((( - victoria.Hegmann30 commented on April 3rd 20 at 18:53

Find more questions by tags PHPSOAPWSDLXML