How to call WebService in Stored Procedures
After finding a solution for a long time, leave the following notes.
In the stored procedure, WebService is called by using system functions in the database to call Ole.
1. Search for the WebService API to obtain mssoap. soapclient.
2. Find the API interface to obtain the mssoapinit method.
3. Search for the database and execute the OLE functions sp_oacreate, sp_oamethod, and sp_oadestroy.
This is basically done, and the following is the complete storage process.
-- Set soapclient to be work Sp_configure ' OLE Automation procedures ' , 1 Reconfigure Go Declare @ Object Int Declare @ Hrint Declare @ Result Int Declare @ Objectresult Nvarchar ( 255 ) -- Sp_oacreate see more. http://msdn.microsoft.com/en-in/library/ms189763.aspx Exec @ HR = Sp_oacreate ' Mssoap. soapclient ' , @ Object Out Exec @ HR = Sp_oamethod @ Object , ' Mssoapinit ' , Null ,' Http: // localhost: 52607/webservice1.asmx? WSDL ' , ' Webservice1 ' Exec @ HR = Sp_oamethod @ Object , ' Helloworld ' , @ Objectresult Out Print @ HR If @ HR <> 0 Begin Exec Sp_oageterrorinfo @ Object Print @ Object End Else Begin Print @ Objectresult End Exec @ HR = Sp_oadestroy @ Object Go
From http://www.cnblogs.com/chuifeng/archive/2011/03/24/1994095.html
How to call WebService in Stored Procedures
After finding a solution for a long time, leave the following notes.
In the stored procedure, WebService is called by using system functions in the database to call Ole.
1. Search for the WebService API to obtain mssoap. soapclient.
2. Find the API interface to obtain the mssoapinit method.
3. Search for the database and execute the OLE functions sp_oacreate, sp_oamethod, and sp_oadestroy.
This is basically done, and the following is the complete storage process.
-- Set soapclient to be work Sp_configure' OLE Automation procedures ' , 1 Reconfigure Go Declare @ Object Int Declare @ Hrint Declare @ Result Int Declare @ Objectresult Nvarchar ( 255 ) -- Sp_oacreate see more. http://msdn.microsoft.com/en-in/library/ms189763.aspx Exec @ HR = Sp_oacreate ' Mssoap. soapclient ' , @ Object Out Exec @ HR = Sp_oamethod @ Object , ' Mssoapinit ' , Null , ' Http: // localhost: 52607/webservice1.asmx? WSDL ' , ' Webservice1 ' Exec @ HR = Sp_oamethod@ Object , ' Helloworld ' , @ Objectresult Out Print @ HR If @ HR <> 0 Begin Exec Sp_oageterrorinfo @ Object Print @ Object End Else Begin Print @ Objectresult End Exec @ HR = Sp_oadestroy @ Object Go
From http://www.cnblogs.com/chuifeng/archive/2011/03/24/1994095.html