|
 Monday, September 10, 2007

Texting/SMS Your Mobile Phone From .NET (or any other technology)

This is mainly a post for myself so I can have all the resources in one area, but hopefully it helps someone else out too.

There are a few ways to send a Text Message to your phone. The most common way is to send an email to your mobile provider. Here's a list of some of the mobile providers:

T-Mobile: phonenumber@tmomail.net 
Virgin Mobile: phonenumber@vmobl.com 
Cingular: phonenumber@cingularme.com 
Sprint: phonenumber@messaging.sprintpcs.com 
Verizon: phonenumber@vtext.com 
Nextel: phonenumber@messaging.nextel.com 
Update: 2007-09-12 - I found more email domains for the text messaging sites. 
sms.3rivers.net, 3 River Wireless
mobile.mycingular.com,Cingular
messaging.nextel.com,Nextel
tmomail.net,T-Mobile
vtext.com,Verizon
paging.acswireless.com,ACS Wireles
message.alltel.com,Alltel
message.alltel.com, Alltel PCS
alphanow.net,AlphNow
paging.acswireless.com ,Ameritech
mobile.att.net,AT& T PCS
text.bell.ca,Bell Canada
wireless.bellsouth.com,Bell South
bellsouth.cl,Bellsouth
myboostmobile.com,Boost
mobile.celloneusa.com,CellularOne
sms.edgewireless.com,Edge Wireless
mymetropcs.com,Metro PCS
qwestmp.com,Qwest
messaging.sprintpcs.com ,Sprint PCS
vmobl.com,Virgin Mobile
Where phonenumber = your 10 digit phone number 

If you know your company is going to only use ______ carrier, then you can set it up in your system to automatically send emails to the carriers address as listed above.

BUT what if you don't know the carrier? There are other services out there -

TeleFlipTeleflip allows you to send a  text message to anyone that can accept a text message. The caveat here is they reserve the right to sell your email (the from email) and the destination email (the phone# to you which your sending a text message). This service works GREAT, and if you don't give a damn about letting your email and phone number get out into the wild world of SPAM, then this  is the service for  you.

How to use:

Send an email to phonenumber@teleflip.com 

where "phonenumber" is the destination phone number you want to text.

Then include a subject and body in the email and send away. The user will get the text very soon.

TeleFlip reserves the right to advertise in your text messages and reserves the right to keep and read all of your texts. So... be careful what you send. But then again, you should be careful anytime  you text something, especially when its business related.

TeleFlip was almost a "slam-dunk" for my applications until I realized they stored all source/destination addresses and reserved the right to sell them. Unfortunately, I think this is going to cost them a lot of business.

 

webservicexnet WebServiceX.NET

Web Service X provides a service that's called SendSMSWorld and SendSMSIndia. You can send a lot of messages through this web service. I've heard that it works, but I've never been able to get it working. I ran into a few issues and the support and contact areas of the site didn't even work. I received exceptions when I attempted to use them.

Hmmm.... Betsy... this sure doesn't sound like a place I can trust. Its a good place to keep an eye one just in case they fix everything and it becomes reliable.

Conclusion

I'm aware of a lot of other services out there that send text messages for you but it seems to me the best way to do it is through the carrier. Find the carrier name, and then allow the app to send it to the carrier address. That's going to be the most reliable method to get texting to work (IMO).

There are other sites out there that allow you to send text messages for free, but they are not web services that you can connect to - txt2day.com and textforfree.net are examples of these. You could use the WebRequest class in .NET (which I'll be writing about soon) and Fiddler to build an auto submission routine for you, but that's a royal pain in the arse if you ask me.

So use what works best, but for ease of use, try out the carrier method first.

#    Comments [1] |

Simulating Bandwidth in Web Applications

Many times during developing web applications you will need to simulate a users experience. Certain questions come up, such as:

  • Will this page load fast on a dial up connection?
  • What are the response times with my new AJAX functionality on a slow connection?
  • How long will it take the user to upload/download file xxx?
  • What happens when the connection is too slow?

Unfortunately its hard to simulate a users experience on 56k when you're running on a 100 megabit network. A lot of companies will simply just try to optimize their code for the worst possible scenario, whilst still being blind to what really happens on a connection that slow.

Fortunately there are ways to simulate a users slow connection.

[Note: I'm not getting any kickbacks from this company, its just a product that's helped me a TON.]

netlimiter-top-logo Net Limiter is one such product that helps us test these connection speeds. Net Limiter will allow you to select a product, such as Internet Explorer and limit it bandwidth usage. I can set it to 56k, so when I visit a web page (or a local development web server) it will only allow enough bits to pass through the wire to simulate a 56k connection.

Uses

I've used this to test web applications that utilize AJAX functions. I've used it to test uploads to my web site to see how long it would take. I've also used this to test Flash/ActionScript development.

You can also use this to test the speeds of your Silverlight Applications.

Here is a screen shot of the application in use. In the screen shot you can see the areas where you can limit the incoming or outgoing bandwidth. You can set a speed for either connection (incoming/outgoing) and you can limit one or the other.

nl2shot_limit

 

Conclusion

The question shouldn't be "why to test test network speed" but more or less "why would you NOT test your functional speed of your web application?" So before your users say your site is too slow, experience it yourself, first hand.

#    Comments [0] |
 Sunday, September 09, 2007

SubSonic on GoDaddy Shared Hosting

subsonic_logo I was trying to get SubSonic to run on a Free Hosting Environment (on GoDaddy) but unfortunately I kept getting a SecurityException when the code would attempt to save an entity. The code looked like this:

faq.Save(); // Saves a faq item to the database. 

This code would save the new FAQ entity to the database. Unfortunately this code would throw an exception. The reason the code threw an exception is because in SubSonic, the Utility.cs file trys to write to the Trace listeners. The Trace listeners have a SecurityAction that demands a security permission. On GoDaddy, they lock down this access. Why? Who knows. They're hosters, they do what they do. GoDaddy usually has everything locked down to a medium trust environment.

The documentation states that you can turn off the trace by setting a flag called "enableTrace" to false, BUT... because this doesn't work because the SecurityAction Demand walks the call stack right when its referenced in code at runtime. Since the flag is being checked in the calling code, the security action is being checked in the stack when the class is called.

This has been addressed in the SubSonic forums and it looks like it will be fixed soon. Here's how to get around it for now.

Open the source for the SubSonic project. Go into the AbstractRecord.cs and comment out any line that has the following call:

Utility.WriteTrace("...");

From my finds, those line numbers are:

  • 901
  • 948
  • 951
  • 957
  • 962
  • 995
  • 1002

Comment all of those lines out, and then recompile the SubSonic project.

Then in your project, delete your SubSonic.dll reference, and now reference the new SubSonic.dll that you just built. This DLL will not have the call that writes to the trace.

This will avoid the Security call that eventually throws the exception.
The .Save() call will now succeed.

Good luck. :)

#    Comments [2] |
 Wednesday, September 05, 2007

CodeSmith Screencast

CodeSmithLogoI recently finished a screen cast that demonstrates the use of Code Smith to create files based upon a database schema.

The Haps

In this screen cast I make a connection to the database, loop through each table in the database create a file based upon the table information. The file is exported to a directory (such as c:\temp). The files are named with the following nomenclature.

TableName.txt

Therefore, if we have a table by the name of "Customers" we will have a file in the c:\temp directory with the name of "TableName.txt".

Inside of the table file I have the names of the columns in the database.

This screen cast will introduce the Database Schema object as well as the process for registering templates and setting template properties at run time.

Click the image below or this link to view the screen cast.

CodeSmithScreenCastThumb

Downloads

CodeSmithScreenCastFiles.zip (1.17 KB)
#    Comments [0] |
 Tuesday, August 21, 2007

DB2 / SQL SERVER 2005 / .NET

db2Logo For those of you who are lucky enough to work with DB2 and .NET, you're probably already aware that you can run into some issues if you're  not using the correct DB2 Driver.

I've been writing some SSIS packages that move some data from a DB2 environment into a SQL Server 2005  dotnetlogoDatabase. I also had to write a few .NET applications that spoke to the DB2 database. Here's a couple drivers that I used and some of the notes regarding them. I've also included a few links that help in regards to development.

Drivers

 

  • IBM DB2 Driver for ODBC and CLI
    • Please note, I COULD NOT get the IBM web site to work with IE7. I had to use Firefox to download the file.  
      • Link Name: IBM DB2 Driver for ODBC and CLI
      • File Name: v9fp2_win_db2driver_for_odbc_cli.zip
    • Download the file, install and you'll have the drivers on your machine.
    • The thing is, this worked great for the BLOB/CLOB fields, but when the SSIS Package went to transform the DateTime fields it complained about data loss because DB2 has more DateTime precision than SQL Server 2005.
      • This was solved by using the Microsoft OLE DB2 Provider as it did not complain about the DateTime. The team I worked with knew that we'd lose some millionths of a second, but that was acceptable for the project. Basically the Microsoft Provider didn't complain about it like the DB2 provider did. The data came through the conversion correctly, so we were fine with it.

 

Other Useful Information/Tools

  • SQLState Error Message Reference
    • Sometimes SSIS can throw some nasty HRESULT errors your way and you're left scratching your head trying to figure out what went wrong. If the message includes a SQLState, look in this reference, it will probably be in here, or will point you in the right direction.

 

  • WinSQL Lite
    • I like to say its like the SQL Management Studio for DB2. A very nice GUI that allows you to interact with the DB2 system. A lot of "old schoolies" (as I call them) like to use the command line to hammer away at DB2. Me? I like to look at the GUI when I'm looking at tabular data. This tool will make your life 10 times easier when looking for data anomalies.
#    Comments [0] |