Fedak.o.b
Новичок
Добрый день!
Нужно создать Soap сервис.
Долгими усилиями создал wsdl - файл, так как сгенерировать с помощью NuSoap так и не получилось:
1. Хотелось бы узнать верно ли созданный wsdl для дальнейшего получения данных с бд:
- PartNr
- PartName
- PriceClient
2. Вашы рекомендации по написанию SOAP сервиса.
Прочитал:
http://phpclub.ru/detail/article/soap
http://www.w3.org/TR/wsdl
http://www.php.ru/forum/viewtopic.php?f=13&t=25393
Нужно создать Soap сервис.
Долгими усилиями создал wsdl - файл, так как сгенерировать с помощью NuSoap так и не получилось:
PHP:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://site.com/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://site.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://site.com/">
<s:element name="GetPrice">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="PartNr" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetPriceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetPriceResult" type="tns:ArrayOfPricePosObj" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfPricePosObj">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="PricePosObj" nillable="true" type="tns:PricePosObj" />
</s:sequence>
</s:complexType>
<s:complexType name="PricePosObj">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="PartNr" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PartName" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="PriceClient" type="s:double" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="GetPriceSoapIn">
<wsdl:part name="parameters" element="tns:GetPrice" />
</wsdl:message>
<wsdl:message name="GetPriceSoapOut">
<wsdl:part name="parameters" element="tns:GetPriceResponse" />
</wsdl:message>
<wsdl:portType name="PricesSoap">
<wsdl:operation name="GetPrice">
<wsdl:input message="tns:GetPriceSoapIn" />
<wsdl:output message="tns:GetPriceSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PricesSoap" type="tns:PricesSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetPrice">
<soap:operation soapAction="http://site.com/GetPrice" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Prices">
<wsdl:port name="PricesSoap" binding="tns:PricesSoap">
<soap:address location="http://site.com/server.php" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
- PartNr
- PartName
- PriceClient
2. Вашы рекомендации по написанию SOAP сервиса.
Прочитал:
http://phpclub.ru/detail/article/soap
http://www.w3.org/TR/wsdl
http://www.php.ru/forum/viewtopic.php?f=13&t=25393