.NET Web Services, my first attempt...

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Over the weekend I decided to pick up C# and start learning some .NET. It doesn't do the most work, but the way it does what it does is awesome. ;)

Download ZIP file

You must have the .NET framework installed in order for it to run. Also, you have to extract the application in order to run it. It will not run directly from Winzip. Lastly, I'm sure everyone will find a sh*tload of bugs and it won't work on everyones box, but I just finished and wanted to show everyone. :D
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
we had pretty similar weekends :) btw, if you need a host, you can use brinkster.com... they have an asp.net enabled server.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Just for ease, I installed IIS on my development box. Seems to work ok for now. So which language did you decide to work on?
 

joohang

Lifer
Oct 22, 2000
12,340
1
0
Sweet. I'll share mine in a second too. I worked on a spamming application over the weekend for sending mass emails for e-newsletter distribution.
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
i did a hodgepodge of stuff... much of saturday was spent reinstalling vs.net... i had made the mistake of installing vs.net before IIS. i mostly experimented with C#.. and getting familiar with the classes windows uses. my first look at windows programming... it's interesting :)
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
I've written a SendMail application in Java for work. Needless to say, we've used that application a few times. ;)
 

joohang

Lifer
Oct 22, 2000
12,340
1
0
Cool.

So, the "add" Web Service, huh? :) It seems to be everybody's favourite first Web Service experience. It worked well for me. Good job! :)

Here's mine:
Download Linkie

It works with any Access database with any text field filled with email addresses. Have fun. :)

Note: It will return an error if it doesn't authenticate with your SMTP server properly. You may also use localhost as SMTP if your computer has a built-in SMTP service.
 

joohang

Lifer
Oct 22, 2000
12,340
1
0


<< Nice ;)

Is that using any Web Services?
>>


Nope. No use for it. :)

It does use A LOT of XML, though. I will be writing updated version of this app as a learning project to constantly improve my OOP skills.

Web Services is very over-hyped. It does an incredible job for what it's supposed to do, and .NET does so much work for us, but it is not very efficient. So it's cool but it's to be avoided if possible.
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Good point. I guess it's appealing to the newer crew looking at .NET. ;)

Excuse the ignornace, but how can you implement XML in an app such as yours? I've been trying to grasp XML and its theory, but I'm having a tough time. :(
 

joohang

Lifer
Oct 22, 2000
12,340
1
0


<< Good point. I guess it's appealing to the newer crew looking at .NET. ;) >>


:) I began .NET by writing a bunch of learning apps in the Console. :) The first Web Service was almost exactly what you've done. I wrote an Add Web Service and consumed it from Windows Forms, Web Forms, Mobile Web Forms and even on Mobile Windows Forms (on a PocketPC with .NET Compact Framework).



<< Excuse the ignornace, but how can you implement XML in an app such as yours? I've been trying to grasp XML and its theory, but I'm having a tough time. :( >>


A properly designed .NET app is separated into 6 layers - UI, Business Facade, Business, Data, Data Store, and Entities. Under this design, each layer does ONLY what it is supposed to do. So the Data layer, for example, ONLY runs ADO.NET and SQL queries. Between these layers, Entity objects are passed, and XML works really well for keeping track of object state between them.

In my case, I only separated the app into 2 layers for the sake of just getting it done. And 6 layers is an overkill for simple apps like this. I could have avoided using XML, but my app ran more stable probably because I'm already quite used to coding XML. :) When I extracted tableNames, fieldsNames, and previewData, I used DataSet to temporarily store them and converted them into XML.

Also, when you click on the "Spam 'em all" button, an XML string is passed to the business object with a list of email addresses. I could've used an array, but XML could be easier to work with later when I expand this app to pass around FirstName and LastName (and whatever else) along with email addresses.

So hopefully that made some sense. :) I am still learning so don't take my words fully. :)
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Yeah, that helps alot, thanks. ;)

I think I'm going to expand my application some and add more features. To continue learning some of this stuff. This is my first real experience with a Windows environment (programatically). :)
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
This is my first real experience with a Windows environment (programatically). :)

after the programming classes i took, it's a pleasant thing for me, not having to write everything from scratch :)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
I have a slew of web services that I use internally, most of which are just for novelty use.

The Google API is a pretty cool use of web services, so have a look-see. I've found quite a few uses of it, and use it quite a bit internally. I'll be presenting my use of it next month at my local .NET User Group. I'll post a thread and a link when it's available.
 

joohang

Lifer
Oct 22, 2000
12,340
1
0


<< The Google API is a pretty cool use of web services, so have a look-see. I've found quite a few uses of it, and use it quite a bit internally. I'll be presenting my use of it next month at my local .NET User Group. I'll post a thread and a link when it's available. >>


Cool. :)
 

AMDPwred

Diamond Member
Mar 22, 2001
3,593
0
0
Yeah, I downloaded the Google API last night. Hopefully next weekend I'll have some time to work with it. ;)