Dynamics NAV XMLport Generator v1.3

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2013-09-24 in Download section
Dynamics NAV XMLport Generator v1.0.0.1
Have you ever created a XMLport from scratch? You created the port line by line based on a schema file. Then tried to import a document and nothing happened because one or more of the dozends of tags have wrong minOccurs and/or maxOccurs values?
Then the debug session. Maybe you have written dummy lines into the triggers to see which part of the XMLport is wrong. After a long time you discovered your mistake and fixed it.

All that is over. Simply load the schema, give an object number and click "Generate". Finished!

Of course you have to change the SourceType and DataSource, but that's a small business.

Requires .NET Framework 2.0

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

Discuss this download here.
«13

Comments

  • M@rtinM@rtin Member Posts: 9
    Good Idea =D> ,

    I tested this solution and if I have simple schema, no problem. But I use including (imported) schema and then generator not work correct.

    Have a nice day
    M@rtin

    Example imported XSD:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot;
    targetNamespace="uri:iw.sha.synchro.location"
    xmlns="uri:iw.sha.synchro.location"
    xmlns:types="uri:iw.types"
    elementFormDefault="qualified"
    version="1.1">
    <xs:import namespace="uri:iw.types" schemaLocation="types.xsd"/>
    <xs:element name="synchronization">
    <xs:complexType>
    <xs:sequence>
    <xs:element maxOccurs="1" minOccurs="1" name="Code" type="types:naviCode10" />
    ......
    </xs:sequence>
    <xs:attributeGroup ref="types:headerSynchroAtt"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>


    Types schema


    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot;
    targetNamespace="uri:iw.types"
    xmlns="uri:iw.types"
    xmlns:types="uri:iw.types"
    elementFormDefault="qualified" version="3.1">

    <xs:attributeGroup name="headerSynchroAtt">
    <xs:attribute name="messageNo" type="number" use="required"/>
    <xs:attribute name="primaryKeyString" type="text" use="required"/>
    ....
    </xs:attributeGroup>

    <xs:simpleType name="naviCode10">
    <xs:restriction base="text10">
    <xs:pattern value="[^a-z]*"/>
    </xs:restriction>
    </xs:simpleType>

    .....

    </xs:schema>
  • SilverXSilverX Member Posts: 134
    Hi M@rtin,

    sorry for answering so late.

    I will check this when i'm back at home in a few days.
    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.
  • SilverXSilverX Member Posts: 134
    Hi M@rtin,

    i've checked your example a bit deeper and also checked it with Visual Studio wich gives some unreferenced types. After defining the missing references (number, text and text10) i see no problem. I've attached the two schemas and the output.

    What was the exact error you received?
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    	targetNamespace="uri:iw.sha.synchro.location"
    	xmlns="uri:iw.sha.synchro.location"
    	xmlns:types="uri:iw.types"
    	elementFormDefault="qualified"
    	version="1.1"> 
    	
    	<xs:import namespace="uri:iw.types" schemaLocation="types.xsd"/> 
    	<xs:element name="synchronization"> 
    		<xs:complexType> 
    			<xs:sequence> 
    				<xs:element maxOccurs="1" minOccurs="1" name="Code" type="types:naviCode10" /> 
    			</xs:sequence> 
    			<xs:attributeGroup ref="types:headerSynchroAtt"/> 
    		</xs:complexType> 
    	</xs:element> 
    </xs:schema> 
    
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    	targetNamespace="uri:iw.types"
    	xmlns="uri:iw.types"
    	xmlns:types="uri:iw.types"
    	elementFormDefault="qualified"
    	version="3.1"> 
    	
    	<xs:attributeGroup name="headerSynchroAtt"> 
    		<xs:attribute name="messageNo" type="number" use="required"/> 
    		<xs:attribute name="primaryKeyString" type="text" use="required"/> 
    	</xs:attributeGroup> 
    
    	<xs:simpleType name="naviCode10"> 
    		<xs:restriction base="text10"> 
    			<xs:pattern value="[^a-z]*"/> 
    		</xs:restriction> 
    	</xs:simpleType> 
    
    	<xs:simpleType name="number">
    		<xs:restriction base="xs:integer" />
    	</xs:simpleType>
    
    	<xs:simpleType name="text10">
    		<xs:restriction base="text">
    			<xs:maxLength value="10" />
    		</xs:restriction>
    	</xs:simpleType>
    	<xs:simpleType name="text">
    		<xs:restriction base="xs:string" />
    	</xs:simpleType>
    </xs:schema>
    
    OBJECT XMLport 50000 WithInclude
    {
      OBJECT-PROPERTIES
      {
        Date=11.11.07;
        Time=17:04:23;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      ELEMENTS
      {
        { [{E3BF0590-B65B-4A05-A995-6232A129318C}];0 ;synchronization     ;Element ;Text    ;
                                                      VariableName=synchronization;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{337A3665-6CCB-4980-B3C6-DBA2078DDC6E}];1 ;messageNo           ;Attribute;Text    ;
                                                      VariableName=synchronization_messageNo;
                                                      TextType=Text;
                                                      Occurrence=Required }
    
        { [{CC617CED-0C05-4D91-B8D3-2812A4D071D9}];1 ;primaryKeyString    ;Attribute;Text    ;
                                                      VariableName=sync_primaryKeyString;
                                                      TextType=Text;
                                                      Occurrence=Required }
    
        { [{592180E7-1892-42DC-A36A-C9A477022544}];1 ;Code                ;Element ;Text    ;
                                                      VariableName=Code;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
    
      }
      EVENTS
      {
      }
      CODE
      {
    
        BEGIN
        {
          --------------------------------------------------------------------------------
          -- XMLport automatically created with Dynamics NAV XMLport Generator 1.0.0.1
          -- Copyright © 2007 Carsten Scholling                                
          --------------------------------------------------------------------------------
        }
        END.
      }
    }
    
    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.
  • gjgarciasmgjgarciasm Member Posts: 47
    Hi M@rtin,

    I have used this tool and I have a problem with an specific XML file.

    The XML file is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <Sales>
      <Shops>
        <Shop>
          <id>59</id>
          <shopname>MADRID SUPERMARKET</shopname>
          <TPVS>
            <TPV>
              <codTPV>1</codTPV>
              <serialnumber>123456</serialnumber>
              <version>5</version>
              <cashierid>134</cashierid>
              <batchs>
                <batch>
                  <date>20070425</date>
                  <time>1600</time>
                  <tender>
                    <tendercode>12350</tendercode>
                    <tendername>VISA</tendername>
                    <tendertotalamount>1245</tendertotalamount>
                  </tender>
                  <salesnumber>125</salesnumber>
                  <returnnumber>5</returnnumber>
                  <totalamount>1245</totalamount>
                  <totaltax>135</totaltax>
                  <transactions>
                    <transaction>
                      <id>1</id>
                      <amount>12</amount>
                      <quantity>2</quantity>
                    </transaction>
                  </transactions>
                </batch>
              </batchs>
            </TPV>
          </TPVS>
        </Shop>
      </Shops>
    </Sales>
    

    The Xsd related to the XML file generated with Visual Studio 2005 is:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="Sales">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Shops">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Shop">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="id" type="xs:unsignedByte" />
                        <xs:element name="shopname" type="xs:string" />
                        <xs:element name="TPVS">
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="TPV">
                                <xs:complexType>
                                  <xs:sequence>
                                    <xs:element name="codTPV" type="xs:unsignedByte" />
                                    <xs:element name="serialnumber" type="xs:unsignedInt" />
                                    <xs:element name="version" type="xs:unsignedByte" />
                                    <xs:element name="cashierid" type="xs:unsignedByte" />
                                    <xs:element name="batchs">
                                      <xs:complexType>
                                        <xs:sequence>
                                          <xs:element name="batch">
                                            <xs:complexType>
                                              <xs:sequence>
                                                <xs:element name="date" type="xs:unsignedInt" />
                                                <xs:element name="time" type="xs:unsignedShort" />
                                                <xs:element name="tender">
                                                  <xs:complexType>
                                                    <xs:sequence>
                                                      <xs:element name="tendercode" type="xs:unsignedShort" />
                                                      <xs:element name="tendername" type="xs:string" />
                                                      <xs:element name="tendertotalamount" type="xs:unsignedShort" />
                                                    </xs:sequence>
                                                  </xs:complexType>
                                                </xs:element>
                                                <xs:element name="salesnumber" type="xs:unsignedByte" />
                                                <xs:element name="returnnumber" type="xs:unsignedByte" />
                                                <xs:element name="totalamount" type="xs:unsignedShort" />
                                                <xs:element name="totaltax" type="xs:unsignedByte" />
                                                <xs:element name="transactions">
                                                  <xs:complexType>
                                                    <xs:sequence>
                                                      <xs:element name="transaction">
                                                        <xs:complexType>
                                                          <xs:sequence>
                                                            <xs:element name="id" type="xs:unsignedByte" />
                                                            <xs:element name="amount" type="xs:unsignedByte" />
                                                            <xs:element name="quantity" type="xs:unsignedByte" />
                                                          </xs:sequence>
                                                        </xs:complexType>
                                                      </xs:element>
                                                    </xs:sequence>
                                                  </xs:complexType>
                                                </xs:element>
                                              </xs:sequence>
                                            </xs:complexType>
                                          </xs:element>
                                        </xs:sequence>
                                      </xs:complexType>
                                    </xs:element>
                                  </xs:sequence>
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    

    The XMLPort textfile generated with your program is:
    OBJECT XMLport 96000 MIBUSO EXAMPLE
    {
      OBJECT-PROPERTIES
      {
        Date=11/14/07;
        Time=[2:11:46 PM];
        Modified=Yes;
        Version List=ZZ;
      }
      PROPERTIES
      {
      }
      ELEMENTS
      {
        { [{C61C8EB1-CB3D-4D58-AFED-F060AC117D61}];0 ;Sales               ;Element ;Text    ;
                                                      VariableName=Sales;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{30BEDC76-218F-4402-A5AE-8999075D4BB8}];1 ;Shops               ;Element ;Text    ;
                                                      VariableName=Shops;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{44838535-D3A8-4101-B65B-2BC0F27CC4C2}];2 ;Shop                ;Element ;Text    ;
                                                      VariableName=Shop;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{63DCCDB4-892D-4126-9570-4153405C3E87}];3 ;id                  ;Element ;Text    ;
                                                      VariableName=id;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{5037F0DF-2D7F-4FE5-8DAB-24BDFDD5E4F9}];3 ;shopname            ;Element ;Text    ;
                                                      VariableName=shopname;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{E50CE2DD-6747-4F40-83FC-AEE9F70B4C31}];3 ;TPVS                ;Element ;Text    ;
                                                      VariableName=TPVS;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{B1F1DC2E-3230-45CC-AAAC-C1949AD01B6D}];4 ;TPV                 ;Element ;Text    ;
                                                      VariableName=TPV;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{36B32142-F014-4722-9DA1-C8B4000D179A}];5 ;codTPV              ;Element ;Text    ;
                                                      VariableName=codTPV;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{3A55147C-50A6-4825-8B5F-99E6A34AE01F}];5 ;serialnumber        ;Element ;Text    ;
                                                      VariableName=serialnumber;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{1420DDCB-1F01-478A-AAE0-DF8875131D29}];5 ;version             ;Element ;Text    ;
                                                      VariableName=version;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{1DA2A45C-3034-4DE5-A6F9-20B3AB454D86}];5 ;cashierid           ;Element ;Text    ;
                                                      VariableName=cashierid;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{118F1406-4FF0-429F-BDEB-5985B44C89BD}];5 ;batchs              ;Element ;Text    ;
                                                      VariableName=batchs;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{25357E8A-A611-4411-AEC3-7EB5D512FAB6}];6 ;batch               ;Element ;Text    ;
                                                      VariableName=batch;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{8A986F3D-8B89-4E92-B1E6-B25F96BC036E}];7 ;date                ;Element ;Text    ;
                                                      VariableName=date;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{F7199169-6969-4051-9627-82737C5B28D4}];7 ;time                ;Element ;Text    ;
                                                      VariableName=time;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{929BC377-C899-4F12-8D2C-4663376B2BAB}];7 ;tender              ;Element ;Text    ;
                                                      VariableName=tender;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{C56DAE32-9DFE-476B-9F94-85BC2B2FE689}];8 ;tendercode          ;Element ;Text    ;
                                                      VariableName=tendercode;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{EBC1F57C-70F5-48EB-ABA7-2BB22C895713}];8 ;tendername          ;Element ;Text    ;
                                                      VariableName=tendername;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{6DCD3DB7-4C61-48A6-B5EC-024CC2980EF1}];8 ;tendertotalamount   ;Element ;Text    ;
                                                      VariableName=tendertotalamount;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{F0D9B3BD-E859-43FD-BCB3-ECFD459C65F9}];7 ;salesnumber         ;Element ;Text    ;
                                                      VariableName=salesnumber;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{5228AAFD-61C7-4684-A5E6-2CE87C7B9923}];7 ;returnnumber        ;Element ;Text    ;
                                                      VariableName=returnnumber;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{E66C761E-3205-42BE-A511-87B750CD5467}];7 ;totalamount         ;Element ;Text    ;
                                                      VariableName=totalamount;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{76803679-3640-445F-AACD-BEFA17A2E2F8}];7 ;totaltax            ;Element ;Text    ;
                                                      VariableName=totaltax;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{4DEB35FD-E11C-4C8E-9264-A6E75E2E3243}];7 ;transactions        ;Element ;Text    ;
                                                      VariableName=transactions;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{D3D98F99-E7B6-47DF-A3DA-ED39FF9DEFE4}];8 ;transaction         ;Element ;Text    ;
                                                      VariableName=transaction;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{58E05F5B-755A-4AAE-AC8D-E6366700DE6C}];9 ;id                  ;Element ;Text    ;
                                                      VariableName=transaction_id;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{50495846-45D7-415E-A753-5ECF8AC9D5DD}];9 ;amount              ;Element ;Text    ;
                                                      VariableName=amount;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
        { [{ACDA9695-5534-42B9-8155-4AABA91C0544}];9 ;quantity            ;Element ;Text    ;
                                                      VariableName=quantity;
                                                      TextType=Text;
                                                      MinOccurs=Once;
                                                      MaxOccurs=Once }
    
    
      }
      EVENTS
      {
      }
      CODE
      {
    
        BEGIN
        {
          --------------------------------------------------------------------------------
          -- XMLport automatically created with Dynamics NAV XMLport Generator 1.0.0.1
          -- Copyright © 2007 Carsten Scholling                                
          --------------------------------------------------------------------------------
        }
        END.
      }
    }
    

    When I try to execute this XMLport the next error appears approximately (the original message is in spanish):

    <<The value Min Occurs specifies the apparition of element <TPVS> once. The <id> element was received.>>

    Please, am I doing anything wrong?
    Thank you and my best regards.
  • SilverXSilverX Member Posts: 134
    Hi gjgarciasm,

    i checked with your supplied schema and xml and had no problem to import the supplied XML.

    But the error sounds like the XML you are trying to import has another format as the one you supplied. There are some candidates in your XML which may occur multiple times in a "real world scenario". These are <Shop>, <TPV>, <batch> and <transaction>. Try changing the schema of these nodes to maxOccurs=unbounded or try to generate a schema from the "defective" XML. There are also some potential optional values in your XML which should be marked with minOccurs=0 in your schema.

    Regards,
    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.
  • ara3nara3n Member Posts: 9,256
    I was trying the tool and. I was getting no valid xmlroot error

    I opened the xml file in Visual studio. Generated the xsd, then added this to the tool and it generated the xmlport.

    One issue is that Datasources cannot be longer than 30 characters.
    I found the source and made it smaller.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • JAKAJAKA Member Posts: 18
    Hello!

    This seems to be the perfect tool for me but unfortunately I'm getting error message "Unable to cast object of type 'System.Xml.Schema.XmlSchemaChoice' to type 'System.Xml.Schema.XmlSchemaElement'".

    I'm new to XML, can you tell me what could be the problem?
  • SilverXSilverX Member Posts: 134
    JAKA wrote:
    Hello!

    This seems to be the perfect tool for me but unfortunately I'm getting error message "Unable to cast object of type 'System.Xml.Schema.XmlSchemaChoice' to type 'System.Xml.Schema.XmlSchemaElement'".

    I'm new to XML, can you tell me what could be the problem?

    Hi JAKA,

    the problem is the implementation which parses the supplied schema and fails in case of <choice>. I'm working on this issue and have hopefully fixed it in a test version. A temporary workaround is to eleminate <choice> and specify all choices as minOccurs=0. Expect an update in the next two weeks.

    Greets,
    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.
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    Dynamics NAV XMLport Generator v1.1.0.0
    Simple automatic creation of NAV XMLport objects from a XML Schema (.XSD).

    Have you ever created a XMLport from scratch? You created the port line by line based on a schema file. Then tried to import a document and nothing happened because one or more of the dozends of tags have wrong minOccurs and/or maxOccurs values?
    Then the debug session. Maybe you have written dummy lines into the triggers to see which part of the XMLport is wrong. After a long time you discovered your mistake and fixed it.

    All that is over. Simply load the schema, give an object number and click "Generate". Finished!

    Changes in 1.1.0.0:

    - Added support for choice types
    - Fixed a problem with sequences
    - Fixed small bugs and typos
    - Checked with NAV 2009

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

    Discuss this download here.
  • gulamdastagirgulamdastagir Member Posts: 411
    I am converting an EDI file into XML using C# Code and converting XML->XSD

    but the XSD->Dataport using your Generator is not creating the entire dataport only a few lines.I guess your tool works for only simple XSD files
    Regards,

    GD
  • SilverXSilverX Member Posts: 134
    Hi gulamdastagir,

    hmm, it should create a full featured XMLport. Can you send me the resulting XSD with all referenced files per PM? I will have a look at your issue and come back to you.

    Thanks and kind regards,
    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.
  • gulamdastagirgulamdastagir Member Posts: 411
    Your Email Address plz
    Regards,

    GD
  • SilverXSilverX Member Posts: 134
    You can find the address in the about dialog. But a forum PM is ok too.
    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.
  • ara3nara3n Member Posts: 9,256
    what is the MUID for this download I want to vote for it here.


    http://www.mibuso.com/awards2009vote.asp
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    MUID: ISUG
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SilverXSilverX Member Posts: 134
    :mrgreen:

    Thx
    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.
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    Dynamics NAV XMLport Generator v1.2
    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

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

    Discuss this download here.
  • MBrodie1979MBrodie1979 Member Posts: 21
    Hello Carsten.

    When I try use your XML Generator it won't let me select the root element. And when I try generate i get this error:

    Unhandled exception has occured in your application. If you click continue the application will ignore this error and attempt to continue. If you quit, the application will close immediaitely.

    Object Reference not set to an instance of an object.

    Any ideas?
    :-k
  • SilverXSilverX Member Posts: 134
    When I try use your XML Generator it won't let me select the root element. And when I try generate i get this error:
    Hi,

    can you send me the XML schema file via PM? This is not a general error...

    Greetings,
    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.
  • bluesky29bluesky29 Member Posts: 29
    Hi there,

    sorry but can anyone explain me how to use that tool - i've downloaded it and extracted it and see no .fob, no exe :shock:

    I need a short description how to get it working because i don't know how to start it :whistle: +

    Thx,
    Markus
  • jmasellijmaselli Member Posts: 8
    :roll: I have downloaded the XML generator and run your sample. But where do I put the .DLL so I can see all the Navision
    Table objects in the root element field not just comment and PO. Thanks in advance! This looks like a good tool for creating
    an initial XML port.
  • mousewaremouseware Member Posts: 8
    I have an XML file, and when I load it into the XML Port Generator I cannot type the name of the root node, nor can I select it from the list because the list is empty. If I just click Generate, than the tool hangs and all I can do is click the X in the upper right corner of the window. What am I doing wrong?

    Regards., Mouseware
  • ara3nara3n Member Posts: 9,256
    the xml file probably has two namespaces and would require two xsd associated that need to be in the same folder.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • sanuychsanuych Member Posts: 4
    Hi, Carsten

    You wrote in readme.txt

    AbbreviationLength: DataSource variable names have a maximum of 30
    characters. They will be shortened to the length of this value. If
    the resulting name is a duplicate, a number is appened.

    Can you use UPPERCASE (LOWCASE) compare when searching duplicate name?

    Thank`s
  • LankiLanki Member Posts: 17
    Hello,

    I'm also getting the error (working with v1.2)

    "Unable to cast object of type 'System.Xml.Schema.XmlSchemaChoice' to type 'System.Xml.Schema.XmlSchemaElement'".

    any idea how i can fix this?

    Thank you very much.
  • marvinqmarvinq Member Posts: 69
    Hi,

    I want to import some XML documents via a XMLPort according to a XML Schema. But I would like a way to auto generate my XMLPort, because it is a gigantic task to create it manually.

    The schema is here: http://docs.oasis-open.org/ubl/os-UBL-2 ... ce-2.0.xsd

    The schema is located in this folder: http://docs.oasis-open.org/ubl/os-UBL-2.0/xsd/

    I've tried this engine, but it seems to crash just before ending the generation process. There are other problems also, - I needed to shorten two fieldnames, but this does not cause the crash.

    Any solution to this? Are there any other engines available? Or any other way to set up the environment in NAV to accept XML files according to the XML Schema??
  • ara3nara3n Member Posts: 9,256
    a workaround that I use is that I ask for a sample xml file, and then I open that in Visual studio to create an xsd and use that xsd in xmlport generator.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • pedgaardpedgaard Member Posts: 24

    The schema is here: http://docs.oasis-open.org/ubl/os-UBL-2 ... ce-2.0.xsd

    The schema is located in this folder: http://docs.oasis-open.org/ubl/os-UBL-2.0/xsd/

    I've tried this engine, but it seems to crash just before ending the generation process. T?

    I have used this engine before to make a working OIOXML XMLPORT, that was very helpful.

    Today I tried to make the OIOUBL XMLPORT, but I get a run time error when I try to click Generate, I also get two error complaints about field length, which i fixed manually, but regardless, it will crash a little bit later on with no file generated.
  • SilverXSilverX Member Posts: 134
    Hi Povl, Marvin,

    I missed this thread, sorry...

    Povl pointed me back to this thread and I have compiled a new version for testing. The schema is very complex and it uses some kind of circular reference, I have never seen before. This was the problem and can possibly omitted by creating a XML file then then creating a schema from this XML as ar3na mentioned.

    The generated XMLport for this schema is very large. The text object has more than 216.000 lines and I did not test the result today.

    I will upload a new version if it works for Povl.

    Cheers
    Carsten

    P.S.: It may take some (more) seconds to create the XMLport for this schema, depending on your CPU power...
    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.
  • pedgaardpedgaard Member Posts: 24
    Hey Carsten,

    Thanks for the update, the generator works and creates the baddest XMLPORT I have ever seen for this OIOUBL XSD (v. 1.0) with 20+ mb. The similiar XSD for the OIOXML (v.0.7) was only 500kb.
    I tried to see if there was duplicate fields, but it seems all are unique indeed. The XMLPORT is so far not working,but I am trying some things.

    I will probably as suggested in thread try and create the XSD from some example files.
    As I understand, if the example file does not cover all possible tags, I could get in trouble later.

    Kind regards,
    Povl
Sign In or Register to comment.