Dynamics NAV XMLport Generator v1.3

2

Comments

  • Benno67Benno67 Member Posts: 39
    Hi there,
    I should have found the generator before!, it will save indeed time-consuming debugging.

    Question : I did try it onto this webservice: http://www.florecom.nl/LinkClick.aspx?f ... uage=nl-NL or more specific the XSD : http://schemas.florecom.org/xml/data/dr ... es_0p5.xsd
    The tool is able to read the xsd, and understand the definitions in it, but when I try to generate the “imagerequest” root element, it looks like the generator is still processing all the elements in the XSD (that looks like very huge), and it crashes.
    I contacted Florecom and they suggested to “flatten” the WSDL with VS 2011 tools.
    My idea would be : The generator should be able to isolate the requested root element? No need to do it by hand?
    Any sugestions?

    Benno
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,458
    Dynamics NAV XMLport Generator v1.3
    Automatically create a XMLport from a XML schema.

    Simply load the schema, give an object number, select the root node, and click "Generate". Finished! The rest is small business.

    Features:
    - Automatic object generation
    - Works with complex schemas
    - Load included schemas
    - Root node selection

    V1.3.0.2:
    - Fixed a crash with long node names
    - Fixed an exception in the schema parser
    - Fixed "Unable to cast object" error

    http://www.mibuso.com/dlinfo.asp?FileID=910

    Discuss this download here.
  • SilverXSilverX Member Posts: 132
    Hi Benno,

    I have successfully tested with the new version. Please give it a try.

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • David_SingletonDavid_Singleton Member Posts: 5,456
    Great tool, it sames a ton of work.

    I also had some issues with complex Schemas in the earlier version, where it missed some elements. Its great to see you updating this.

    :thumbsup:
    David Singleton
  • Benno67Benno67 Member Posts: 39
    Hi Carsten,
    Good job on version 1.3. I had some problems with recursive definitions in a provider xsd, but with the new version they are solved :D .
    Thanks
    Benno
  • SilverXSilverX Member Posts: 132
    Thx. Good to hear that your problems are gone (for now) :) Please let me know if you find any other issues.

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • David_SingletonDavid_Singleton Member Posts: 5,456
    Benno67 wrote:
    Hi Carsten,
    Good job on version 1.3. I had some problems with recursive definitions in a provider xsd, but with the new version they are solved :D .
    Thanks
    Benno


    I think this was the same problem I had. I ended out just manually fixing those elements. But great to know for next time that it can handle this.

    Great work.
    David Singleton
  • Alex_ChowAlex_Chow Member Posts: 5,063
    When I select the Schema, the Root Element does not come up with anything?

    When I click Generate, it give me the error:
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.NullReferenceException: Object reference not set to an instance of an object.
       at NavXmlPortGen.MainForm.generateBt_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    ----------------------------------------
    NavXmlPortGen
        Assembly Version: 1.3.0.2
        Win32 Version: 1.3.0.2
        CodeBase: file:///C:/temp/XMLportgenerator/NavXmlPortGen.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5458 (Win7SP1GDR.050727-5400)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    
  • SilverXSilverX Member Posts: 132
    Alex,

    Please send the Schema by email for Review (about Box).

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    SilverX wrote:
    Alex,

    Please send the Schema by email for Review (about Box).

    Cheers
    Carsten


    Sent! Thanks for looking into this.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,597
    This is a godsend whenever you have to work with an EDIFACT-to-XML interface i.e. typical EDI providers. The D96A schemas used by the big retailers are HUGE and this tool handles them flawlessly. Great job!
  • SilverXSilverX Member Posts: 132
    Hi Miklos,

    thx for this great feedback. Do You attend Directions in September? Maybe we can meet :)

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,597
    No, I am working at the end user side so no budget for that. Where is Directions this year anyway?
  • SilverXSilverX Member Posts: 132
    Where is Directions this year anyway?
    In Vienna :)

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • NokioNokio Member Posts: 52
    Hi,
    in Dynamics AX there is an native XML EDI Interface to import Orders.
    I could generate a report with the XSD Schema.

    When I try to import the created XMLport I get the error message ("Invalid Tag Name") which interrupts the import.

    Do you have an idea?

    Regards
    Nokio



    I found the problem, there were some French Label Captions..
  • CarloMCarloM Member Posts: 5
    Hello,

    I tried your generator for the first time today.
    The XML port generated is not correct.
    I received following XSD file from our partner. I can not generate it from an existing XML.

    Problem is solved now. I selected the wrong root element.
    CMY
  • urpokurpok EspooMember Posts: 21
    I have successfully used this tool earlier, but now i jumped into a definition file that refuses to compile.
    I get message "The node or attribute name 'SubRowRequestOfQuotetionIdentifierUrlText' is invalid for a XMLport (length)"

    xsd can be downloaded from :
    http://www.fkl.fi/verkkolasku/yrityksen ... nvoice.xsd

    Is there something I can do for this, or do I have to create a parser of my own?

    regards, urpok
    "There is no spoon."
    --Matrix

    https://dynamicsuser.net/nav/b/urpo
  • SilverXSilverX Member Posts: 132
    Hi urpok,

    in the config file, there are 2 Settings regarding variable length and node Name length.
    <add key="MaxVariableNameLength" value="30"/>
    	<add key="MaxNodeNameLength" value="40"/>
    
    The Settings represent the maximum length of the node names and variables. With Version 2009 (R2), the limit is 30 afaik but has raised to 80 for Dynamics NAV 2013. It seems that you can use larger names, but the internal check only respects 30 chars.

    If you are a lucky guy and use Dynamics NAV 2013, you can raise the both values in config to 80 and it will work. If you use 2009 R2, you can also raise the numbers, but may have to change them afterwards when importing. It could be, that the node names are simply to long for Dynamics NAV XMLports.

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • urpokurpok EspooMember Posts: 21
    Modifying the config file removed the error message, import to NAV 2013 worked nicely, and even compile went thru.

    Next I have to test if it REALLY works :)

    Thank you very many, SilverX !!!
    "There is no spoon."
    --Matrix

    https://dynamicsuser.net/nav/b/urpo
  • DolshaDolsha Member Posts: 41
    @SilverX Hello.
    When i try import XMLport in Dev Environment i'll have error: "Invalid tag name."
    Then "The import stopped at line 492."
    492 line have only: " }" - close of CODE.
    Can u help me?
  • SilverXSilverX Member Posts: 132
    Hey @Dolsha

    Please send me your XSD and the generated XMLport as PM. I'll have a look.

    Cheers
    Carsten
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • DolshaDolsha Member Posts: 41
    @SilverX don't know how i can PM on mibsuo O_o

    P.S. that link for my .rar archive with xmlport and xsd: https://yadi.sk/d/RXRPOyJh3KMH4v
  • SilverXSilverX Member Posts: 132
    Wow, I have never ever seen XML files with cyrillic node names. I assume this is the issue as the Generator creates an UTF-8 object which cannot be imported into NAV.
    I don't have a proper Codepage configured. Can you please try to convert the resulting text file to your OEM Codepage and try re-Import? I have no additional idea except to use Codepage 850 tags :)
    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • DolshaDolsha Member Posts: 41
    How i can convert UTF-8 to OEM 866?
  • DolshaDolsha Member Posts: 41
    I'll use this command in powershell:
    Get-Content -Encoding utf8 'C:\Temp\50013_2.txt' | Out-File -Encoding oem 'C:\Temp\50013_oem.txt'
    

    Successful import object in my NAV, ty
  • John_ReinholdJohn_Reinhold Member Posts: 17
    Hi Carsten!

    I'm trying to use your amazing tool to create a XMLport based on several xsd-files. All files are located on my local drive. The main file is located in \schema and the additional files are located in \common. It can now import all the files, but when I hit Generate it just runs and runs. Right now it has been running for more than 30 minutes. Looks like it never completes.

    The files are from the official repository for OIOUBL-schemas: http://rep.oio.dk/ubl/xml/schemas/2.0/ and I'm trying to create XMLport for UBL-OrderResponse-2.0.xsd.

    Is there any way for me to spot why it doesn't complete?

    Otherwise - thanks a bunch for all your effort!

    /John
    Regards,
    John Reinhold
  • SilverXSilverX Member Posts: 132
    Hi John,

    I've spend some time adding status information (level, number of processed nodes, node name) to my internal version. Also added processed nodes to the output area.

    However, I was not able to process the schema, while the internally generated output after 10 minutes seemed to not have any loops in there.

    After that I decided to do the same with the BizTalk Visual Studio addin, importing the schema files and generating an instance (xml) from the xsd.

    After a while (around 8 minutes), I had a look at the generated xml file and it already was 2.5 GB in size. My assumption is, the schema is far to complex, thousands of nested nodes.

    I would suggest to try an easier solution (external, .NET XmlDocument, ...). I promise, even if the generator finishes at some point, probably after hours, you will not be able to edit the xmlPort in NAV.

    BizTalk xml instance is 3.8 GB meanwhile. Canceled the generation.
    Sorry, I would like to have helped you better here, but no chance...

    Cheers
    Carsten


    ==> How To Ask Questions The Smart Way
    This post is my own opinion and does not necessarily reflect the opinion or view of my employer.
  • John_ReinholdJohn_Reinhold Member Posts: 17
    Hi Carsten

    Whau, that was a very interesting and deep answer - thanks for that!
    And thanks for your effort trying to 'fix' the problem. I had it running for a hole day, but it didn't complete. So, I guess you're right about the complexness of the schema.
    I'll continue to do the XMLport the hard way.

    /John
    Regards,
    John Reinhold
  • ishwarsharma016ishwarsharma016 Member Posts: 49
    This tool is not working for me. My XML file is valid, I am getting the attached error when I click Generate. It would be great if anyone could help. My XML File schema is below,

    <?xml version="1.0" encoding="UTF-8"?>
    <Envelope SchemaVersion="04.00.01">
    <Header>
    <Vendor>
    <Enterprise>
    <Code>CD</Code>
    </Enterprise>
    <Code>CD</Code>
    </Vendor>
    <Language>en-US</Language>
    <Currency>USD</Currency>
    </Header>
    <PurchaseOrder>
    <Project>
    <Title></Title>
    <Code></Code>
    <SpecifierFile>
    <Name>z:\DESIGN\CATALOGS\CET\Test-062819.xml</Name>
    <SpecifierSoftware>Configura CET version 10.00.12</SpecifierSoftware>
    </SpecifierFile>
    </Project>
    <OrderLineItem>
    <VendorRef EnterpriseRef="CD">CD</VendorRef>
    <Quantity>1</Quantity>
    <LineItemNumber>1</LineItemNumber>
    <Price>
    <PublishedPrice>259.00</PublishedPrice>
    <PublishedPriceExt>259.00</PublishedPriceExt>
    <EndCustomerPrice>259.00</EndCustomerPrice>
    <EndCustomerPriceExt>259.00</EndCustomerPriceExt>
    <OrderDealerPrice>0.00</OrderDealerPrice>
    <OrderDealerPriceExt>0.00</OrderDealerPriceExt>
    </Price>
    <SpecItem>
    <Number>KIT-PPOLE</Number>
    <Description>144" Power Pole, 2-Piece [Includes Bracket & Trim Plate]</Description>
    <Catalog>
    <Code>Clear Design</Code>
    </Catalog>
    <Option Sequence="0" Level="1">
    <Code>FIN12</Code>
    <Description>Finish Selection</Description>
    </Option>
    <Option Sequence="1" Level="1">
    <Code>FIN12_SLV</Code>
    <Description>Silver</Description>
    </Option>
    </SpecItem>
    </OrderLineItem>
    </PurchaseOrder>
    </Envelope>
    Thanks,
    Ishwar Sharma

    My Blogs: Dynamics Community Blog | Blogspot
    Connect: Google + | Twitter
  • vaprogvaprog Member Posts: 956
    You need to feed the tool an XMLSchema document, not a sample XML document.
Sign In or Register to comment.