SQL Server Stored Procedure Call WebService

Source: Internet
Author: User
1. Publish the WebService. The service content is to query the user name through the mobile phone number. 2. Write the stored procedure. (20) (200) (5000) sp_OACreate, @ objout, @ url, falsesp_OAGetProperty, @ responseoutsp_OADestroy @ objend Description: sp_OACreate creates an OLE object instance. First Parameter

1. Publish the WebService. The service content is to query the user name through the mobile phone number. 2. Write the stored procedure. (20) (200) (5000) sp_OACreate, @ obj out, @ url, false sp_OAGetProperty, @ response out sp_OADestroy @ obj end Description: sp_OACreate creates an OLE object instance. First Parameter

1. Publish the WebService and Hong Kong server. The service content is to query the user name through the mobile phone number.

2. Write a stored procedure

. (20) (200) (5000) sp_OACreate, @ obj out, @ url, falsesp_OAGetProperty, @ response outsp_OADestroy @ objend

Note:

Sp_OACreate: Create an OLE object instance.

  • The first parameter is the program identifier (ProgID) or Class Identifier (CLSID) of the OLE object ).
  • The second parameter is the returned object token, which must be a local variable of the int type and must be used in subsequent methods. OUTPUT parameter, Vm, must be added with OUT or OUTPUT.
  • Sp_OAMethod: Call the OLE object method.

    Sp_OAGetErrorInfo gets OLE automation error information.

    Sp_OADestroy releases the created OLE object.

  • The first parameter is the object token.
  • In addition, on the Hong Kong virtual host, sp_OAGetProperty gets the attribute value of the OLE object. sp_OASetProperty sets the attribute of the OLE object as a new value. sp_OAStop stops the OLE Automatic stored procedure execution environment within the server. These are relatively simple.

    Iii. Execution of Stored Procedures

    .

    The result is as follows:

    Wu Yanhua

    4. Possible Errors

    1. Question 1

    Solution:

    You can use the sp_configure system stored procedure to view and change the current value of the Ole Automation Procedures option.

    View the current settings of OLE Automation Procedures.

    ; GO

    Enable OLE Automation Procedures.

    Sp_configure, 1; GORECONFIGURE; GOsp_configure, 1; GORECONFIGURE; GO

    2. Question 2

    Solution:

    In the webservice Add under Node

    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.