Имя: Пароль:
1C
Веб-мастеринг
веб-сервис
0 sergwii
 
16.05.14
13:17
Добрый день.
Делаем веб-сервис, с которого 1с будет забирать данные.
Столкнулись с проблемой, 1с не хочет работать со списками...

wsdl:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; name="services_avia_bookings" targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/">;
  <types>
    <schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns="http://www.w3.org/2001/XMLSchema">;
      <xsd:complexType name="booking">
        <xsd:sequence>
          <xsd:element name="reservation_code" type="xsd:string"/>
          <xsd:element name="created_at" type="xsd:dateTime"/>
          <xsd:element name="paid_at" type="xsd:dateTime"/>
          <xsd:element name="validating_airline_code" type="xsd:string"/>
          <xsd:element name="payer_fullname" type="xsd:string"/>
          <xsd:element name="airlines_deduction" type="xsd:int"/>
          <xsd:element name="comission_fee" type="xsd:int"/>
          <xsd:element name="total_price" type="xsd:int"/>
          <xsd:element name="payment_gateway" type="xsd:string"/>
          <xsd:element name="passenger_fullname" type="xsd:string"/>
          <xsd:element name="passengers" type="tns:passengers"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="passengers">
        <xsd:sequence>
          <xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="passenger">
        <xsd:sequence>
          <xsd:element name="name" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </schema>
  </types>
  <portType name="services_avia_bookings_port">
    <operation name="for_period">
      <input message="tns:for_period"/>
      <output message="tns:for_period_response"/>
    </operation>
    <operation name="by_reservation_code">
      <input message="tns:by_reservation_code"/>
      <output message="tns:by_reservation_code_response"/>
    </operation>
  </portType>
  <binding name="services_avia_bookings_binding" type="tns:services_avia_bookings_port">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>;
    <operation name="for_period">
      <soap:operation soapAction="for_period"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
    <operation name="by_reservation_code">
      <soap:operation soapAction="by_reservation_code"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
  </binding>
  <service name="service">
    <port name="services_avia_bookings_port" binding="tns:services_avia_bookings_binding">
      <soap:address location="https://xxx.com/bookings/action"/>;
    </port>
  </service>
  <message name="for_period">
    <part name="paid_at_from" type="xsd:date"/>
    <part name="paid_at_to" type="xsd:date"/>
  </message>
  <message name="for_period_response">
    <part name="value" type="xsd:string"/>
  </message>
  <message name="by_reservation_code">
    <part name="reservation_code" type="xsd:string"/>
  </message>
  <message name="by_reservation_code_response">
    <part name="booking" type="tns:booking" xsi:minOccurs="0" xsi:maxOccurs="unbounded"/>
  </message>
</definitions>
[/code]
1 Чайник Рассела
 
16.05.14
13:18
сочувствую
2 sergwii
 
16.05.14
13:19
Ответ сервиса:
[code]
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/">;
   <soap:Body>
      <tns:by_reservation_code_response>
         <booking xsi:type="tns:booking">
            <reservation_code xsi:type="xsd:string">27ВВВВ</reservation_code>
            <created_at xsi:type="xsd:dateTime">2014-02-10 09:01:45 UTC</created_at>
            <paid_at xsi:type="xsd:dateTime">2014-02-21 12:37:37 UTC</paid_at>
            <validating_airline_code xsi:type="xsd:string">PS</validating_airline_code>
            <payer_fullname xsi:type="xsd:string">serg</payer_fullname>
            <airlines_deduction xsi:type="xsd:int">11</airlines_deduction>
            <comission_fee xsi:type="xsd:int">11</comission_fee>
            <total_price xsi:type="xsd:int">11</total_price>
            <payment_gateway xsi:type="xsd:string">11</payment_gateway>
            <passenger_fullname xsi:type="xsd:string">11</passenger_fullname>
            <passengers xsi:type="tns:passengers">
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">ADULT SOME</name>
               </passenger>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">ADULT WERWER</name>
               </passenger>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">SOME ADULT</name>
               </passenger>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">INFANT ASDDF</name>
               </passenger>
            </passengers>
         </booking>
      </tns:by_reservation_code_response>
   </soap:Body>
</soap:Envelope>
[/code]

1с ругается:
{Форма.Форма.Форма(8)}: Помилка при виклику методу контексту (by_reservation_code)
ДанныеОБроне = ServBooking.by_reservation_code(Об);
через:
Помилка виклику операції сервісу:  {http://schemas.xmlsoap.org/wsdl/soap12/}:service:by_reservation_code()
через:
Невідома помилка. Невідповідність типів XDTO:
Властивість є списковим
через:
Невідповідність типів XDTO:
Властивість є списковим

я так понимаю из-за passengers

или если несколько элементов booking:
{Форма.Форма.Форма(8)}: Помилка при виклику методу контексту (by_reservation_code)
ДанныеОБроне = ServBooking.by_reservation_code(Об);
через:
Помилка виклику операції сервісу:  {http://schemas.xmlsoap.org/wsdl/soap12/}:service:by_reservation_code()
через:
Невідома помилка. Занадто багато параметрів операції
через:
Занадто багато параметрів операції
3 Чайник Рассела
 
16.05.14
13:23
да вы, что издеваетесь что ли?
4 sergwii
 
16.05.14
13:26
??
5 Sabron
 
16.05.14
13:27
(4) Да не....  мы все легко понимаем  украинский язык (мову)
6 DmitrO
 
16.05.14
13:57
ИМХО
с passengers все нормально..
а проблема тут:
<message name="by_reservation_code_response">
    <part name="booking" type="tns:booking" xsi:minOccurs="0" xsi:maxOccurs="unbounded"/>
  </message>

Дело в том что модель веб-сервисов 1с не может иметь у методов веб-сервиса параметры и возвращаемые значения непосредственно списочного типа.
Надо обязательно делать комплексный тип, который уже может иметь свойства списочного типа.

Немного измените схему и все получится.
7 sergwii
 
16.05.14
14:02
т.е. что то типа этого?
[code]
<types><schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"><xsd:complexType name="bookings"><xsd:sequence><xsd:element name="booking" type="tns:booking" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="booking"><xsd:sequence><xsd:element name="reservation_code" type="xsd:string"/><xsd:element name="created_at" type="xsd:dateTime"/><xsd:element name="paid_at" type="xsd:dateTime"/><xsd:element name="validating_airline_code" type="xsd:string"/><xsd:element name="payer_fullname" type="xsd:string"/><xsd:element name="payment_gateway" type="xsd:string"/><xsd:element name="airlines_deduction" type="xsd:int"/><xsd:element name="comission_fee" type="xsd:int"/><xsd:element name="total_price" type="xsd:int"/><xsd:element name="passenger_fullname" type="xsd:string"/><xsd:element name="passengers" type="tns:passengers"/></xsd:sequence></xsd:complexType><xsd:complexType name="passengers"><xsd:sequence><xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="passenger"><xsd:sequence><xsd:element name="name" type="xsd:string"/></xsd:sequence></xsd:complexType></schema></types>
[/code]
...
[code]
<message name="by_reservation_code_response"><part name="bookings" type="tns:bookings"/></message>
[/code]
8 sergwii
 
16.05.14
14:03
т.е. что то типа этого?
<pre>
<types><schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"><xsd:complexType name="bookings"><xsd:sequence><xsd:element name="booking" type="tns:booking" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="booking"><xsd:sequence><xsd:element name="reservation_code" type="xsd:string"/><xsd:element name="created_at" type="xsd:dateTime"/><xsd:element name="paid_at" type="xsd:dateTime"/><xsd:element name="validating_airline_code" type="xsd:string"/><xsd:element name="payer_fullname" type="xsd:string"/><xsd:element name="payment_gateway" type="xsd:string"/><xsd:element name="airlines_deduction" type="xsd:int"/><xsd:element name="comission_fee" type="xsd:int"/><xsd:element name="total_price" type="xsd:int"/><xsd:element name="passenger_fullname" type="xsd:string"/><xsd:element name="passengers" type="tns:passengers"/></xsd:sequence></xsd:complexType><xsd:complexType name="passengers"><xsd:sequence><xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="passenger"><xsd:sequence><xsd:element name="name" type="xsd:string"/></xsd:sequence></xsd:complexType></schema></types>
</pre>
...
<pre>
<message name="by_reservation_code_response"><part name="bookings" type="tns:bookings"/></message>
</pre>
9 sergwii
 
16.05.14
14:04
<types><schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"><xsd:complexType"; target="_blank" rel="nofollow" class="extralink">http://schemas.xmlsoap.org/wsdl/soap12/"><xsd:complexType name="bookings"><xsd:sequence><xsd:element name="booking" type="tns:booking" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="booking"><xsd:sequence><xsd:element name="reservation_code" type="xsd:string"/><xsd:element name="created_at" type="xsd:dateTime"/><xsd:element name="paid_at" type="xsd:dateTime"/><xsd:element name="validating_airline_code" type="xsd:string"/><xsd:element name="payer_fullname" type="xsd:string"/><xsd:element name="payment_gateway" type="xsd:string"/><xsd:element name="airlines_deduction" type="xsd:int"/><xsd:element name="comission_fee" type="xsd:int"/><xsd:element name="total_price" type="xsd:int"/><xsd:element name="passenger_fullname" type="xsd:string"/><xsd:element name="passengers" type="tns:passengers"/></xsd:sequence></xsd:complexType><xsd:complexType name="passengers"><xsd:sequence><xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name="passenger"><xsd:sequence><xsd:element name="name" type="xsd:string"/></xsd:sequence></xsd:complexType></schema></types>
10 DmitrO
 
16.05.14
14:09
да, именно так
11 DmitrO
 
16.05.14
14:15
По крайней мере, если делать подобный сервис в самой 1С, то обеспечить возвращаемое значение именно так как у вас было в начальном варианте (возвращение непосредственно списка) не возможно в принципе, и мое предположение основано на аналогии.

Странно, что вам вообще удалось получить WSОпределения, по идее разработчики платформы должны были контролировать эту ситуацию и генерить исключение при такой схеме веб-сервиса, с соответствующим описанием ошибки.
12 sergwii
 
16.05.14
14:18
ничего не генерируют ))

Процедура КнопкаВыполнитьНажатие(Кнопка)

Определение=Новый WSОпределения("https://services.tripway.com/avia/bookings/wsdl";);
ServBooking =  Новый WSПрокси(Определение, "http://schemas.xmlsoap.org/wsdl/soap12/";, "service", "services_avia_bookings_port");
Тип = ServBooking.ФабрикаXDTO.Тип("http://www.w3.org/2001/XMLSchema";, "string");
Об = ServBooking.ФабрикаXDTO.Создать(Тип, НомерБрони);
ДанныеОБроне = ServBooking.by_reservation_code(Об);

КонецПроцедуры
13 DmitrO
 
16.05.14
14:22
для простого типа string можно с этим

Тип = ServBooking.ФабрикаXDTO.Тип("http://www.w3.org/2001/XMLSchema""; target="_blank" rel="nofollow" class="extralink">http://www.w3.org/2001/XMLSchema";;, "string");
Об = ServBooking.ФабрикаXDTO.Создать(Тип, НомерБрони);

не париться, а писать сразу так:

ДанныеОБроне = ServBooking.by_reservation_code(НомерБрони);
14 DmitrO
 
16.05.14
14:26
++ правильное название этого явления: 1С тип Строка имеет прямое отображение в xml в тип xsi:string
Для всех простых типов в 1С есть прамое отображение в xml типы из пространства xsi.
15 sergwii
 
16.05.14
14:50
Теперь когда один элемент passenger то ругается:
{Форма.Форма.Форма(8)}: Помилка при виклику методу контексту (by_reservation_code)
ДанныеОБроне = ServBooking.by_reservation_code(Об);
через:
Помилка виклику операції сервісу:  {http://schemas.xmlsoap.org/wsdl/soap12/}:service:by_reservation_code()
через:
Невідома помилка. Невідповідність типів XDTO:
Властивість є списковим
через:
Невідповідність типів XDTO:
Властивість є списковим


когда несколько passenger - все нормально
16 Serginio1
 
16.05.14
14:58
Посмотри фиддлером что возвращает. И переведи хотя бы в гугле эту мову
17 sergwii
 
16.05.14
15:03
ответ:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/">;
   <soap:Body>
      <tns:by_reservation_code_response>
         <bookings xsi:type="tns:bookings">
            <booking xsi:type="tns:booking">
               <reservation_code xsi:type="xsd:string">11111</reservation_code>
               <created_at xsi:type="xsd:dateTime">2014-05-12 16:51:19 UTC</created_at>
               <paid_at xsi:type="xsd:dateTime">2014-05-13 13:00:00 UTC</paid_at>
               <validating_airline_code xsi:type="xsd:string">DK</validating_airline_code>
               <payer_fullname xsi:type="xsd:string">test</payer_fullname>
               <airlines_deduction xsi:type="xsd:int">11</airlines_deduction>
               <comission_fee xsi:type="xsd:int">11</comission_fee>
               <total_price xsi:type="xsd:int">11</total_price>
               <payment_gateway xsi:type="xsd:string">11</payment_gateway>
               <passenger_fullname xsi:type="xsd:string">11</passenger_fullname>
               <passengers xsi:type="tns:passengers">
                  <passenger xsi:type="tns:passenger">
                     <name xsi:type="xsd:string">tsst</name>
                  </passenger>
               </passengers>
            </booking>
         </bookings>
      </tns:by_reservation_code_response>
   </soap:Body>
</soap:Envelope>
18 Ksandr
 
16.05.14
15:15
И правда Невідома помилка.
19 Serginio1
 
16.05.14
15:19
(17) Надо понимать, что с двумя будет так
<passengers xsi:type="tns:passengers">
                  <passenger xsi:type="tns:passenger">
                     <name xsi:type="xsd:string">tsst</name>
                  </passenger>
                  <passenger xsi:type="tns:passenger">
                     <name xsi:type="xsd:string">tsst2</name>
                  </passenger>

               </passengers>
20 sergwii
 
16.05.14
15:22
(19) да, с двумя так, и с двумя ошибки нет
21 DmitrO
 
16.05.14
15:39
а почему решили что дело в passenger?
1С ведь в исключении про это не написала, а когда что-то не так внутри объекта она вроде ведь пишет, и указывает какое именно свойство ей не нравится
22 sergwii
 
16.05.14
15:49
(21) потому что ответы отличаются только количеством элементов passenger и ошибка Свойство является списковым, а так как booking всегда 1 то под подозрением именно passenger
23 DmitrO
 
16.05.14
15:53
тогда понятно
24 sergwii
 
16.05.14
16:22
(23) если убрать контейнер passengers, то ругается независимо от количества passenger
25 alexei366
 
16.05.14
16:35
У меня короче "Невідома помилка", кидай последнюю версию wsdl, а лучше ссылку
26 sergwii
 
16.05.14
16:41
вот без контейнера passengers
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; name="services_avia_bookings" targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/">;
  <types>
    <schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns="http://www.w3.org/2001/XMLSchema">;
      <xsd:complexType name="bookings">
        <xsd:sequence>
          <xsd:element name="booking" type="tns:booking" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="booking">
        <xsd:sequence>
          <xsd:element name="reservation_code" type="xsd:string"/>
          <xsd:element name="created_at" type="xsd:dateTime"/>
          <xsd:element name="paid_at" type="xsd:dateTime"/>
          <xsd:element name="validating_airline_code" type="xsd:string"/>
          <xsd:element name="payer_fullname" type="xsd:string"/>
          <xsd:element name="airlines_deduction" type="xsd:int"/>
          <xsd:element name="comission_fee" type="xsd:int"/>
          <xsd:element name="total_price" type="xsd:int"/>
          <xsd:element name="payment_gateway" type="xsd:string"/>
          <xsd:element name="passenger_fullname" type="xsd:string"/>
          <xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="passenger">
        <xsd:sequence>
          <xsd:element name="name" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </schema>
  </types>
  <portType name="services_avia_bookings_port">
    <operation name="for_period">
      <input message="tns:for_period"/>
      <output message="tns:for_period_response"/>
    </operation>
    <operation name="by_reservation_code">
      <input message="tns:by_reservation_code"/>
      <output message="tns:by_reservation_code_response"/>
    </operation>
  </portType>
  <binding name="services_avia_bookings_binding" type="tns:services_avia_bookings_port">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>;
    <operation name="for_period">
      <soap:operation soapAction="for_period"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
    <operation name="by_reservation_code">
      <soap:operation soapAction="by_reservation_code"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
  </binding>
  <service name="service">
    <port name="services_avia_bookings_port" binding="tns:services_avia_bookings_binding">
      <soap:address location="https://xxx.com/avia/bookings/action"/>;
    </port>
  </service>
  <message name="for_period">
    <part name="paid_at_from" type="xsd:date"/>
    <part name="paid_at_to" type="xsd:date"/>
  </message>
  <message name="for_period_response">
    <part name="value" type="xsd:string"/>
  </message>
  <message name="by_reservation_code">
    <part name="reservation_code" type="xsd:string"/>
  </message>
  <message name="by_reservation_code_response">
    <part name="bookings" type="tns:bookings"/>
  </message>
</definitions>


ответ:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/">;
   <soap:Body>
      <tns:by_reservation_code_response>
         <bookings xsi:type="tns:bookings">
            <booking xsi:type="tns:booking">
               <reservation_code xsi:type="xsd:string">BBBBB</reservation_code>
               <created_at xsi:type="xsd:dateTime">2014-05-12 14:03:29 UTC</created_at>
               <paid_at xsi:type="xsd:dateTime">2014-05-12 14:20:00 UTC</paid_at>
               <validating_airline_code xsi:type="xsd:string">DD</validating_airline_code>
               <payer_fullname xsi:type="xsd:string">test</payer_fullname>
               <airlines_deduction xsi:type="xsd:int">11</airlines_deduction>
               <comission_fee xsi:type="xsd:int">11</comission_fee>
               <total_price xsi:type="xsd:int">11</total_price>
               <payment_gateway xsi:type="xsd:string">11</payment_gateway>
               <passenger_fullname xsi:type="xsd:string">11</passenger_fullname>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">test3</name>
               </passenger>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">test2</name>
               </passenger>
               <passenger xsi:type="tns:passenger">
                  <name xsi:type="xsd:string">test1</name>
               </passenger>
            </booking>
         </bookings>
      </tns:by_reservation_code_response>
   </soap:Body>
</soap:Envelope>


ошибка Свойство является списковым
27 sergwii
 
16.05.14
16:48
или с passengers
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; name="services_avia_bookings" targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/">;
  <types>
    <schema targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns="http://www.w3.org/2001/XMLSchema">;
      <xsd:complexType name="bookings">
        <xsd:sequence>
          <xsd:element name="booking" type="tns:booking" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="booking">
        <xsd:sequence>
          <xsd:element name="reservation_code" type="xsd:string"/>
          <xsd:element name="created_at" type="xsd:dateTime"/>
          <xsd:element name="paid_at" type="xsd:dateTime"/>
          <xsd:element name="validating_airline_code" type="xsd:string"/>
          <xsd:element name="payer_fullname" type="xsd:string"/>
          <xsd:element name="payment_gateway" type="xsd:string"/>
          <xsd:element name="airlines_deduction" type="xsd:int"/>
          <xsd:element name="comission_fee" type="xsd:int"/>
          <xsd:element name="total_price" type="xsd:int"/>
          <xsd:element name="passenger_fullname" type="xsd:string"/>
          <xsd:element name="passengers" type="tns:passengers"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="passengers">
        <xsd:sequence>
          <xsd:element name="passenger" type="tns:passenger" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="passenger">
        <xsd:sequence>
          <xsd:element name="name" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    </schema>
  </types>
  <portType name="services_avia_bookings_port">
    <operation name="for_period">
      <input message="tns:for_period"/>
      <output message="tns:for_period_response"/>
    </operation>
    <operation name="by_reservation_code">
      <input message="tns:by_reservation_code"/>
      <output message="tns:by_reservation_code_response"/>
    </operation>
  </portType>
  <binding name="services_avia_bookings_binding" type="tns:services_avia_bookings_port">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>;
    <operation name="for_period">
      <soap:operation soapAction="for_period"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
    <operation name="by_reservation_code">
      <soap:operation soapAction="by_reservation_code"/>
      <input>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </input>
      <output>
        <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="http://schemas.xmlsoap.org/wsdl/soap12/"/>;
      </output>
    </operation>
  </binding>
  <service name="service">
    <port name="services_avia_bookings_port" binding="tns:services_avia_bookings_binding">
      <soap:address location="https::xxx"/>
    </port>
  </service>
  <message name="for_period">
    <part name="paid_at_from" type="xsd:date"/>
    <part name="paid_at_to" type="xsd:date"/>
  </message>
  <message name="for_period_response">
    <part name="value" type="xsd:string"/>
  </message>
  <message name="by_reservation_code">
    <part name="reservation_code" type="xsd:string"/>
  </message>
  <message name="by_reservation_code_response">
    <part name="bookings" type="tns:bookings"/>
  </message>
</definitions>

ответ:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/""; target="_blank" rel="nofollow" class="extralink">http://schemas.xmlsoap.org/soap/envelope/";; xmlns:xsd="http://www.w3.org/2001/XMLSchema";; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";; xmlns:tns="http://schemas.xmlsoap.org/wsdl/soap12/">;;

   <soap:Body>
      <tns:by_reservation_code_response>
         <bookings xsi:type="tns:bookings">
            <booking xsi:type="tns:booking">
               <reservation_code xsi:type="xsd:string">BBBBB</reservation_code>
               <created_at xsi:type="xsd:dateTime">2014-05-12 14:03:29 UTC</created_at>
               <paid_at xsi:type="xsd:dateTime">2014-05-12 14:20:00 UTC</paid_at>
               <validating_airline_code xsi:type="xsd:string">DD</validating_airline_code>
               <payer_fullname xsi:type="xsd:string">test</payer_fullname>
               <airlines_deduction xsi:type="xsd:int">11</airlines_deduction>
               <comission_fee xsi:type="xsd:int">11</comission_fee>
               <total_price xsi:type="xsd:int">11</total_price>
               <payment_gateway xsi:type="xsd:string">11</payment_gateway>
               <passenger_fullname xsi:type="xsd:string">11</passenger_fullname>
               <passengers xsi:type="tns:passengers">
                 <passenger xsi:type="tns:passenger">
                    <name xsi:type="xsd:string">test3</name>
                 </passenger>
                 <passenger xsi:type="tns:passenger">
                   <name xsi:type="xsd:string">test2</name>
                 </passenger>
                 <passenger xsi:type="tns:passenger">
                   <name xsi:type="xsd:string">test1</name>
                 </passenger>
               </passengers>
            </booking>
         </bookings>
      </tns:by_reservation_code_response>
   </soap:Body>
</soap:Envelope>

ошибка только если один элемент passenger
28 Serginio1
 
16.05.14
16:48
Создай этот тип в 1С и экспортируй схему
29 Serginio1
 
16.05.14
16:52
Да и проще сделать passenger простым типом string
30 alexei366
 
16.05.14
16:55
У меня у одного wsdl указанная в (0) даже как xml не катируется (в смысле по синтаксису - корявая)?
31 sergwii
 
16.05.14
16:56
(29) там еще элементы будут
32 sergwii
 
16.05.14
17:02
(30) ну из-за ссылок которые форум позаменял наверно
33 alexei366
 
16.05.14
17:04
(32) А на сервис сразу ссыль не кинешь? или военная тайна?
34 sergwii
 
16.05.14
17:06
(33) нет доступа извне
35 DmitrO
 
16.05.14
17:09
а попробуй привязку так прописать:

    <operation name="by_reservation_code">
      <soap:operation soapAction="by_reservation_code"/>
      <input>
        <soap:body use="literal"/>;
      </input>
      <output>
        <soap:body use="literal"/>;
      </output>
    </operation>
36 alexei366
 
16.05.14
17:18
(34) Нормально бы тогда выложил сюда хоть)
37 DmitrO
 
16.05.14
17:24
(36) да он не виноват )
это движок форума портит
38 sergwii
 
16.05.14
17:29
(35) так ошибка Неверный формат
39 Serginio1
 
16.05.14
17:33
(38) Еще раз попробуй в 1С создать нужную тебе схему и экспортировать её в файл. А из неё уже импортировать в свою систему
40 DmitrO
 
16.05.14
17:35
а на чем вообще сервер пишется?
41 sergwii
 
16.05.14
17:39
(40) рельсы
42 sergwii
 
16.05.14
17:40
<soap:body use="literal"/>;

без ";" не находит метод
43 sergwii
 
16.05.14
17:42
(39) да делают... жду...
44 DmitrO
 
16.05.14
17:43
ну ";" там лишняя конечно же
45 DmitrO
 
16.05.14
17:53
1С для своих сервисов привязку по другому делает
1. ставит style document, а не rpc
2. и ставит use="literal"

там тело сообщения по другому пакуется (при rpc: в доп. элементы пакуется, у тебя он и есть: tns:by_reservation_code_response),
но по идее так тоже можно.. и вроде это точно не должно влиять на внутренности..
46 DmitrO
 
16.05.14
18:00
да, и еще вот это:
targetNamespace="http://schemas.xmlsoap.org/wsdl/soap12/";
В принципе не верно. Тут должен быть идентификатор вашего собственного пространства имен.
Например: "http://www.MyCompanyDomainName.com/MyFirstWebServiceInMyLife";
47 sergwii
 
16.05.14
18:08
(45) так не находит метод