RESOLVED: SR1a FedExWS

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

RESOLVED: SR1a FedExWS

Post by vhemlani » Tue Aug 09, 2011 3:28 pm

Hello,

I was attempting to apply the fedex part of the SR1a patch. I added the following files:

Admin\Shipping\Providers\FedExWS\Configure.aspx
Admin\Shipping\Providers\FedExWS\Configure.aspx.cs
Admin\Shipping\Providers\FedExWS\Register.aspx
Admin\Shipping\Providers\FedExWS\Register.aspx.cs
Bin\CommerceBuilder.FedExWS.XmlSerializers.dll
Bin\CommerceBuilder.FedExWS.dll

Now, when I browse to the following through my merchant login:
Admin/Shipping/Providers/AddGateway.aspx

I get the following error:

Code: Select all

Server Error in '/' Application.
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: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

Line 51:     {
Line 52:         IShippingProvider provider = (IShippingProvider)dataItem;
Line 53:         return provider.GetLogoUrl(Page.ClientScript);
Line 54:     }
Line 55: 


Source File: c:\inetpub\wwwroot\Admin\Shipping\Providers\AddGateway.aspx.cs    Line: 53

Stack Trace:

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   CommerceBuilder.Shipping.Providers.FedExWS.FedExWS.GetLogoUrl(ClientScriptManager cs) +0
   Admin_Shipping_Providers_AddGateway.GetLogoUrl(Object dataItem) in c:\inetpub\wwwroot\Admin\Shipping\Providers\AddGateway.aspx.cs:53
   ASP.admin_shipping_providers_addgateway_aspx.__DataBinding__control6(Object sender, EventArgs e) in c:\inetpub\wwwroot\Admin\Shipping\Providers\AddGateway.aspx:19
   System.Web.UI.Control.OnDataBinding(EventArgs e) +132
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +170
   System.Web.UI.Control.DataBindChildren() +11045679
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
   System.Web.UI.Control.DataBindChildren() +11045679
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
   System.Web.UI.Control.DataBindChildren() +11045679
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +182
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +267
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3340
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +72
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +18
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +147
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +261
   Admin_Shipping_Providers_AddGateway.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Admin\Shipping\Providers\AddGateway.aspx.cs:42
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11056951
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11056490
   System.Web.UI.Page.ProcessRequest() +91
   System.Web.UI.Page.ProcessRequest(HttpContext context) +240
   ASP.admin_shipping_providers_addgateway_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\e22c2559\92c7e946\App_Web_eqrun2od.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


Version Information: Microsoft .NET Framework Version:2.0.50727.5446; ASP.NET Version:2.0.50727.5420 
I'm able to solve this problem by removing the following line from /Admin/Shipping/Providers/AddGateway.aspx.cs

Code: Select all

protected string GetLogoUrl(object dataItem)
    {
        IShippingProvider provider = (IShippingProvider)dataItem;
        return provider.GetLogoUrl(Page.ClientScript);
    }
and also by removing the following line from /Admin/Shipping/Providers/AddGateway.aspx

Code: Select all

<asp:Image ID="ProviderLogo" runat="server" ImageUrl='<%#GetLogoUrl(Container.DataItem)%>' />
Is there another solution to this so that I can continue to have the logos on that page?

Also, I'm positive this is caused by the files I've listed above from the SR1a patch because I tried to revert my application of the SR1a patch, and this seems to work fine after that.
Last edited by vhemlani on Fri Aug 12, 2011 3:58 pm, edited 1 time in total.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: SR1a FedExWS

Post by Katie » Wed Aug 10, 2011 5:19 pm

Hi,

From the error message, it would appear the page is failing because of permissions....

Code: Select all

"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."
I haven't seen this error before, but I found a possible solution posted here -

http://dbvt.com/blog/post/AspNetHosting ... -IIS7.aspx

Can you give this a try, and let us know if it worked?

Thanks,
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

vhemlani
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Wed May 25, 2011 7:58 pm

RESOLVED: SR1a FedExWS

Post by vhemlani » Wed Aug 10, 2011 8:50 pm

This resolved it. Thanks Katie!

Post Reply