Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9108879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:54:31+00:00 2026-06-17T02:54:31+00:00

I want to call a webservice from TSQL in SQL Server 2000. I tried

  • 0

I want to call a webservice from TSQL in SQL Server 2000. I tried with the following code:

Declare @Object as Int; 
Declare @ResponseText as Varchar(8000);
Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get','http://server/ws/service1.asmx/Test', 'false';
Exec sp_OAMethod @Object, 'send';
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT;
Select @ResponseText Resultado;
Exec sp_OADestroy @Object;

For this to work I had to enable Ole Automation:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO

In my test server works fine, the problem is that on the production server to run

sp_configure 'Ole Automation Procedures', 1; 

I get the following error:

The configuration option ‘Ole Automation Procedures’ does not exist, or it may be an advanced option.

When running

exec sp_configure 

on the test server brings the record “Ole Automation Procedures” on the production server not.

Update

I modify the code to catch the error:

Declare @Object as Int; 
Declare @ResponseText as Varchar(8000);
Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec sp_OAMethod @Object, 'open', NULL, 'get','http://server/ws/service1.asmx/Test', 'false';
Exec sp_OAMethod @Object, 'send';
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT;
EXEC sp_OAGetErrorInfo @Object
Select @ResponseText Resultado;
Exec sp_OADestroy @Object;

The instruction “sp_OAGetErrorInfo EXEC @ Object” return: (0x8004271A
) Error in srv_convert.

According to Microsoft (link) is a problem of SqlServer. Since in my case the result of the webservice exceed 4000 characters.

How I can call a webservice from TSQL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:54:32+00:00Added an answer on June 17, 2026 at 2:54 am

    I solved it the following way:
    Create a VBScript file (callWS.vbs) with the following code:

    if WScript.Arguments.Count = 1 then
        Set http = CreateObject("Microsoft.XmlHttp")
        http.open "GET", WScript.Arguments(0), FALSE
        http.send ""
        WScript.Echo http.responseText
    else
        WScript.Echo "Not was provided the WS address."
    end if
    

    Then in TSQL:

    declare @Command varchar(100)
    declare @RetInfo varchar(8000)
    select @Command = 'cscript c:\callWS.vbs "http://server/ws/service1.asmx/Test"'
    print @Command
    exec @RetInfo = master.dbo.xp_cmdshell @Command
    print @RetInfo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to call webservice from domain A with the C# code in Domain
I want to call a webservice from jQuery. How can I do that?
I am a newbie to Android platform. I want to call a webservice from
I'm dealing with a SOAP webservice call from a server that is expecting to
I need to call a webmethod of a webservice asynchronously from code behind of
I can call a webservice with KSOAP2 from android,now i want to know is
I want to get the header information from a webservice call. That service returns
I have created a webservice and want to call it from javascript , for
I want to call the following webservice as mentioend on this link http://dev.joget.org/community/display/KB/JSON+API#JSONAPI-web%2Fjson%2Fworkflow%2Fprocess%2Flist So
I want to call a webservice from a J2ME application : public String alimenterBaseDeDonneesEtapeProsp(

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.