Hi, I'm trying to build a Ruby module for doing web services using Axis2/C. My approach is to build a one-to-one mapping to the Axis2/C functions from Ruby and abstract it a bit more to create a more high level API. I've come to a stage where I could write the echo client program using my wrapper.
I used SWIG to generate it and I believe that this could be used to generate the wrappers for Python, Perl and a host of other languages that SWIG has support for, without changing my existing SWIG interface file. I was looking for an API and found out that PHP SOAP API (http://php.net/soap) to be good enough so I went with that. However the API is far from complete. So echo client could be written as, myClient = Axis::SoapClient.new myClient.__call("echoString", "echo5") Currently I have the address where the service reside, hard coded but I'm on my way to parameterize all the items and implement other functions. Here's an exerpt from the low level Axis2/C functions invoked from Ruby, env = AxisC.axis2_env_create_all("echo.log", AxisC::AXIS2_LOG_LEVEL_TRACE) address = "http://localhost:9090/axis2/services/echo" endpoint_ref = AxisC.axis2_endpoint_ref_create(env, address) options = AxisC.axis2_options_create(env) AxisC.axis2_options_set_to(options, env, endpoint_ref) AxisC.axis2_options_set_action(options, env, "http://ws.apache.org/axis2/c/samples/echoString") What I did was to write another module 'Axis' ('AxisC' is for low level functions) encapsulating all the low level functions providing the functions which exactly look like the PHP SOAP API. This could easily be changed to anything. My previous approach was to use Ruby/DLX which is mighty elegant in it's own right to make a wrapper but it does have some problems with forward delcarations and function pointers (however Marcel is doing a fantastic job of getting those to work in the 0.9.x branch) Bye, -Chintana -- http://www.linux.lk/~chintana/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
