SQL Server as a Web Service Client

Suppose a URL is provided, http://test.org/service.asmx

How can I use the SOAP method in SQL Server to access the service?

+3
source share
3 answers

You can write managed code (C # or VB.NET) and run it with SQLServer. And you can write a SOAP client with .NET, of course.

Good luck.

+2
source

That should work too

Declare @Object as Int ;

Declare @ResponseText as Varchar(8000) ;

Exec sp_OACreate 'MSXML2.XMLHTTP', @Object OUT ;
Exec sp_OAMethod @Object, 'open', NULL, 'get',
    'http://www.webservicex.com/stockquote.asmx/GetQuote?symbol=MSFT', --Your Web Service Url (invoked)
    'false'
Exec sp_OAMethod @Object, 'send'
Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT

Select  @ResponseText

Exec sp_OADestroy @Object

But I also think it's better to write a CLR function that you use from your sp

+2
source

- (SQL Server 2005), , InfoPath. SharePoint, , . , . -, www.macrotesting.com, . ...

...

Meganathan..

0

Source: https://habr.com/ru/post/1710818/


All Articles