How to pass SOAP service with complex type?

Hello!

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="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12bind="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.test.ru/xdto_UH_BP" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://www.test.ru/xdto_UH_BP" xmlns:xsd2="http://www.test.ru/xdto_NSI" name="test_name_OS" targetNamespace="http://www.test.ru/xdto_UH_BP">

<types>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xs1="http://www.test.ru/xdto_NSI" xmlns:xs2="http://www.test.ru/xdto_UH_BP" targetNamespace="http://www.test.ru/xdto_UH_BP" attributeFormDefault="unqualified" elementFormDefault="qualified">
 <xs:complexType name="Parameters">
<xs:choice>
 <xs:element name="TypeRequest" type="tns:TypeRequest"/>
 <xs:element name="TypeSelect">
<xs:simpleType>
 <xs:restriction base="xs:string">
 <xs:enumeration value="Changed"/>
 <xs:enumeration value="Period"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
 <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:choice>
</xs:complexType>
 <xs:simpleType name="TypeRequest">
 <xs:restriction base="xs:string">
 <xs:enumeration value="DocumentRequest"/>
 <xs:enumeration value="ActionRequest"/>
</xs:restriction>
</xs:simpleType>
 <xs:element name="GetInfo">
<xs:complexType>
<xs:sequence>
 <xs:element name="Parameters" type="tns:Parameters"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>

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

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

 <binding name="test_name_OSSoap12Binding" type="tns:test_name_OSPortType">
 <operation name="GetInfo">
 <soap12bind:operation style="document" soapAction="http://www.test.ru/xdto_UH_BP#test_name_OS:GetInfo"/>
<input>
 <soap12bind:body use="literal"/>
</input>
</operation>
</binding>

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

</definitions>

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
Tried:
$param = [
 "Parameters" => [
 "TypeRequest" => "DocumentRequest",
 "TypeSelect" =>[ 
"Changed"
],
 "ExecutionDate" => "2019-12-15",
]
 ];
I tried, but the result is the same(( - victoria.Hegmann30 commented on April 3rd 20 at 18:47
@victoria.Hegmann30,

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

?

here is a copy of your problem, maybe something will help:
https://stackoverflow.com/questions/20694843/enume... - 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