|
|
|
| Всем привет!
Необходимо написать скрипт на PHP (клиент), который на основе протокола SOAP будет класть пришедшие к нему данные в файл и любовно его сохранять. Сам я мало секу в этом, посему нужен (срочно!) мудрый советчик для просвещения.
Заранее спасибо! | |
|
|
|
|
|
|
|
для: Jaivan
(17.02.2009 в 10:14)
| | Возможно вас заинтересует Pear
[поправлено модератором] | |
|
|
|
|
|
|
|
для: mihdan
(17.02.2009 в 11:01)
| | очень заинтересовало, только сложно, на пальцах нет
мне сервер нужно написать, который на линуксе будет стоят, к нему обращаются он всю инфу в файл скидывает | |
|
|
|
|
|
|
|
для: mihdan
(17.02.2009 в 11:01)
| | и чего эта установка вообще дает полноценный масштабируемый сервер для soap-клиентов? нет чего нибудь типа этого, но откровенно попроще? | |
|
|
|
|
|
|
|
для: Jaivan
(17.02.2009 в 15:55)
| | разумеется есть http://ru.php.net/soap | |
|
|
|
|
|
|
|
для: Jaivan
(17.02.2009 в 10:14)
| | что-то я совсем не понял,
если не трудно расскажите для чего это все?
я про SOAP | |
|
|
|
|
|
|
|
для: а-я
(17.02.2009 в 22:22)
| | Постараюсь по порядку )
Есть некая программулина под начванием Дженезис, есть у нее аннотация к одной из функций следующего вида:
Another Web Service Example
The X-Methods Currency Exchange Rate Web Service returns the current
exchange rate at which currency A is converted to currency B.
You can find the parameters in the Web Service description on the Web
Service provider's Web site or from WSDL description file.
WSDL Description
Assume the X-Methods Currency Exchange Rate Web Service WSDL
description file look like this:
http://www.xmethods.net/sd/2001/CurrencyExchangeService.wsdl
<?xml version="1.0" ?>
<definitions name="CurrencyExchangeService"
targetNamespace="http://www.xmethods.net/sd/CurrencyExchangeService
.wsdl"
xmlns:tns="http://www.xmethods.net/sd/CurrencyExchangeService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="getRateRequest">
<part name="country1" type="xsd:string" />
<part name="country2" type="xsd:string" />
</message>
<message name="getRateResponse">
<part name="Result" type="xsd:float" />
</message>
<portType name="CurrencyExchangePortType">
<operation name="getRate">
<input message="tns:getRateRequest" />
<output message="tns:getRateResponse" />
</operation>
</portType>
<binding name="CurrencyExchangeBinding"
type="tns:CurrencyExchangePortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"
/>
<operation name="getRate">
<soap:operation soapAction="" />
<input>
<soap:body use="encoded"
namespace="urn:xmethods-CurrencyExchange"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
620 Universal Routing 7.5
Appendix B: Web Service Object Another Web Service Example
</input>
<output>
<soap:body use="encoded"
namespace="urn:xmethods-CurrencyExchange"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
/>
</output>
</operation>
</binding>
<service name="CurrencyExchangeService">
<documentation>Returns the exchange rate between the two
currencies</documentation>
<port name="CurrencyExchangePort"
binding="tns:CurrencyExchangeBinding">
<soap:address location="http://services.xmethods.net:80/soap"
/>
</port>
</service>
</definitions>
|
General Tab in Web Services Object
We can get Web Services object parameters from the above WSDL
description. Therefore, the Web Services object parameters for accessing the
Currency Exchange Rate Web Service are the following:
• Web Service URL: http://services.xmethods.net:80/soap
• Method name: ns:getRate
• Method namespace: ns=urn:xmethods-CurrencyExchange
• SOAP action:
• Request parameters: country1=UK,country2=USA
URS SOAP Request Message
Using these parameters, URS sends the following SOAP message to the XMethods
Currency Exchange Rate Web Service:
POST /soap HTTP/1.0
Host: services.xmethods.net
User-Agent:
Content-Type: text/xml; charset=utf-8
Content-Length: 505
Connection: close
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAPENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
Reference Manual 623
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:ns="urn:xmethods-CurrencyExchange">
<SOAP-ENV:Body SOAPENV:
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ns:getRate>
<country1>UK</country1>
<country2>USA</country2>
</ns:getRate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
Web Service Response Message
The X-Methods Currency Exchange Rate Web Service responds with this
SOAP response message:
HTTP/1.1 200 OK
Date: Tue, 21 Jan 2003 02:05:24 GMT
Server: Electric/1.0
Content-Type: text/xml
Content-Length: 492
X-Cache: MISS from www.xmethods.net
Connection: close
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<soap:Body>
<n:getRateResponse xmlns:n='urn:xmethods-CurrencyExchange'>
<Result xsi:type='xsd:float'>1.6059</Result>
</n:getRateResponse>
</soap:Body>
</soap:Envelope>
|
The result of this Remote Procedure Call (1.6059 UK pounds to one US dollar
in this example) is returned as the result of the Web Services object.
Мне, как человеку написавшему всего 2,5 скрипта понятно следующее необходимо написать веб-сервис, который обрабатывал бы запрос со стороны этой программулины (клиента) и ответ не посылал бы обратно, а записывал в файл, вот (можно конечно и отсылать, жалко что ли, но чтобы обязательно данные можно было просмотреть при этом)
Вот такой вод камень приткновения.... | |
|
|
|
|
|
|
|
для: Jaivan
(19.02.2009 в 09:44)
| | =) спасибо..
кажись понял. | |
|
|
|
|
|
|
|
для: а-я
(19.02.2009 в 09:56)
| | можно поподробнее? | |
|
|
|
|
|
|
|
для: Jaivan
(20.02.2009 в 14:36)
| | ну... если я правильно понял, это чтоб ПО могли общаться между собой.
Можно сделать всякие онлайн приложения (чаты, гостевые)
На JAVA, FLASH и т.д. | |
|
|
|