sql-serverweb-serviceswonderware

How to call SOAP web service from InTouch Wonderware or SQL Server 2014


I've been trying for a while to call an existing SOAP web service from InTouch Wonderware or MS SQL 2014. It doesn't matter which of the two calls it, as the Wonderware project reads/writes to the SQL Server database anyway.

My knowledge is mostly limited to Wonderware and its in-program options to access the SQL Server database, which doesn't work well with the usual guides on the web service topic.

The web service is provided by the customer, over a decade old and outsourced, which rules out any changes to it. The goal is to request raw material data from the web service by ID, and later returning the produced material data. The parameters of each function is documented, but the only existing URL requires username/password and directly shows the content of the WSDL file. That file (when saved locally) works on SoapUI, and test cases deliver the required results.

My problem is the first step - connecting to the web service and sending/receiving the messages. WebSVC (the InTouch web service client) cannot handle the basic authentification, even failing to connect when including username and password in the link (which works in any browser). Guides on that topic are often outdated, or don't match the problem at hand.

As my knowledge of databases and web programming is limited, how can I use the web service (in a preferably uncomplicated way)? Performance doesn't matter - the database handles less than 10 requests per minute on average, and delays don't disrupt anything essential.


Solution

  • To quote Jeroen Mostert's comment: "if you're on Windows, PowerShell's New-WebServiceProxy allows you to wire up SOAP services quite easily, and inserting things into SQL Server from it is equally simple (Invoke-Sqlcmd)."

    This approach works. To sum up the steps until I got an answer from the web service: