CacheDuration

Discussion in 'ASP .Net Web Services' started by deja@2bytes.co.uk, Feb 16, 2007.

  1. Guest

    if my webmethod parameter is an object, it doesn't seem to cache the
    output even though the xml serialised version of this object is the
    same as the previous call. Is this right?

    if I call the same web method with two different RequestObjects(see
    below) but both with the same attributes like so:
    refTransNum=80
    dbId="myDB"
    all other attributes not set.

    the webmethod output is not cached but I was expecting it to be. Does
    this mean the parameters have to be simple parameters? I wanted to use
    an object parameter so it could be extended more easily.

    i.e. WebMethod parameter is RequestObject.
    RequestObject consists of:
    public string dbId
    public System.Collections.Generic.List<WSAdditionalParam> addParams
    public GroupType grpType;
    public int refTransNum;
    public string[] idList;


    public class WSAdditionalParam
    {
    public WSAdditionalParam()
    {
    }
    public string Name;
    public object Value;

    public static object GetParam(List<WSAdditionalParam>
    addParams, string paramName)
    {
    ParamFilter filter = new ParamFilter(paramName);
    if (addParams != null)
    {
    WSAdditionalParam param =
    addParams.Find(filter.Match);
    if (param != null)
    return param.Value;
    }
    return null;
    }
    }


    [Serializable]
    public enum GroupType
    {
    T = 0,
    Z= 1,
    D = 2,
    S = 3,
    E = 4,
    L = 5,
    P = 6,
    ST = 7,
    TB = 8,
    C = 9
    }

    thanks
    Phil
    , Feb 16, 2007
    #1
    1. Advertising

  2. Guest

    Also, what happens if 2 calls come in one after the other but the
    first call hasn't finished when the second one comes in? Does the
    second one do all the work all over again or does it wait for the
    first call to output and then use the same output?

    thanks
    , Feb 16, 2007
    #2
    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. usamedb208

    CacheDuration is not working

    usamedb208, Jan 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    505
    usamedb208
    Jan 29, 2004
  2. Arpan

    CacheDuration In WebService?

    Arpan, Sep 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    516
    Arpan
    Sep 5, 2006
  3. Manuel Trunk

    problem with CacheDuration attribute

    Manuel Trunk, Nov 4, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    129
    Manuel Trunk
    Nov 4, 2003
  4. Tim Scarfe

    ASP.NET Web Services. Web Method CacheDuration Issue.

    Tim Scarfe, Feb 4, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    119
    Tim Scarfe
    Feb 4, 2004
  5. Francis Shanahan

    CacheDuration from Internet explorer

    Francis Shanahan, Dec 28, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    147
    Francis Shanahan
    Dec 28, 2004
Loading...

Share This Page