C
C
Chaly952019-08-06 16:03:35
PHP
Chaly95, 2019-08-06 16:03:35

Why doesn't it see the passed SOAP parameters?

Hello
, I am facing the same problem.
I need to add a client to the 1c database using SOAP.
But when I call the function, I get an error

Uncaught SoapFault exception: [soap:Client] Неизвестная ошибка. Недостаточно параметров операции по причине: Недостаточно параметров операции in /1c/test.php:18 Stack trace: #0 /test.php(18): SoapClient->__soapCall('CreateClient', Array) #1 {main} thrown in /home/lenzcars/chaly.xyz/aura/1c/test.php on line 18

The code
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient('http://myhost/A2-TEST/ws/ChatBot?wsdl', array(
    'login' => "mylogin", 'password' => "mypassword"
));
//array(2) {
// [0]=> string(59) "CreateClientResponse CreateClient(CreateClient $parameters)"
// [1]=> string(59) "CreateClientResponse CreateClient(CreateClient $parameters)" }

var_dump($client->__getFunctions());

$params = array('name' => 'testname',  'surname' => 'testsurname', 'phone' => '0660000000',  'ID_bot' => '123456',  'clubID' => '123456');

$xml = $client->__soapCall('CreateClient', $params);

var_dump($xml);
?>

<xs:element name="CreateClient">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" nillable="true"/>
<xs:element name="surname" type="xs:string" nillable="true"/>
<xs:element name="phone" type="xs:string"/>
<xs:element name="ID_bot" type="xs:string"/>
<xs:element name="clubID" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>

This is my first experience with SOAP)
I can't find a solution.
I will be grateful for any help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Chaly95, 2019-08-06
@chaly95

A minute later I found an error))
$xml = $client->__soapCall('CreateClient', array('parameters' => $params));
Instead
of $xml = $client->__soapCall('CreateClient', $params);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question