1 exec sp_configure 'show advanced options', '1'; 2 go 3 reconfigure; 4 go 5 exec sp_configure 'clr enabled', '1' 6 go 7 reconfigure; 8 exec sp_configure 'show advanced options', '1'; 9 go 10 11 ALTER DATABASE SWMES set TRUSTWORTHY on; 12 13 GO 14 15 CREATE ASSEMBLY SAPWebserviceCLR 16 FROM 'D:XXXXXWebserviceCLR.dll' 17 WITH PERMISSION_SET = UNSAFE 18 19 GO 20 21 CREATE PROCEDURE [dbo].[CLR_CallWebServiceByProc] 22 @url [NVARCHAR](4000) = N'', 23 @methodName [NVARCHAR](4000) = N'', 24 @inputParas [NVARCHAR](4000) = N'', 25 @wcfAddress [NVARCHAR](4000) = N'', 26 @userName [NVARCHAR](100) = N'', 27 @passWord [NVARCHAR](100) = N'', 28 @domain [NVARCHAR](100) = N'', 29 @returnMsg [NVARCHAR](MAX) OUTPUT 30 WITH EXECUTE AS CALLER 31 AS 32 EXTERNAL NAME [SAPWebserviceCLR].[StoredProcedures].[InvokeWebServiceByProc] 33 GO