Re: Re: remote database exchange

From: Date: Tue, 17 Jul 2001 21:52:41 +0000
Subject: Re: Re: remote database exchange
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-10530@lists.php.net to get a copy of this message
Hello, Ken Sommers wrote: > > thanks for info, > > suppose I need to keep a Vendors' price list on MY site in my mysql database > (PHP4/mysql on a hosting company) > and would like to keep it up to date. I would like to know about dropped or > new items and of course price changes. > i will not need inventory quantities. > What;s the simplest and easiest way to do it? > > the vendors database may or may NOT be online.. and may be of any variety? > > first thing that comes to MY mind is to ask them for a comma-delimited text > file,,and I could somehow jam that into my mysql > > updates would NOT have to be up to the minute. > > I would be using these prices to compare to other vendors. Assuming that you can already figure the information you need using database queries, this is a case where a RPC protocol like SOAP will suit your needs. You need to setup a SOAP server that can be basically a PHP script running in a Web server that handles SOAP requests by parsing a SOAP request message that is in SOAP specific XML format and extract request parameters. Then you use the request parameters (if any) to execute the necessary database queries and marshalls a SOAP response that is basically outputting some XML that contains the information that you want to return to the client. On the client end you need to build a SOAP request XML message and submit to the SOAP server sending it using the HTTP POST protocol. Then you wait for the response and unmarshall the SOAP response data that is basically parsing the SOAP response XML message to extract the response values and use them as you need. This class can be used as base of your SOAP server. You just need to create a subclass to handle the specific actions of you service. http://phpclasses.UpperDesign.com/browse.html/package/251 This other package contains an example of how to sub class the class above to develop a custom SOAP server. http://phpclasses.UpperDesign.com/browse.html/package/177 For the client side, I don't have right now a SOAP client class at hand, but one code be build with this other classes: XML writer class http://phpclasses.UpperDesign.com/browse.html/package/251 HTTP client request class http://phpclasses.UpperDesign.com/browse.html/package/3 XML parser class http://phpclasses.UpperDesign.com/browse.html/package/4 I know there are some SOAP client request classes out there, but I can't recommend one because I haven't tried any. Regards, Manuel Lemos

« previous php.db (#10530) next »