webservice servicing multiple object instances.

S

srajan

Hi,

I have a webservice that provides access to multiple object instances.
Now from client I want to channel the calls to specific objects. I
could think of 2 options
1. The url for the service could take in the objectId, some identifier
that identifies the object uniquely
e.g. MyServiceInst.Url = "http://MyServer/MyService?objId=2"
MyServiceInst.foo(arg1, arg2);
2. Add objectId argument for each method call in the service
e.g. MyServiceInst.foo(objectId, arg1, arg2);

I am wondering if there are any other options that I could use in this
context.

Thanks
 
J

John Saunders [MVP]

Hi,

I have a webservice that provides access to multiple object instances.
Now from client I want to channel the calls to specific objects. I
could think of 2 options
1. The url for the service could take in the objectId, some identifier
that identifies the object uniquely
e.g. MyServiceInst.Url = "http://MyServer/MyService?objId=2"
MyServiceInst.foo(arg1, arg2);
2. Add objectId argument for each method call in the service
e.g. MyServiceInst.foo(objectId, arg1, arg2);

I am wondering if there are any other options that I could use in this
context.

You're better off with the object id as a parameter for each call, or else
by putting the object id in a SOAP Header. That way, the header could be
filled in once by the client, and supplied to the server on each call.

I presume that you are aware of issues with simultaneous modification of
shared objects by multiple web service requests? Also, I assume that you've
taken web farms into account to the extent necessary.
 
S

srajan

Thanks for your reply. This application was originally using CORBA and
does take care of the concurrency issues. In CORBA the a remote method
can return object references and I can call methods using the object
reference. But this mechanism wasn't directly available through SOAP/
WSDL (if it did it escaped my senses). Hence looking for an
alternative to fake this. So I would like to avoid adding objectid in
the method call, but if this is the only sane option, we will have to
do this.

But, in your reply you mentioned "putting the object id in a SOAP
Header". How do you do it from a client written in VS2005? Can you
give a small example.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top