Character replacement in Web Services

bbrownbbrown Member Posts: 3,268
edited 2009-01-19 in NAV Three Tier
I know about using an underscore (_) to replace a space. But what do you do about commas (,) and periods (.)? As an example, the US demo company is "CRONUS USA, Inc.". All the documentation is based on the worldwide database that does not have this issue. I know I could just rename the demo company but I'd like to find the solution in case I see this issue in a client system.
There are no bugs - only undocumented features.

Comments

  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    First - answering the question first - a comma becomes _x002c_ - meaning that the US company will be

    CRONUS_USA_x002c__Inc

    Haven't tested it right now - but I am 99% sure.
    You can always connect a infopoint to the System Service and get the list of companies from that.

    Second - I think I will write a blog post about name mangling in Web Services, URL handling and in properties in WS - stay tuned.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • bbrownbbrown Member Posts: 3,268
    Thanks for the reply. That did not work for the comma. (I assume those are zeros)

    I sent "CRONUS USA, Inc" as "CRONUS_USA_x002c_Inc". Is that what you meant? I've renamed the company for now so I can keep moving, but I know I run into this again. And in a live company I may not have the option of renaming.
    There are no bugs - only undocumented features.
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    You need two underscores after x002c - since the comma is _x002c_ and the following space is _

    CRONUS_USA_x002C__Inc

    should be correct (just double checked an answer made to another guy for whom it worked).
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • mbjmbj Member Posts: 63
    From C# you can use the SystemService to show all companies converted

    ws3.UseDefaultCredentials = true;
    ws3.Url = "http://10.55.140.122:7047/DynamicsNAV/WS/SystemService"; //Remember
    string[] companies = ws3.Companies();

    foreach (string company in companies)
    {
    lstCompanies.Items.Add(company.ToString()); //ListBox
    }
Sign In or Register to comment.