SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


CLR integration calling web service error


CLR integration calling web service error

Author
Message
cmsUser
cmsUser
SSC Journeyman
SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)

Group: General Forum Members
Points: 75 Visits: 52
Hi,
I have developed my clr integrated call according to the following logic:

1) call a SSRS report
2) save the report as a PDF in a specific folder location using foll code:

// get pdf of report
Byte[] results = rsExec.Render("PDF", deviceInfo,
out extension, out encoding,
out mimeType, out warnings, out streamIDs);

FileStream fs = new FileStream(@"C:\Temp\PDF\rep.pdf", FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(results, 0, results.Length);
fs.Close();

3) I have created by assembly using sgen fine,
4) created the mapped stored proceedure to call the assembly defined code
CREATE PROCEDURE dbo.testSP
(
@Param(20)
)
AS EXTERNAL NAME
Assembly.[Assembly.StoredProcedures].sp_clr

5) However, whenever I exculte the SP, an error is always thrown as per below:

Msg 6522, Level 16, State 1, Procedure sp_clr, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "testSP":
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
System.Security.SecurityException:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Net.CredentialCache.get_DefaultCredentials()
at emlPDFStatement.StoredProcedures.sp_clr(String cust)

6) Because my clr code is writing a file, the error is most probably related to a security issue. I have used credidential that has the requiired rights.

7) I have googled the error and applied recommeded solutions but wihout any success.

I would be very much if any one could advise on the resolution or better point me to a small project that works fine along the above lines.

Thank you very much in advance.
:-)
cmsUser
cmsUser
SSC Journeyman
SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)SSC Journeyman (75 reputation)

Group: General Forum Members
Points: 75 Visits: 52
Somehow I was creating my assembly with permisssion_set = safe and once I changed to EXTERNAL_ACCESS, it worked like a charm.

I have noted the detailed steps and if anyone is facing similar issue, then please let me know and I will help.

cheers
avdhut.k
avdhut.k
SSChasing Mays
SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)SSChasing Mays (611 reputation)

Group: General Forum Members
Points: 611 Visits: 266
Hi,
I want to use CLR Integration in Reporting Services,I want to apply the password security to report generated through SSRS 2008.
Please Help me.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search