> -----Original Message-----
> From: Dan Timis [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 30, 2004 7:47 AM
> To: [EMAIL PROTECTED]
> Subject: A simple client/server problem
> 
> 
> Hi everyone,
> 
> I am very new to Perl.  I need two perl scripts, one would run on a 
> client, the
> other would run on a server.
> 
> The perl script on the client machine runs an application.  The 
> application
> creates a file called "request.xml"  The perl script reads the file, 
> and sends
> it to the server.
> 
> A cgi script on the server reads the file and saves it as 
> "request.xml" 
> then
> runs another application.  The application reads "request.xml" and 
> creates
> "reply.xml".  The server perl script reads "reply.xml" and sends it 
> back to the
> client.
> 
> The client reads the data from the server and saves it as "reply.xml"
> 
> I looked all over for some example code.  I found lots of examples 
> about how to
> upload a file to the server, but they are all about the server part, 
> and how to
> generate html that would let a user choose a file to upload.  I could 
> not find
> anything about how a client would connect to a server, send 
> some data, 
> and then
> read some data back.
...
...

> I think I can also handle most of the client side.  What I don't know 
> how to do
> is open a two way connection with the server.  Do I do something like 
> this:
> 
>      open CONNECTION "http://www.myserver.com/cgi-bin/generate-reply";
> 
> Where can I find some example code?

You may need XMLRPC.
http://www.xmlrpc.com
http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-perl-client.html
http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-perl-cgi.html

A Perl Client (not tested !)
The following program shows how to call an XML-RPC server from Perl:
        
    use strict;
    use warnings;
    use Frontier::Client;
    
    # Make an object to represent the XML-RPC server.
    my $server_url = 'http://www.myserver.com/cgi-bin/generate-reply.pl';
    my $server_obj = Frontier::Client->new(url => $server_url);
    
    # Call the remote server and get our result.
    my $request_data = subroutine_to_get_your_request_xml_data();
    my $result_obj = $server_obj->call('in', $request_data);
    my $reply_data = $result_obj->{'out'};
    #the rest ...

Hope that gives you some new ideas ...

José.


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to