Home > database >  Essentially a HTTP post method call
Essentially a HTTP post method call

Time:12-23


Declare @ ServiceUrl as varchar (1000)
The set @ ServiceUrl='http://10.10.10.1:8111/esb/api/call_api.action'
DECLARE @ data varchar (Max);
Set @ data='https://bbs.csdn.net/topics/12133' - into the parameter
Declare @ Object as an Int
Declare @ the ResponseText AS varchar (8000);
The Exec sp_OACreate Msxml2. ServerXMLHTTP. 3.0, @ Object OUT;
The Exec sp_OAMethod @ the Object, the 'open', NULL, 'POST' @ ServiceUrl, 'false'
The Exec sp_OAMethod @ Object, 'setRequestHeader, NULL,' the content-type ', 'application/json. Charset=utf-8 '
The Exec sp_OAMethod @ Object, 'send', NULL, @ data, sending data
The Exec sp_OAMethod @ Object, 'the responseText, @ the responseText OUTPUT
- the EXEC sp_OAGetErrorInfo @ Object - exceptional output
Select @ the ResponseText as Response
The Exec sp_OADestroy @ Object
GO
The same code above, in this function, I have a feedback
On the server execution returns is empty, help me to analyze what's the problem, are service address through the Internet

CodePudding user response:

Caught the error, quote is msxml3 DLL 0 x80004005 error
  • Related