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

D

D-Someone

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

D-Someone

"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!
 

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

No members online now.

Forum statistics

Threads
473,808
Messages
2,569,686
Members
45,452
Latest member
AmberLayde

Latest Threads

Top