How to implement HTTP POST with an attachment (cXML file with PDF)

  • I generate XML files for various customers and send via WSDL or the users upload them manually (depends on customer's request).

    We now have a new customer, using standard Ariba's HTTP POST (https://service.ariba.com/service/transaction/cxml.asp) and I will be much obliged for pointing me out to a good tutorial on how to HTTP POST files with attachments using SQL Server. There are many samples using sp_OACreate and sp_OAMethod, but I couldn't find any full sample with an attachment.

    Thank you.

    • This topic was modified 4 years, 10 months ago by  BOR15K.
  • i think you are targeting the wrong tool.

    you want to use an SSIS package to pull data from SQL, and let that do the HTTP post.

    SQL, by itself, does not have the toolset to do that...as you already identified, you could use sp_OaCreate to use tools outside of SQL, so i would strongly recommend SSIS instead.

     

    this link is probably a good starting point:

    https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Much appreciated, Lowell.

  • I have tried to use SSIS, but it seems the relevant packages, like ZappySys you have mentioned above, must be purchased separately.

    Does SSIS have built-in HTTP POST functionality or is it something I will have to develop in C# and then to implement with SSIS, please?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply