By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,354 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,354 IT Pros & Developers. It's quick & easy.

Repost: Our web service design for a process flow needs to be mor

P: n/a
I am re-posting this message as originially it did not get a single
response.. Any ideas?

--------------

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

Aug 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Maybe I missed something, but I don't understand why I am not getting a
response here. It has been over 2 business days...and this is a repost from
a few weeks ago that went unanswered.

Please advise...

"D-Someone" wrote:
I am re-posting this message as originially it did not get a single
response.. Any ideas?

--------------

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
Aug 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.