blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Ketul Patel's Blog

  • Configuring Customer and Orders Manager in Commerce Server 2007

    Since yesterday I have been struggling to open the Customer and Orders Manager for the Commerce Server 2007 Starter kit. I kept getting "Orders Web Service Unavailable"  error:

    Orders web service unavailable

    It turns out that the SSL certificate used for the site was "Issued to: StarterSite" and I was accessing the site on https://localhost, So their was some sort of "Trust  Issue". Generating the SSL cert which is "Issued to:  localhost" solved the problem. Below are the command arguments that I used with SelfSSL.exe, notice the use /T argument this will install the self signed certificate into Trusted Root Certification Authorities, which is needed otherwise you will encounter the same error as above.

    SelfSSL

    If you are wondering what the hack is /S:881430382 ? It’s the SiteId for which you want to create a self signed SSL. As on most of the Dev machines there is always more than one site so using the Default SiteId of 1 is no good. (How to find the SiteID in IIS5 and IIS6 - Scott Forsyth's WebLog)

    By default Customer and Orders Manager requires https:// for Orders and Profiles web service, to turn on the option to use http open the CustomerAndOrdersManager.exe.config from C:\Program Files\Microsoft Commerce Server 2007\Business User Applications and set the AllowHttp option to True

    Allow Http

  • WPF/E in Firefox

    For the past few weeks I have been working on a project primarily using WPF/E and ASP.NET AJAX. Now as WPF/E is supposed to be cross-browser and cross platform, we were hoping our WPF/E site (which works fine in IE 7) would work in Firefox without needing any tricks or changes to the code, well that was not entirely true but the good news is there were only a few things that required changes and here are things that I would be careful of if I want my WPF/E site cross browser:

    1. x:Name Issue
    If you try to access Name property of XAML elements for which no x:Name has been specified firefox will throw an exception indicating no name property exists for the object instead of returning empty string as in IE7. So if you have code block which is something like:

    vay myCanvas = _wpfeControl.findName("myCanvas");
    //Iterating through children of myCanvas
    for(var i=0;i<myCanvas.children.count;i++)
    {
    var child = myCanvas.children.getItem(i); alert(child.Name); //Above line will throw an exception in firefox if no x:Name has been specified for the XAML Element }

    One obvious thing that I was tempted to use was hasOwnProperty method of Javascript object, which did not work either

    if(child.hasOwnProperty("Name"))
    alert(child.Name);

    The solution that we came up with was to create a helper function to read the name property and return empty string if an exception is caught

    function GetXamlElementName(xamlElm)
    {
    var name = "";
    try { name = xamlElm.Name; }catch(e)
    {}
    return name;
    }

    You can also create a more generic function which can be used to read any property and not just the name

    function GetXamlAttributeValue(xamlElm, propertyName)
    {
    var attrValue = "";
    try { attrValue = xamlElm[propertyName]; }catch(e)
    {}
    return attrValue;
    }

    I am no way arguing that this is the best approach but it worked well for our purpose.

    2. setValue(….) Issue

    Firefox is not going to like if in your javascript you are setting property values on XAML element using setValue, instead use the short hand syntax for example:

    vay myCanvas = _wpfeControl.findName("myCanvas"); 
    myCanvas.setValue(“Canvas.Top”)=50; //NO NO for firefox //instead use: myCanvas[“Canvas.Top”]=50; Surprisingly, this is not true for getValue(…..) , getValue(“Canvas.Top”) works in firefox.

    3. Programmatically assigning null values to XAML element properties.

    If your Javascript code is assigning null values to a XAML element property, then firefox will growl at you.

    For example if you are trying to assign a variable value to Text property of a TextBlock:

    var searchText = myCanvas.findName(“searchText”) 
    var textBoxValue = GetTextBoxValue();
    // GetTextBoxValue() is some function which returns a value that
    //needs to be populated into the textblock, the return
    //value of the function could be null.


    searchText.Text = textBoxValue //NO NO for firefox if textBoxValue is null Instead check for the null value before assigning it to property
    if(textBoxValue != null) 
    searchText.Text = textBoxValue

    4. Special character showing up before the £ sign

    Special character in WPF/E

    This only happens when using WPF/E’s createFromXaml() method

    For example if you have XAML within a .xaml file

    <TextBlock> £ </TextBlock> 

    it shows up correctly on Firefox but if you pass the same string to createFromXaml(..) method the TextBlock which is created shows a special character in front of £ sign. I tried all kinds of encoding/decoding, escaping etc but nothing seems to work which lead us to believe it could be a bug in WPF/E run time itself.

    _wpfeControl.createFromXaml(“<TextBlock> £ </TextBlock>”) 

    Other than £ sign most of the special characters seem to work fine. So far I haven't found a solution to it Sad

    To summarize in one sentence; most of the issues were around Javascript’s interaction with WPF/E's object model. I think that was pretty much it to make the site work in Firefox and yes it did work on MAC  

    If I forgot to mention this was in WPF/E February CTP release.

    Technorati Profile

Powered by Community Server (Personal Edition), by Telligent Systems