WebService called during stored procedures

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.