TSQL Web service (CLRProcedure or MSXML2.XMLHTTP)

  • HI,

    I am trying to invoke a web service in TSQL procedure, and I was trying to find the best option.

    CLR Procedure or MSXML2.XMLHTTP

    1. Which one is the best option?

    2. Can anyone tell me advantages and disadvantages of two methods?

    Thanks

  • Take a look at this article:

    http://www.databasejournal.com/features/mssql/article.php/3821271/Calling-a-Web-Service-from-within-SQL-Server.htm

    It was linked from last week's newsletter.

    MSXML2.XMLHTTP, as far as I know, is not thread safe, so I would not recommend it.

    Hope this helps.

    Gianluca

    -- Gianluca Sartori

  • MSXML2.XMLHTTP, as far as I know, is not thread safe, so I would not recommend it.

    Thanks. Can you please explain this more and why? and how this problem solved in CLR procedure?

  • XMLHTTP, a COM-wrapper around the classing WinInet library is designed to be used on the client-side to send HTTP requests to the server. Whereas, ServerXMLHTTP was introduced in MSXML 3.0 to support server-safe HTTP access. ServerXMLHTTP is based on WinHTTP, a new HTTP protocol stack, designed to be used on the server-side to send HTTP requests.

    This means that the XMLHTTP object is not coded to ensure it can handle multiple resquests at a time, because it relies on a non thread safe implementation of the TCP/IP stack. XMLHTTP is coded to be used in the browser to handle one request at time.

    Regards

    Gianluca

    -- Gianluca Sartori

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

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