Web Service, Web Handler, Oh My! - Connecting Flex app to SQL Server table

1186
7
09-28-2011 04:32 AM
CarmenDurham
Occasional Contributor II
All,

I have tried to Google this question, with results not too helpful.

Could someone explain the difference between a Web Handler and Web Service with regards as to which would be better to use if we need to pass a unique ID (for fire Pre Plan) to a SQL Server table (FireHouse application) to retrieve information about that item?

I am seeing some indication that the Web Service is the way to go but I am having trouble creating one (using some online tutorials) in VS 2008.  Keep getting a "cannot create Web Service" error. Which I am sure is due to my lack of experience with .net and VS2008!

I have used a Web Handler before for creating XMLs to use in autocomplete component (like addresses or street names).  But that was a Web Handler I got from ESRI and all I had to do was alter some text, didn't have to build it in VS Studio.  Plus, I am not performing a query either.

Thank you for any advice.
Thanks,
Carmen
Tags (2)
0 Kudos
7 Replies
CarmenDurham
Occasional Contributor II
In case my terminology is wrong - Web Handler using an .ashx in .net vs. Web Service which uses .asmx in .net.
0 Kudos
KomanDiabate
New Contributor III
I tried "flex connector for ms sql server", it cost about $40, seems to work pretty well.
Web services should also work, but they can be tricky to put together.
0 Kudos
CarmenDurham
Occasional Contributor II
Thanks, I will look into the connector if the following doesn't work out...

The City's main website administrator has a contractor she uses for programming.  He suggested a WCF service instead of an .asmx web service and said he could help us put one together in an hour's time.  He indicated that WCF web services are the standard now.

GIS doesn't have funding for  a consultant but the web admin offered to pay for the hour!  The fee is such that it was definitely worth trying vs my floundering for hours. Once it is in place and works, then we will be able to use it as an example for other situations.

Thanks,
Carmen
0 Kudos
NasifAlshaier
New Contributor
I tried "flex connector for ms sql server", it cost about $40, seems to work pretty well.
Web services should also work, but they can be tricky to put together.


Hello..
I downloaded the zip project.... Would please give some info on how you use it in your project..

Thanks Nasif
0 Kudos
HaroldBostic
Occasional Contributor II
Hello,

The difference between .ashx in .net vs. Web Service which uses .asmx is significant.  The real question is what's the difference between .ashx and aspx.  The difference there is that the .ashx does not go through the full life cycle that the aspx page does when it is requested.  I use .ashx methods when I do authentication from a flex app or when I want to upload files to a server.  I use a web service .asmx when I want to provide myself a bunch of operations that are better done, or can only be done, on the server, like retrieving data from a non sde datasource, bulk inserts, etc.  Like you were saying, .asmx (SOAP based messaging) is more comparable to WCF services.  .asmx and WCF expose there capabilities so you know what the methods are at compile time.  FLEX provided many mechanisms out of the box for working with those services.  You could use the Data/Services configuration manager to connect to your remote source and it will create all the boiler plate code needed for you to access the services on the client side by way of remote objects.  WebORB is a good middle man and is free for scenarios like this as well.

This website has a good example of connecting to a .ashx file, but the same process can be used to connect to any web service: http://www.amergerzic.com/post/FlexASPAuthentication.aspx
0 Kudos
TimothyBaldwin
New Contributor II
I will second WebORB as a good middleware solution.  It has really sped up the response and development time for all my Flex applications that need to get data from a database.  WebORB has solutions for connecting Java and .NET web services (and classes) to Flex (or Silverlight).
0 Kudos
KomanDiabate
New Contributor III
Nassif:
The tool comes with a detailed documentation that you have to follow to make it work. I think they provide tech support also.
Good luck.
0 Kudos