locked
How to retain variable values between the soap request RRS feed

  • Question

  • Hi,


    I have a Web Service in which I have a dataset ,

    and on one soap request I fill that dataset and on another request 

    I retrive data from that dataset.

    But the problem is on another request the dataset become empty.

    How do I get data from dataset on new soap request ?




    • Edited by Siddharth Varshneya Wednesday, December 12, 2012 9:55 AM
    • Moved by Naomi N Wednesday, December 12, 2012 2:12 PM Perhaps better answer here (From:Forums Issues (not product support))
    Wednesday, December 12, 2012 9:51 AM

All replies

  • That is a very bad design pattern. The best design for web services is for them to be without state.

    One design would be to combine both requests into one, which retrieves and processes the dataset.

    If this is not practical, then you can use Session state.

    In either case, you should be using WCF instead of the legacy ASMX web services. This is a technology which should not be used for new development.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Thursday, December 13, 2012 12:18 AM
    Moderator
  • Thanks John for your reply ,

    but if I use WCF instead of WebServices

    I can I retrive data from that dataset...

    And sir I have one more question ?

    can i use one session in two applications.

    Please give example if it does...  

    I tried using session mode to SQL state but it does not happen.. 

    Thursday, December 13, 2012 1:21 PM
  • WCF is the replacement for ASMX web services. WCF can do anything that ASMX services used to be able to do.

    I have never tried sharing sessions between applications, so I don't really know.


    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Thursday, December 13, 2012 4:15 PM
    Moderator