Our iSeries (mainframe/as400) team has figured out a way to upgrade all our forms and can easily deposit these forms into a folder on the as400. They are looking for the fastest way to push these forms to our customers.
They ask: Is there a way I can (.NET Core Dev) retrieve their PDF statements from the mainframe (iSeries/AS400) for viewing online? The files are not exposed in Zend (the as400 webserver) but are in a specific “folder” (if you could call it that, the structure of as400 file system is different).
Though I actively employ their Zend system to utilize my own API for querying, etc, there was not much interest in this in their team other than knowing how I was calling their programs. They wanted this SPECIFIC folder to be accessed to retrieve statements.
I tried to propose a HTTP web service via Zend, other HTTP/PHP solutions… but in the end, I explained what I am currently doing: utilizing my own API to accept an authentication key with parameters (in json using PHP) and convert those parameters to the parameters they need and then calling a program. The program I call does the logic and …
We had an issue a couple of days ago where two points of failure caused some downtime and so I spent most of today revisiting all my monitors to give us as much warning as possible if one of our services fails.
One particular API I set up lives on the as400 (iSeries) and operates off of it’s ZendCore server in PHP. I quickly scripted a page to verify: connection between ZendCore PHP and db2, that the connection to that endpoint was in fact SSL, and on what port.
The PHP code is very simple and returns a JSON string that looks like this:
The slight problem today was figuring out how to get Site 24×7 to not just verify the link, but check the JSON values and verify it is what I need. If not, then send the alert. In this case, I want to verify AS400CONNECTION is true and SSL is true.
Site 24×7 suggests using a REST API monitor and then asserting the value in JSONPath. I was completely new to this and finding a good clean example was a bit tough, hopefully this saves someone some time. Here’s …
Today’s problem dealt with how we view our invoices online. We use an app on the iSeries that creates a PDF and delivers it to a set destination. That destination, in our case is a regular windows server, the files landing in a small site: pdf.mycompany.com.
My initial approach was simple, use the PHP API I have sitting on the iSeries to make a call to the program – passing it the parameters for that specific invoice, await response (which gave me the new created filename) and then redirect to that URL. The method looks something like this:
public async Task<ActionResult> GetInvoiceAsync(int invoice)
GetInvoice getInvoice = new GetInvoice();
var client = new HttpClient();
string fileName = await getInvoice.LoadPDF(invoice);
string url = "http://pdf.mycompany.com/";
url += fileName + ".pdf";
This worked great… 90% of the time, but the other 10% of the time, I clicked too quickly on an invoice and got forwarded to a 404.…
Enabling SSL certificates with Comodo’s Free 90 Day trial SSL Certificate. This process enables you to secure both web services, login, and SSL across all other servers/services on the AS400 / iSeries.
Note: If you are replacing/renewing your cert and something goes wrong, do not be afraid to delete your certificate store (if this is your only cert) and start fresh with this tutorial. I’ve done it twice, now, as the key in store had trouble matching the new cert, etc… I deleted certificate store, followed my own tutorial and was up and going in minutes.