Can a SQL trigger call a web service?

前端 未结 5 379
夕颜
夕颜 2020-12-15 07:15

I\'m building out a RESTful API for an iPhone app.

When a user \"checks-in\" [Inserts new row into a table] I want to then take data from that insert and call a web

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 07:45

    Trigger->Queue->SP->XP_XMDShell->BAT->cURL->3rd party web service

    I used a trigger to insert a record in a Queue table, then a Stored procedure using a cursor to pull Queued entries off.

    I had no WSDL or access to the 3rd party API developers and an urgent need to complete a prototype, so the Stored Procedure calls XP_CMDShell calling a .bat file with parameters.

    The bat file calls cURL which manages the REST/JSON call and response.

    It was free, quick and works reliably. Not architecturally pure but got the prototype off the ground.

提交回复
热议问题