Our web wervice design for a process flow needs to be more efficie

Discussion in 'ASP .Net Web Services' started by D-Someone, Aug 2, 2006.

  1. D-Someone

    D-Someone Guest

    I am trying to come up with a good design for a web service that has some
    user logic and business processes involved. Here a small sample of the
    process flow:
    ---
    Client Get's User Input for field 1...
    This information is validated. If invalid.. more information is required
    Client Get's user Input for field 2....
    This information is validated. If invalid.. more information is required
    Client Get's user Input for field 3...
    At this point the information is autoatically validated to be correct
    because we cannot yet find a match in our system so we put all of this
    information in.
    ---

    I was having trouble deciding how to set this up as web services. Of course
    because I do not want the web service to have to maintain state (ie: maintain
    the value of field 1 between calls), so far I have come up with the following
    idea.

    Three methods in the webservice...

    AddItem1(string field1)

    AddItem2(string field1, string field2)

    AddItem3(string field1, string field2, string field3)

    each of these web methods would have a return value that is a complex type
    with 2 elements (bool Success, bool CanContinue)

    When the client calls AddItem1 and passes in 1 parameter the webservice will
    try and validate it. If validated... the web service will add the record to
    the database and everything is fine...Success=True...

    The client app looks at the returned XML and see's Success=True so it knows
    that the record was inserted and not to ask the user for any more details.

    If Success=False then the client knows that the record was not added and to
    ask for more details and then call AddItem2 web method and so on.... Likewise
    if the CanContinue element ever returns false... the client will know that
    the item was not added and not to attempt to call AddItem2 or AddItem3
    because the value passed is not acceptable and will never be entered into the
    database.

    It seems to be a cheesy way of incorporating this kind of business flow. It
    also is very inefficent as 3 web service calls are required in some cases
    jsut to insert the data. Each web service call will do it's own validation
    and return a success and cancontinue element. Of course I could incorporate
    caching a dataset in a session variable to minimize hits on the database but
    this is a real time mission critical application where I need to validate
    passed in data with data where data additions occure every minute...

    I am up for suggestions on improving this process.....


    One more thing... I have included XML comments for all the public web
    methods, but they do not appear on the wsdl when looking at the methods. How
    can I document this so that when a subscriber goes to the site they can see
    in clear exactly how to use these methods (by calling AddItem1 .. looking at
    the return value... then maybe having to call AddItem2)...

    -D
     
    D-Someone, Aug 2, 2006
    #1
    1. Advertising

  2. D-Someone

    D-Someone Guest

    "Get expert answers to your technical questions within two business days.
    First time users click on the Configure link below. "

    Could someone please respond to this. It has been well over 2 business
    weeks let alone 2 business days!

    "D-Someone" wrote:

    > I am trying to come up with a good design for a web service that has some
    > user logic and business processes involved. Here a small sample of the
    > process flow:
    > ---
    > Client Get's User Input for field 1...
    > This information is validated. If invalid.. more information is required
    > Client Get's user Input for field 2....
    > This information is validated. If invalid.. more information is required
    > Client Get's user Input for field 3...
    > At this point the information is autoatically validated to be correct
    > because we cannot yet find a match in our system so we put all of this
    > information in.
    > ---
    >
    > I was having trouble deciding how to set this up as web services. Of course
    > because I do not want the web service to have to maintain state (ie: maintain
    > the value of field 1 between calls), so far I have come up with the following
    > idea.
    >
    > Three methods in the webservice...
    >
    > AddItem1(string field1)
    >
    > AddItem2(string field1, string field2)
    >
    > AddItem3(string field1, string field2, string field3)
    >
    > each of these web methods would have a return value that is a complex type
    > with 2 elements (bool Success, bool CanContinue)
    >
    > When the client calls AddItem1 and passes in 1 parameter the webservice will
    > try and validate it. If validated... the web service will add the record to
    > the database and everything is fine...Success=True...
    >
    > The client app looks at the returned XML and see's Success=True so it knows
    > that the record was inserted and not to ask the user for any more details.
    >
    > If Success=False then the client knows that the record was not added and to
    > ask for more details and then call AddItem2 web method and so on.... Likewise
    > if the CanContinue element ever returns false... the client will know that
    > the item was not added and not to attempt to call AddItem2 or AddItem3
    > because the value passed is not acceptable and will never be entered into the
    > database.
    >
    > It seems to be a cheesy way of incorporating this kind of business flow. It
    > also is very inefficent as 3 web service calls are required in some cases
    > jsut to insert the data. Each web service call will do it's own validation
    > and return a success and cancontinue element. Of course I could incorporate
    > caching a dataset in a session variable to minimize hits on the database but
    > this is a real time mission critical application where I need to validate
    > passed in data with data where data additions occure every minute...
    >
    > I am up for suggestions on improving this process.....
    >
    >
    > One more thing... I have included XML comments for all the public web
    > methods, but they do not appear on the wsdl when looking at the methods. How
    > can I document this so that when a subscriber goes to the site they can see
    > in clear exactly how to use these methods (by calling AddItem1 .. looking at
    > the return value... then maybe having to call AddItem2)...
    >
    > -D
     
    D-Someone, Aug 18, 2006
    #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. Jack Dowson
    Replies:
    0
    Views:
    456
    Jack Dowson
    May 7, 2007
  2. Imran
    Replies:
    0
    Views:
    299
    Imran
    Jun 9, 2007
  3. POLO TSHIRT
    Replies:
    0
    Views:
    196
    POLO TSHIRT
    Nov 8, 2010
  4. Hidden Desi
    Replies:
    0
    Views:
    441
    Hidden Desi
    Sep 22, 2003
  5. YE WINT NYEIN

    HOW TO CALL C# WEB WERVICE FROM ASP

    YE WINT NYEIN, Oct 22, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    116
    Murdock
    Oct 23, 2003
Loading...

Share This Page