Thursday, May 21, 2009

Azure - Simple Applicaiton - Security Exception Error

I have recently deploy Azure Application to see how Microsoft Cloud Application will work. In this process I come across Security Exception Error which took me while to figure out. So, if you have same issue make sure you do the following:

Here is the error message:

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.

1. In your "could" project make sure you open ".csdef" file and edit the following
WebRole name="WebRole" enableNativeCodeExecution="true">

Make sure you have enableNativeCodeExecution="true"

2. You should also make your "web_role" project open web.config file and make sure you have the following:


3. If you page still gives error message then you set all your <@Page Debug = "true"

4. Make sure you have customErrors mode="Off" in web.config file


This should make your application work on Azure Cloud Please don't forget to visit my website at: http://www.lookfordeal.com

Tuesday, May 12, 2009

Oracle Package - Basics

Here is a sample of oracle package in which I will send startIndex as integer and endIndex as integer. In returns it will return me customer list

create or replace PACKAGE BODY PKG_GET_THANKYOU_customer_LIST AS

procedure getThankyouNames(startIndex IN number, endIndex in number,myMethodCode in varchar2, out_cursor OUT Thank_Cur) AS

localThank_Cursor Thank_cur;
BEGIN
/* TODO implementation required */
/* delete from temp_ty; */
insert into temp_thankyou_cust_list
select t3.customer_sid, ws1.order_sid, t2.order_code,max(ws1.order_date) order_date, rnum,t3.cust_company_name,
t3.cust_name,t3.cust_title, t3.cust_Phone, t3.cust_phone_ext, t3.cust_fax, t3.cust_STREET_ADDR_LINE1,
t3.cust_STREET_ADDR_LINE2,t3.cust_CITY,t3.cust_ZIP_CODE,t3.cust_ZIP_PLUS4,t3.cust_STATE_CODE,
t3.MY_METHOD_CODE
from work_table_order t2, work_spec_table ws1,
(select * from
(select t1.*, rownum rnum from
(select distinct c1.customer_sid, c1.cust_company_name, c1.cust_name,
c1.cust_title, c1.cust_Phone, c1.cust_phone_ext, c1.cust_fax,
c1.cust_STREET_ADDR_LINE1, c1.cust_STREET_ADDR_LINE2, c1.cust_CITY,
c1.cust_ZIP_CODE,c1.cust_ZIP_PLUS4,c1.cust_STATE_CODE,c1.RPC_METHOD_CODE
from customer c1, work_productive_order wp1
where c1.MY_METHOD_CODE = myMethodCode and c1.customer_sid = wp1.customer_sid
and wp1.customer_sid not in (select customer_sid from thankyou_customers)
order by c1.customer_sid
) t1
where rownum <= endIndex
)
where rnum >= startIndex
) t3
where t2.customer_sid = t3.customer_sid and ws1.order_sid = t2.order_sid
group by ws1.order_sid,t2.order_code, t3.customer_sid, rnum, t3.cust_company_name, t3.cust_name,
t3.cust_title, t3.cust_Phone, t3.cust_phone_ext, t3.cust_fax, t3.cust_STREET_ADDR_LINE1,
t3.cust_STREET_ADDR_LINE2,t3.cust_CITY,t3.cust_ZIP_CODE,t3.cust_ZIP_PLUS4,t3.cust_STATE_CODE,t3.MY_METHOD_CODE;
open localThank_Cursor for
select ty1.*, substr(ws1.text_description,1,50)
from temp_thankyou_cust_list ty1, work_spec_table ws1
where ty1.order_sid = ws1.order_sid and ty1.order_date = ws1.order_date
order by ty1.customer_sid, ty1.order_code;
out_cursor := localThank_Cursor;

END getThankyouNames;

END PKG_GET_THANKYOU_cust_LIST;