In my previous post, I gave a brief introduction to Web Services and started to discuss PostalMethods, one of many public Web Services available that can be invoked by EBI. Today’s blog will focus on how I configured EBI to use the PostalMethods API along with some useful features that can taken advantage of in their control panel.
Before constructing an Invoice spreadsheet that I was going to use for this proof of concept, I still needed to know how to submit the recipient’s address to PostalMethods. PostalMethods supports two methods of submitting the recipient’s address: Address Inside and Address Outside. “Address Inside” means that it is up to the software to embed the recipient’s address in the document, and PostalMethods will extract this information for record keeping. “Address Outside” means the recipient’s address is found outside of the document, and PostalMethods will embed the address in the document for you. PostalMethods does not support “Address Inside” for Excel and a few other file types. I prefer the “Address Outside” approach because you leave it up to PostalMethods to embed the recipient’s address in the correct location of your document so that it is folded and displayed correctly through the envelope.
I was now ready to test PostalMethods. I created an Invoice spreadsheet template following the specifications for how to set my margins. Next, I imported PostalMethod’s WSDL along with the Invoice spreadsheet into EBI, created some test data in a database, imported the database information into EBI, and created a Database to Excel transformation to produce an Invoice spreadsheet. This spreadsheet was then base 64 encoded and packed into an XML document along with my username/password for PostalMethods and the recipient’s address. Finally, I invoke the Web Service Consumer using the XML I just assembled as my SOAP request. I then get a -900 status code, which means it was submitted to PostalMethods for processing (list of returned status codes).
PostalMethods will send you an email confirming that it received the document. The Excel document is then converted into a PDF document, followed by embedding the recipient’s address in the appropriate position. An email notification is sent when this process is finished. While waiting for PostalMethods to dispatch, you may login to PostalMethod’s control panel to view the status of your document and also view a simulation of how your document will look when you receive it printed. What I really like is that it also gives you a sample image of how the document will look folded inside of the envelope. I used this envelope preview a lot when I was tweaking the Invoice spreadsheet template so that the sender’s address displays correctly. Finally, an email notification is sent when PostalMethods has delivered the letter to the post office.
You can sign up for a free account to test PostalMethods. While in Development mode, it will not actually print and mail the document, it will only simulate the process. For this exercise, I purchased their $10 plan and sent the Invoice to my home address. Three business days later, I received the letter!
If you do not mind exposing possibly sensitive information to a company like Interfax US Inc. (the company that owns PostalMethods and InterFAX, a site that offers a public API for sending and receiving faxes), I would recommend using the PostalMethods service if you need to automate sending snail mail via EBI.