brian doll
unread,May 1, 2008, 3:06:18 PM5/1/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to soap4r
The Setup:
I'm currently using soap4r 1.5.8, ruby 1.8.6 on both Windows and
Linux, to communicate with web services served by Java (Apache Axis).
Right now, I have service calls working well, with our required custom
header, which includes various bits of information about the
requestor.
The service classes (one per wsdl) extend a base class that sets up
the driver with the appropriate information (endpoint, wsdl, etc.).
Since setting up the driver with a wsdl (local or over http) is
expensive, I'm building the service classes as singletons.
A service call, then, may look like this:
FooService.instance.getFoo("bar")
As you may have guessed, I'm appending a custom header on the driver
during the creation of the wsdl driver factory. Since the service
class is a singleton, this is done once, during the initial creation
of the (singleton) object.
The Problem:
The information that makes up our custom header, needs to be distinct
per service request. Each call to the web service should have its
very own header associated to it. I have no problem generating a
header with the unique information each time, but I can't figure out
how best to assure that my SOAP request uses my new header each time.
Many of us seem to be setting up the driver once, and reusing it for
successive service calls. Since the headerhandler is a property of
the driver, it would seem difficult to associate a specific header
with a specific service call.
I thought about opening up SOAP::WSDLDriverFactory (or my extension
of that class, actually) to allow a caller to "reset" the
headerhandler and add a new one in its place. The problem with this
is that, again, this is associated with the driver, and not the
service call. It would be possible then, that two concurrent requests
to the service class would attempt to send messages at the same time,
possibly resulting in the wrong header being associated to a service
call.
So, the short of it being:
Is there any way to associate a new header along with every new
service call to a soap wsdl driver?
Thanks very much for any assistance or thoughts on an approach...
b