webservice servicing multiple object instances.

Discussion in 'ASP .Net Web Services' started by srajan@gmail.com, Jul 22, 2007.

  1. Guest

    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
    , Jul 22, 2007
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > 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.
    --
    John Saunders [MVP]
    John Saunders [MVP], Jul 22, 2007
    #2
    1. Advertising

  3. Guest

    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
    --
    Rajan

    >
    > > 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.
    > --
    > John Saunders [MVP]
    , Jul 23, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Wohlbier
    Replies:
    2
    Views:
    366
    Josiah Carlson
    Feb 22, 2004
  2. Replies:
    8
    Views:
    459
    James Stroud
    Jan 29, 2009
  3. Nav
    Replies:
    15
    Views:
    553
    Steven D'Aprano
    Jan 5, 2010
  4. Hedgehog
    Replies:
    1
    Views:
    111
    Michael Winter
    Feb 10, 2005
  5. Jan
    Replies:
    0
    Views:
    161
Loading...

Share This Page