Oil Industry Electronic Invoicing



ASP.NET MVC, Web API, Windows Services, C#, IIS, Microsoft Sql Server, RosettaNet Information Framework (RNIF), Petroleum Industry Data Exchange (PIDX), XML


Create an application to consume invoices exported by a customer’s system as csv files and process them into PIDX XML files and POST them along with their supporting documentation files via the RosettaNet Framework to a remote endpoint.


We were approached by our client, a supplier to oilfield companies, to create an application that would allow them to send their invoices, along with the supporting documents as attachments, electronically to a 3rd party administrator. The application would have to monitor directories on a server file system and when a new invoice is created automatically submit the invoice to the 3rd party administrator. The invoices are exported as flat data in a csv format. The application would have to process these invoices into PIDX compliant XML files, then include those XML files and their attachments as parts of a multipart/related POST to the remote endpoint.

Additionally, an intranet-based application was needed to maintain the customer data. A further requirement was a publicly available, SSL protected endpoint to accept the Receipt Acknowledgment from the 3rd party administrator's system.


The main challenge when creating this system was the sheer number of different technologies we needed to integrate in order to create one coherent system. There is a Windows service that monitors the file system for new invoices and does the heavy lifting of processing the files and POSTing them to the remote endpoint. In order to successfully process the csv files into XML files we had to obtain the proper schema definitions, convert them to C# classes, populate the C# classes with invoice data at runtime, and serialize the C# classes into XML files . There is also an MVC C#/SQL Server application that is used to maintain the customer data and accept the Receipt Acknowledgements. The Windows Service also has to communicate with the Sql Server database for customer specific information that needs to be included in the XML files.. We also had to create a Web API project for testing our POSTs and the Receipt Acknowledgements. Couple that with the need to precisely implement the RNIF and PIDX specifications and this was indeed a challenging application to develop.

Final Completion:

Upon final delivery of our solution we provided our client with a system that automatically submits their invoices and supporting documentation to their 3rd party processor, receives the Receipt Acknowledgments, and logs all the associated actions. Our client’s invoices are paid more quickly and accurately, and as an added bonus they no longer have to manually add the supporting documentation to their invoices, saving them at least 10 minutes for each invoice.