filePro and SOAP

Bill Campbell bill at celestial.com
Tue Jan 10 12:41:19 PST 2006


On Tue, Jan 10, 2006, Nancy Palmquist wrote:
>Is anyone using SOAP and setting up a service that will accept data and 
>process it then return filePro data to a client?
>
>I am trying to figure out the cgi chunk that needs to collect the SOAP 
>request, and somehow pass that file to filePro. I have the bit working 
>great that imports the file, parses it, processes it, generates the 
>output and ends.  I need to add the transport mechanism to this.
>
>We need a SOAP service (lingo I found but don't have a clue how to start).
>
>The SOAP Service needs to get an XML file from the POST, write it, pass 
>the name to filepro in a command line.  FilePro does its thing and 
>writes a file.  File is then returned to client via SOAP.

I haven't worked with SOAP other than it is used behind the scenes when
using xmlrpc in perl, and perhaps in python.

Python is probably the cleanest way to do this that I've found.  This
script will return your public IP as seen by our support server:

#!/usr/local/bin/python
url = 'https://support.celestial.com/openpkg-cgi/csadmin'
from xmlrpclib import ServerProxy
server = ServerProxy(url)
response = server.getmyip()
print response
# end of script

The server side of this is almost as simple (python purists hold
your noses as I use commented curly braces to aid navigation in
vi(m) using the ``%'' key :-).

#!/usr/local/bin/python
from SimpleXMLRPCServer import CGIXMLRPCRequestHandler
import os, xmlrpclib

class MyFuncs: #{
	def getmyip(self): #{
		'''Return environment dictionary'''
		return os.environ['REMOTE_ADDR']
	#} getmyenv
	# more methods may go here.
#} class MyFuncs
handler = CGIXMLRPCRequestHandler()
handler.register_introspection_functions()
handler.register_instance(MyFuncs())
handler.handle_request()
# end of script

The server side can do pretty much anything you want, and is written to
work on an apache server via https to provide secure connections.  The
client side simply specifies the URI for the server, then makes simple
calls to remote procedures on the server.  The server side here runs on
normal reduced priviledges on the apache server.  When it needs to do
priviledged things, it then can make xmlrpc calls to a private xmlrpc
server running on localhost.  That xmlrpc server runs with root
priviledges, and isn't accessible from the outside world.

The arguments passed and the remote procedure call returns may be scalars,
lists, and/or dictionaries (same as perl hashes or awk associative arrays).

The programmer doesn't have to worry about XML at all as that is completely
hidden within the xmlrpc libraries.

One can also use the perl RPC::XML::Client and RPC::XML::Server modules for
this, but the interface isn't nearly as clean as python's.

I think that the perl RPC::XML library uses SOAP::Lite to handle the
connection.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``Our Foreign dealings are an Open Book, generally a Check Book.''
    Will Rogers


More information about the Filepro-list mailing list