I want to validate the given address (address, city, state, zip) to the USPS and return back the result if the provided address is a valid address. and if it is not the valid ad
If I may chime in here -- I used to work in the address validation industry for SmartyStreets, which is a CASS-Certified vendor of these services.
Note first that, while the USPS is the authority on address data, their forte is NOT maintaining an API and providing support. Also, be sure to note the agreement which you signed:
- User agrees to use the USPS Web site, APIs and USPS data to facilitate USPS shipping transactions only.
So unless you're mailing or shipping with the USPS by the use of their API, it's not agreeable to use the API at all. This among the other problems you're having is grounds to look for a better solution -- if I was you.
Anyway, there are actually quite a few out there. I'll let you do your own research, but of course I would suggest one that I've worked on called LiveAddress. It's free, and returns more data and is more reliable than the USPS' API.
Update: Here's some C# code examples on GitHub that will probably be useful.