You have some kind of order entry form in your application where you enter customer details. Name, address, e-mail, etc. Wouldn't it be handy to know whether those details are valid? For example, the e-mail address you've been given could be wrong or the employee keying it in makes typos. Or the e-mail address was once right but has now been removed.
Enter StrikeIron! StrikeIron lets you instantly validate all customer contact information. Below you see a simple example. I have a text field where I entered my own e-mail address and via a StrikeIron service I get back a bunch of XML. The complete UI for this would show GUI components, probably checkboxes, with values filled in from the parsed XML, but for the moment I'm simply showing the XML payload in an editor pane:
In the context of NetBeans IDE, this doesn't make much sense since you're not going to be validating e-mail addresses while coding, most of the time. But imagine you have a business application on the NetBeans Platform, or a web application or any other business application on whatever framework, where customer details need to be entered. That's when the StrikeIron services become very interesting.
How does it work? Well, aside from the StrikeIron SOAP services that are part of NetBeans IDE, and that have been there for several years already as this 2009 blog entry by StrikeIron CTO and co-founder Bob Brauer shows, there are also REST endpoints that you can use:
- The VerifyEmail operation is called to perform email verification and hygiene on an email address. The
URL for that operation with specific parameters is as follows:
http://ws.strikeiron.com/StrikeIron/emv6Hygiene/EMV6Hygiene/VerifyEmail?
LicenseInfo.RegisteredUser.UserID=&
LicenseInfo.RegisteredUser.Password=&
VerifyEmail.Email=&
VerifyEmail.Timeout=&
VerifyEmail.Option alSourceId= - The NorthAmericanAddressVerification operation is called to perform address verification on an address. The URL for that operation with specific parameters is as follows:
http://ws.strikeiron.com/StrikeIron/NAAddressVerification6/
NorthAmericanAddre ssVerificationService/NorthAmericanAddressVerification?
LicenseInfo.Registered User.UserID=&
LicenseInfo.RegisteredUser.Password=&
NorthAmeric anAddressVerification.AddressLine1=&
NorthAmericanAddressVerification. AddressLine2=&
NorthAmericanAddressVerification.CityStateOrProvinceZIP OrPostalCode=&
NorthAmericanAddressVerification.Country=&
North AmericanAddressVerification.Firm=&
NorthAmericanAddressVerification.Ur banization=&
NorthAmericanAddressVerification.Casing=
There's other services too, such as an SMS service, which is pretty cool.
Finally, how did I integrate the REST service into a NetBeans Platform TopComponent? Using HttpClient, exactly as I did recently with the TestFairy REST service, as documented here. I literally copied all the code from there and then just changed the URL and the variables.