Soap установлен как модуль Apache.
Стоит задача, вернуть c сервера данные в виде массива объектов типа stdClass.
Ниже приведу код WSDL файла и код сервера...
Если возвращаю обычный массив, то мой клиент на сервере все прекрасно понимает... а клиент на платформе 1С завершается неудачей при чтении возвращаемых данных.
Покумекав я решил, раз сервер при запросе от 1С получает массив объектов, то и возвращать нужно так же массив объектов.
Но не получается организовать возвращение многомерного массива объектов
Подскажите как описать WSDL файл?
Файл WSDL
CODE (htmlphp):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:tns="urn:europarts" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:europarts">
- <types>
- <xsd:schema targetNamespace="urn:europarts">
- <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
- <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
- <xsd:complexType name="ItemPart">
- <xsd:sequence>
- <xsd:element name="number" type="xsd:string"/>
- <xsd:element name="priority" type="xsd:int"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfItemPart">
- <xsd:sequence>
- <xsd:element name="password" type="xsd:string"/>
- <xsd:element name="parts" type="tns:ItemPart" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ItemPartPrice">
- <xsd:sequence>
- <xsd:element name="number" type="xsd:string"/>
- <xsd:element name="priority" type="xsd:int"/>
- <xsd:element name="price" type="xsd:float"/>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfItemPartPrice">
- <xsd:sequence>
- <xsd:element name="result" type="tns:ItemPartPrice" minOccurs="0" maxOccurs="unbounded" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:schema>
- </types>
- <message name="getArrayPriceRequest">
- <part name="array" type="tns:ArrayOfItemPart"/>
- </message>
- <message name="getArrayPriceResponse">
- <part name="array" type="tns:ArrayOfItemPartPrice"/>
- </message>
- <portType name="europartsPortType">
- <operation name="getArrayPrice">
- <documentation>get array price</documentation>
- <input message="tns:getArrayPriceRequest"/>
- <output message="tns:getArrayPriceResponse"/>
- </operation>
- </portType>
- <binding name="europartsBinding" type="tns:europartsPortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="getArrayPrice">
- <soap:operation soapAction="urn:europarts#getArrayPrice" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="urn:europarts" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="urn:europarts" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
- <service name="europarts">
- <port name="europartsPort" binding="tns:europartsBinding">
- <soap:address location="http://europarts.pro/webservicePrice/server.php"/>
- </port>
- </service>
- </definitions>