How to call a webservice from store proc.?

  • I'm looking a t-sql code for call a webservice from store proc (triggers).  If I call the webservice from web it works but if I call from trigger (using xp_cmdshell) don't.

    Ideas?

    Ricardo

  • If you are using xp_cmdshell check the permissions for the proxy account.

    Does it display any error?

     

  • No errors are displayed.

    About what are you talking when you write "proxy account", i think is the same permissions if you call the webservice from browser or from cmd shell (or not?)

     

  • When you run xp_cmdshell with a non sa account, it's executed in the context of the proxy account, so this account needs access to the objects.

    From BOL, "xp_cmdshell":

    When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed server role, xp_cmdshell will be executed under the security context in which the SQL Server service is running. When the user is not a member of the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy account, which is specified using xp_sqlagent_proxy_account.

  • Thanks mdaniel,

    Let me try.  I'm almost sure that's the solution.

    Bye

  • Try if at all possible not to call a web service from TSQL and it is even worse from a trigger!!

    Just my $0.02

     


    * Noel

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply