Tuesday, January 18, 2011

AspDotNetStorefront WSI Setup for eBridge

AspDotNetStorefront Version: 8.0.1.2 ML

Problem:

eBridge requires WSI to be setup in ASPDNSF for download/upload of information.

Solution:

Setup WSI according to the installation instructions located here: http://manual.aspdotnetstorefront.com/wsi/.  Instructions also included at the end of this blog.

Note that there is an issue with ASPDNSF that results in the following error when eBridge tries to connect:
System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please try later ---> System.ApplicationException: WSE842: The service pipeline could not be created. ---> System.Configuration.ConfigurationErrorsException: WSE032: There was an error loading the microsoft.web.services3 configuration section. ---> System.Configuration.ConfigurationErrorsException: WSE040: Type AspDotNetStorefront.ASPDNSFUsernameTokenManager could not be loaded. Please check the configuration file.

To fix this issue following the instructions here:
http://manual.aspdotnetstorefront.com/p-1295-server-unavailable-error-with-wsi.aspx
i.e. Find the '#if WSE3' line in the App_Code\ASPDNSFUsernameTokenManager.cs file and add the following line immediately above it: #define WSE3

Setup a customer with admin access that eBridge will use to connect.

Test the WSI by navigating to http://www.yoursite.com/ipx.asmx and manually invoke the DoItUserNamePwd method using the eBridge email/password (created in the last step) for AuthenticationEMail/AuthenticationPassword and the XmlInputRequestString below.  If everthing is setup correctly you will get a page of data containing new orders.

<AspDotNetStorefrontImport Verbose="false">
  <Get Table="Orders" Name="NewOrders">
    <XmlPackage>DumpOrder.xml.config</XmlPackage>
    <OrderBy>OrderNumber asc</OrderBy>
    <DefaultWhereClause>OrderNumber >= 100</DefaultWhereClause>
  </Get>
</AspDotNetStorefrontImport>

Installing WSI

  1. Ensure that the Microsoft Web Services Enhancements version 3.0 runtime is installed on the production web server and any development servers. This is extremely important, as without WSE 3.0 your site will fail. The WSE 3.0 components are available from:
    http://www.microsoft.com/downloads/details.aspx?familyid=018A09FD-3A74-43C5-8EC1-8D789091255D&displaylang=en
  2. Copy the IPX.asmx and IPX.xml files to the root of your website
  3. Copy the App_Code/ASPDNSFUserNameTokenManager and App_Code/IPX classes to your site's App_Code directory
  4. Open the web.config file and search for "WSI". Uncomment any elements commented as required by the WSI feature.

    To test functionality, browse to http://www.yoursite.com/ipx.asmx. If you do not receive any errors, WSI should be working. Once you are comfortable that the feature is operational you should take additional measures to secure this page, such as limiting access to an IP address or range of IP addresses (this can be done via the IIS Management Console or possibly your hosting control panel). Doing so will help to prevent malicious users from scripting attacks against the interface.

Saturday, December 18, 2010

WordPress on IIS7 Upload Image Permissions

Problem:
With WordPress installed on a Windows Server with IIS7, images uploaded via WordPress admin do not display on the blog.  Image files are being uploaded to the server successfully but do not have the correct permissions (and do not inherit permissions from the parent folder).

Solution:
Change the AppPool Identity to run as LocalSystem.

WordPressonIIS7UploadImagePermissions

Saturday, June 19, 2010

Google Website Optimizer Fails to Validate ASPDSF Original Page Source File

AspDotNetStorefront Version: 9.0.1.3 ML

Problem:

Google website optimizer fails to validate source file for “original” page.  Variation pages and conversation pages validate ok.

Solution:

View page source generate by Google Chrome does not validate.  Generate page source using FireFox or IE instead.

Friday, June 18, 2010

ASPDNSF Allow <script> Tag in RadEditor Topics

AspDotNetStorefront

Problem:

By default, admin topics not save <script> tags.  The RadEditor strips them out on save.

Solution:

For version 9, update the following file: \Admin\topics.aspx.cs


radDescription.Content = DB.RSFieldByLocale(rs, "Description", pageLocale);
//mod start: Allow script tags in topic content.
radDescription.AllowScripts = true;
//mod end

For version 8, update date the following file: \RadControls\Editor\ConfigFile.xml

<property name="AllowScripts">false</property>

Change to:

<property name="AllowScripts">true</property>

Friday, April 9, 2010

IS Delete Custom Report

Version: Interprise Suite 2007 SP 5.3.4

Problem:

How to delete a custom created report in IS.

Solution:

IS does not provide the ability to delete a custom report.  Run the following SQL script to delete a report directly from the database.  As always, backup your database and review/test this SQL for safety.

declare @ReportDescription varchar(255), @ReportCode uniqueidentifier
set @ReportDescription = 'Your Report Description Goes Here'
select @ReportCode = ReportCode from SystemMenuReportDescriptionTemplate where ReportDescription = @ReportDescription
select * from SystemMenuReportDescriptionTemplate where ReportCode = @ReportCode

delete SystemMenuReportDescriptionTemplate where ReportCode = @ReportCode
delete from SystemUserRoleMenuReport where ReportCode = @ReportCode
delete SystemMenuReportTemplate where ReportCode = @ReportCode

Saturday, April 3, 2010

Use JQuery AJAX with AspDotNetStorefront

Version: 9.0.1.2

Problem:

How to use JQuery AJAX to call an AspDotNetStorefront web service.  The web service must have access to core AspDotNetStorefront data and functionality.

Solution:

1. Add the following lines to the web.config.  If WSI has been enabled in the web.config by un-commenting lines then insert just <add name="HttpGet"/> and <add name="HttpPost"/> in the appropriate location.

<webServices>
  <protocols>
    <add name="HttpGet"/>
    <add name="HttpPost"/>
  </protocols>
</webServices>

2. Create a web service class.  Right click on the root web project and choose Add New Item –> Web Service.  In this example we name the file AJAX.  This will create two files:

  • /AJAX.asmx
  • /AppCode/AJAX.cs

3. In AJAX.cs, uncomment the following line to allow this Web Service to be called from a client side script.

[System.Web.Script.Services.ScriptService]

You can add to the top of this file: using AspDotNetStorefrontCore; etc. to access standard AspDotNetStorefront routines.

You create your server side methods here (to be called by the client). We’ll use the HelloWorld method that was created by default.

4. Create a javascript file and include it in your /App_Templates/Skin_1/JScriptsCustom/ajax.js e.g.

<script type="text/javascript" src="App_Templates/Skin_1/JScriptsCustom/ajax.js"></script>

You can of course include and call your JavaScript in anyway you like.

5. Create a JavaScript function e.g.

function MyJQueryAJAXTest() {
    $.ajax({
        url: 'AJAX.asmx/Test',
        dataType: "text",
        success: function(data) {
            alert(data);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            alert(XMLHttpRequest.responseText);
        }
    });
}

6. Calling the client-side JavaScript function will pop up an XML string with “hello world” as part of the results.  Or an error will be displayed if your setup is not correct.

7. See http://api.jquery.com/jQuery.ajax for lots more detail on calling web methods with parameters etc.

Friday, March 19, 2010

DNN Error Using AJAX Control Kit

DNN Version: 4.9.5
IIS7

Problem:

While developing a DNN module using a control from the AJAX Control Kit the following error was generated.

Unhandled error loading module.
DotNetNuke.Services.Exceptions.ModuleLoadException: Unhandled Error Adding Module to TopPane ---> DotNetNuke.Services.Exceptions.ModuleLoadException: Error: GolamacStreetValidator is currently unavailable. ---> System.Web.HttpParseException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. ---> System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean throwOnError) at System.Web.UI.NamespaceTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) at System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) at System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) at System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) at System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs) at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) The action that failed was: InheritanceDemand The type of the first permission that failed was: System.Web.AspNetHostingPermission The first permission that failed was: The demand was for: The granted set of the failing assembly was: The assembly or AppDomain that failed was: AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e The Zone of the assembly that failed was: Internet The Url of the assembly that failed was: file:///D:/wwwroot/DotNetNukeSkins495/bin/AjaxControlToolkit.DLL --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath) at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace --- at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(String FriendlyMessage, PortalModuleBase ctrlModule, Exception exc, Boolean DisplayErrorMessage) at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(PortalModuleBase ctrlModule, Exception exc, Boolean DisplayErrorMessage) at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(PortalModuleBase ctrlModule, Exception exc) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---

Solution:

Change the app pool from DefaultAppPool (managed pipeline mode = integrated) to Classic .NET AppPool.