Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2012, 03:07 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Codemaniac,

You may find this useful:

http://msdn.microsoft.com/en-us/library/dd203052.aspx
http://www.codeproject.com/Articles/...e-Introduction
http://en.wikipedia.org/wiki/Represe...state_transfer

Quote:
Can't it implemented between a web application and a website.
If you're saying you cannot have a web service in a web application that is being called by a web site or vice versa, then this is not true; you certainly can.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 17th, 2012, 09:49 AM
Authorized User
 
Join Date: Jul 2012
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Ha! Thanks, Imar, for your input. You're absolutely right, I was mixing apples and oranges on that one. I was under the mistaken impression that it would return the value of the identity column with the idea that Codemaniac might want the value of the identity column to pass into the cache, not remembering this would be only to return the value of the identity column only during an insert. My bad, thanks for the catch.

As to the try/catch, I was merely trying to hint the model of "best practice" where applicable. I apologize, Codemaniac, for any confusion I may have caused you.
 
Old July 17th, 2012, 10:02 AM
Authorized User
 
Join Date: Jul 2012
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Codemaniac, please see Imar's answers as I think they encompass exactly the information you're looking for. And I would add that yes, REST can absolutely be implemented within a call from one web application to another. REST merely combines HTTP and a good URI scheme for addressing XML-based data, and since it uses the root protocol of the World Wide Web, it is hallmark of simplicity and totally appropriate for the situation you've described. Happy coding!
 
Old July 17th, 2012, 10:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I was merely trying to hint the model of "best practice" where applicable
I see, and I agree. try/catch is a best practice for exceptions you're expecting (such as the SqlException in your case), but only if you're going to handle them.

So:

Code:
catch (SqlException)
{
  throw;
}
wouldn't add much value over leaving out the try/catch block. But this:

Code:
catch (SqlException)
{
  // TODO: log error
}
would ;-)

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 17th, 2012, 11:06 AM
Authorized User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar and guenfire,

I need an expert advice from you regarding the "REST call".

I have developed a dashboard which contains username and password. Now I want to transfer these credentials to another website so that user don't have to login again. AND I am asked to implement it through REST calls.

Could you please explain what is REST call. As far as I have researched REST is just a style just like object oriented programming is a style of coding. Could you please just break it down for me or point me to some tutorial.

Everywhere I see, REST call are implemented through a web service. Can't it implemented between a web application and a website.

Hoping for your expert reply. Thanks :)
 
Old July 17th, 2012, 11:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Heuh? Why are you posting the same message again? Didn't you see my replies? Did you read the articles I linked to?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 17th, 2012, 11:28 AM
Authorized User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh I am sorry, Didn't see the next page. Stupid me !!
Thanks for the links, Imar. I am looking into them links right now.
 
Old July 17th, 2012, 12:12 PM
Authorized User
 
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dealer-->(Website 1 or 2)---->Dashboard<<--->> Website 3


Sorry for this crappy diagram, I would have inserted an image here, but I didn't know how to.

So,
--
  1. -- Dealer can login to any website (1 or 2) to see how many points he has got
  2. -- In order to redeem the points, dealer clicks on redeem button present on website 1 and 2
  3. -- When dealer clicks on "redeem" button, he/she will be redirected to a dashboard which will welcomes the user and tells how many points he/she has got
  4. -- Dashboard gets the total points from website 3 through REST calls and also to redeem points the dashboard redirects to website 3 which consists of items that user can purchase with those points (Website 3 is a reward site).
  5. -- the double arrows between dashboard and website 3 are REST calls.
  6. -- One more thing, the dealer only logins at website 1 or 2, from there the credentials keep on passing to dashboard and onto website 3
  7. -- dashboard doesn't need any login but website 3 does. dashboard is just an interface which welcomes the user and shows points (I know it has got no use, but it needs to be there.)

So, I just want expert advice from you on how to go about this project.
Thanks.


I was just asking chucks of this project before but now I am all confused and i think i irritated you guys also. :( pls help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!! on Checkbox click how to check from database whether clicked check match. damandeep BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 March 14th, 2011 08:39 AM
Come check out the ASP.NET 4.0 Problem - Design - Solution EAP Now Open Lee Dumond BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 12th, 2010 05:06 PM
How to check values in a Sql DataBase bex ASP.NET 2.0 Professional 15 January 2nd, 2009 10:33 AM
ASP - Random values from database cancer10 Classic ASP Databases 1 December 21st, 2006 01:24 PM
How to check if query's are present in a database rmsmit VB How-To 6 December 13th, 2005 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.