Showing posts with label webservices. Show all posts
Showing posts with label webservices. Show all posts

Sunday, February 12, 2012

Calling WebServices Asynchronously from SQL CLR

I'm assuming it's possible to call a web service asynchronously from a SQL CLR function, is this correct or is there a fundamental flaw in calling the asynchronous methods?

I've tried coding a sample and despite creating a new thread, which in turn calls the web service asynchronously and using newthread.join I can never get the webmethodasync_completed sub to be called.

There is a fundamental flaw in using SQL CLR in this fashion. For starters, the thread you spawn is not visible through any management tools for SQL Server. So if the thread runs amuck, there is no way (that I have found yet) to kill that thread. Of course, you will need to deploy an UNSAFE assembly.

As for asynchronous call from SQL CLR, I would be willing to bet a very small amount of money (since I haven't ried it myself, mind you) that it isn't possible.

So can I ask, what exactly is it that you are trying to do? Perhaps there is another way to find a solution to your issue that doesn't involve the techniques you have already tried doing.

Calling WebServices Asynchronously from SQL CLR

I'm assuming it's possible to call a web service asynchronously from a SQL CLR function, is this correct or is there a fundamental flaw in calling the asynchronous methods?

I've tried coding a sample and despite creating a new thread, which in turn calls the web service asynchronously and using newthread.join I can never get the webmethodasync_completed sub to be called.

There is a fundamental flaw in using SQL CLR in this fashion. For starters, the thread you spawn is not visible through any management tools for SQL Server. So if the thread runs amuck, there is no way (that I have found yet) to kill that thread. Of course, you will need to deploy an UNSAFE assembly.

As for asynchronous call from SQL CLR, I would be willing to bet a very small amount of money (since I haven't ried it myself, mind you) that it isn't possible.

So can I ask, what exactly is it that you are trying to do? Perhaps there is another way to find a solution to your issue that doesn't involve the techniques you have already tried doing.

Calling Webservice

Hi,
I have set the Reporting WebServices WebService Directory Security in
IIS to Windows Authentication. The authentication setting in the
config file is set to "Windows" with Impersonation set to "true".
I created an account called "RSAdminUser" with which to call the
webservice.
When calling the "ListReportsUsingDataSource" method, after setting
the credentials to this "RSAdminUser", I get the following error:
"System.Web.Services.Protocols.SoapException: The permissions granted
to user 'SERVER\RSAdminUser' are insufficient for performing this
operation. --> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException:
The permissions granted to user 'SERVER\RSAdminUser' are insufficient
for performing this operation. at
Microsoft.ReportingServices.Library.RSService.ListReportsUsingDataSource(String
path) at Microsoft.ReportingServices.WebServer.ReportingService.ListReportsUsingDataSource(String
DataSource, CatalogItem[]& Reports) -- End of inner exception stack
trace -- at Microsoft.ReportingServices.WebServer.ReportingService.ListReportsUsingDataSource(String
DataSource, CatalogItem[]& Reports)"
I have methodically given this user permissions to all of the relevant
folders and files that I can think of, but the only thing that makes
this work is making "RSAdminUser" a member of the "Administrators"
group. Is it possible that only members of the "Administrators" group
are allowed to execute this method?
Is there an alternative solution? What permissions does this account
need to execute this method?
Thanks in advance,
AmyHi Amy:
Reporting services uses roles based authorization, and the default
setup only places the local administrator into a role.
While RSAdminUser might have rights to access all the files and
folders in the reporting services installation, you still have to put
the user into a "role". Roles are how RS determines who can browse a
folder, who can view a report, who can manage a data source etc.
From your reports home page you can go to Site Settings -> Configure
site wide security (link is at the bottom). Perhaps you should define
a new role for RSAdminUser and grant just enough authorization for the
user to get the things done you need.
Hope this helps,
--
Scott
http://www.OdeToCode.com
On 3 Aug 2004 05:04:48 -0700, amydudley@.webmail.co.za (Amy) wrote:
>Hi,
>I have set the Reporting WebServices WebService Directory Security in
>IIS to Windows Authentication. The authentication setting in the
>config file is set to "Windows" with Impersonation set to "true".
>I created an account called "RSAdminUser" with which to call the
>webservice.
>When calling the "ListReportsUsingDataSource" method, after setting
>the credentials to this "RSAdminUser", I get the following error:
>"System.Web.Services.Protocols.SoapException: The permissions granted
>to user 'SERVER\RSAdminUser' are insufficient for performing this
>operation. --> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException:
>The permissions granted to user 'SERVER\RSAdminUser' are insufficient
>for performing this operation. at
>Microsoft.ReportingServices.Library.RSService.ListReportsUsingDataSource(String
>path) at Microsoft.ReportingServices.WebServer.ReportingService.ListReportsUsingDataSource(String
>DataSource, CatalogItem[]& Reports) -- End of inner exception stack
>trace -- at Microsoft.ReportingServices.WebServer.ReportingService.ListReportsUsingDataSource(String
>DataSource, CatalogItem[]& Reports)"
>I have methodically given this user permissions to all of the relevant
>folders and files that I can think of, but the only thing that makes
>this work is making "RSAdminUser" a member of the "Administrators"
>group. Is it possible that only members of the "Administrators" group
>are allowed to execute this method?
>Is there an alternative solution? What permissions does this account
>need to execute this method?
>Thanks in advance,
>Amy