A
A
Andrew2020-12-08 14:30:10
PHP
Andrew, 2020-12-08 14:30:10

In what format should data be sent to the 1C web service via PHP?

I have the following method for sending data to the 1C server.

BookAnAppointmentWithParams (EmployeeID[string], PatientSurname[string],
PatientName[string], PatientFatherName[string], Date[dateTime],
TimeBegin[dateTime], Comment[string], Phone[string], Email[string], Address[string],
Clinic[string], GUID[string], Params[Structure])


Request example:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ru="ru.umc" xmlns:core="http://v8.1c.ru/8.1/data/core">
<soap:Header/>
<soap:Body>
<ru: BookAnAppointmentWithParams>
<ru:EmployeeID>ac30e139-3087-11dc-8594-005056c00008</ru:EmployeeID>
<ru:PatientSurname>Иванов</ru:PatientSurname>
<ru:PatientName>Иван</ru:PatientName>
<ru:PatientFatherName>Иванович</ru:PatientFatherName>
<ru:Date>2017-03-17T00:00:00</ru:Date>
<ru:TimeBegin>0001-01-01T13:10:00</ru:TimeBegin>
<ru:Comment>Комментарий</ru:Comment>
<ru:Phone>89876543210</ru:Phone>
<ru:Email>[email protected]</ru:Email>
<ru:Address>Ленина 1</ru:Address>
<ru:Clinic>f679444a-22b7-11df-8618-002618dcef2c</ru:Clinic>
<ru:GUID>9cc6b9fc-0b04-11e7-b13c-00e051000230</ru:GUID>
<ru:Params>
<core:Property name="Birthday">
<core:Value>1980-09-14T00:00:00</core:Value>
</core:Property>
<core:Property name="Duration">
<core:Value>0001-01-01T01:30:00</core:Value>
</core:Property>
</ru:Params>
</ru: BookAnAppointmentWithParams>
</soap:Body>
</soap:Envelope>


I send data in this format:
$this->client->connect->BookAnAppointmentWithParams(
            compact(
                'EmployeeID',
                'PatientSurname',
                'PatientName',
                'PatientFatherName',
                'Date',
                'TimeBegin',
                'Comment',
                'Phone',
                'Email',
                'Address',
                'Clinic',
                'GUID',
                'Params'
            ))->return


Actually in compact there are variables with data. There is a problem with passing the Params variable .

I send it in this form: But information is not received in 1C. The question is: Am I sending the Params parameter correctly? If not, what would be the right way?
$Params = compact('Birthday');


Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-12-08
@manzadey

<ru:Params>
<core:Property name="Birthday">
<core:Value>1980-09-14T00:00:00</core:Value>
</core:Property>
<core:Property name="Duration">
<core:Value>0001-01-01T01:30:00</core:Value>
</core:Property>
</ru:Params>

as if hinting that something like
[
["property"=>["name"=>"Birthday"], "value"=>"1980-09-14T00:00:00"],
["property"=>["name"=>"Duration"], "value"=>"0001-01-01T01:30:00"],
]

and compact must be thrown out, it will never return this.
There is also no description of what is used as a soap client on the 1c side. Built-in SoapClient object or something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question