XML Port error in R2
pranav-joshi
Member Posts: 46
Hi guys,
I am importing following XML file, using XML port and I am having error that "Attribute <invoice> is unexpected.
<?xml version="1.0"?>
<invoice imosmsg:action="update" xmlns:imosmsg="http://schemas.veson.com/2005/ImosMsg" xmlns="http://schemas.veson.com/2005/ImosAct"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<status>1</status>
<transNo>12AQUI0000002N</transNo>
<transType>1</transType>
</invoice>
Here is my XML Port:
OBJECT XMLport 50004 Test IMPORT
{
OBJECT-PROPERTIES
{
Date=06/11/12;
Time=11:00:49 PM;
Modified=Yes;
Version List=Test IMPORT;
}
PROPERTIES
{
DefaultNamespace=http://www.w3.org/2001/XMLSchema-instance;
UseDefaultNamespace=Yes;
}
ELEMENTS
{
{ [{42E6DED6-709B-4EA5-9D2B-ECD94334ADBF}]; ;invoice ;Element ;Table ;
VariableName=<IMOS_TranHeader>;
SourceTable=Table50022 }
{ [{A68D27D3-CDA3-471A-AAF4-4BE9C823D4A8}];1 ;status ;Element ;Field ;
DataType=Code;
SourceField=<IMOS_TranHeader>::status }
{ [{AD0729A7-9B68-4D13-87D0-5B2322E13A97}];1 ;transNo ;Element ;Field ;
DataType=Code;
SourceField=<IMOS_TranHeader>::transNo }
It looks like I am having error because file is containing Namespace.
I deleted namespace from file and just kept <invoice> tag and it worked.
Anyone know solution?
I am importing following XML file, using XML port and I am having error that "Attribute <invoice> is unexpected.
<?xml version="1.0"?>
<invoice imosmsg:action="update" xmlns:imosmsg="http://schemas.veson.com/2005/ImosMsg" xmlns="http://schemas.veson.com/2005/ImosAct"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<status>1</status>
<transNo>12AQUI0000002N</transNo>
<transType>1</transType>
</invoice>
Here is my XML Port:
OBJECT XMLport 50004 Test IMPORT
{
OBJECT-PROPERTIES
{
Date=06/11/12;
Time=11:00:49 PM;
Modified=Yes;
Version List=Test IMPORT;
}
PROPERTIES
{
DefaultNamespace=http://www.w3.org/2001/XMLSchema-instance;
UseDefaultNamespace=Yes;
}
ELEMENTS
{
{ [{42E6DED6-709B-4EA5-9D2B-ECD94334ADBF}]; ;invoice ;Element ;Table ;
VariableName=<IMOS_TranHeader>;
SourceTable=Table50022 }
{ [{A68D27D3-CDA3-471A-AAF4-4BE9C823D4A8}];1 ;status ;Element ;Field ;
DataType=Code;
SourceField=<IMOS_TranHeader>::status }
{ [{AD0729A7-9B68-4D13-87D0-5B2322E13A97}];1 ;transNo ;Element ;Field ;
DataType=Code;
SourceField=<IMOS_TranHeader>::transNo }
It looks like I am having error because file is containing Namespace.
I deleted namespace from file and just kept <invoice> tag and it worked.
Anyone know solution?
Pranav Joshi
MS Dynamics NAV Consultant
SBS Group Desert Mountain (Formerly Silverware Inc.)
0
Comments
-
You can use this http://www.mibuso.com/forum/viewtopic.php?f=23&t=14637&hilit=xml+namespace to remove automatically namespaces before the import. It is my "best practice" to remove the namespaces first...0
-
I had a similar problem with xml in a different environment as well, best practice would be to replace or remove the namespace.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions