on 06-11-2008 10:37 AM
Hello all,
I'm trying to register an UDO from a XML file, and I keep getting the -1114 error.
I'm using the following code:
Note: when debugging, the error occurs in
oCompany.GetBusinessObjectFromXML(sXmlFileName, iCounter)
statement, which return Nothing. I checked the sXmlFileName and iCounter and they hold the correct values.
Case BoObjectTypes.oUserObjectsMD
Dim oUDO As SAPbobsCOM.UserObjectsMD = oCompany.GetBusinessObjectFromXML(sXmlFileName, iCounter)
Try
BarraDeProgresso.Value += 1
BarraDeProgresso.Text = "UDO: " & oUDO.Code & "(" & oUDO.Name & ")"
If oUDO.Add <> 0 Then
oApplication.MessageBox("AddUDO Error: " & oCompany.GetLastErrorCode.ToString & " >> " & _
oCompany.GetLastErrorDescription & vbCrLf & "Elemento: " & iCounter)
Exit Function
End If
Catch ex As Exception
oApplication.MessageBox("UDO Error: " & Err.Number & ", " & Err.Description)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDO)
oUDO = Nothing
GC.Collect()
End Try
And my XML file looks like these:
<?xml version="1.0" encoding="UTF-16"?>
<BOM>
<BO>
<AdmInfo>
<Object>206</Object>
</AdmInfo>
<OUDO>
<row>
<Code>ADAT_O01</Code>
<Name>Nota de Recepção</Name>
<TableName>ADAT_001</TableName>
<TYPE>3</TYPE>
<MngSeries>Y</MngSeries>
<CanDelete>N</CanDelete>
<CanClose>Y</CanClose>
<CanCancel>Y</CanCancel>
<CanFind>Y</CanFind>
<CanYrTrnsf>N</CanYrTrnsf>
<CanDefForm>N</CanDefForm>
<CanLog>Y</CanLog>
<OvrWrtDll>N</OvrWrtDll>
</row>
</OUDO>
<UDO1>
<row>
<TableName>ADAT_002</TableName>
</row>
</UDO1>
<UDO2>
<row>
<ColAlias>U_ADAT_001</ColAlias>
<ColumnDesc>Código do Fornecedor</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_002</ColAlias>
<ColumnDesc>Nome do Fornecedor</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_003</ColAlias>
<ColumnDesc>Pessoa de Contacto</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_004</ColAlias>
<ColumnDesc>Nº Ref. Fornecedor</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_005</ColAlias>
<ColumnDesc>ID do Parcelário</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_006</ColAlias>
<ColumnDesc>Nome do Parcelário</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_007</ColAlias>
<ColumnDesc>Folha</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_008</ColAlias>
<ColumnDesc>Código da Variedade</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_009</ColAlias>
<ColumnDesc>Nome da Variedade</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_011</ColAlias>
<ColumnDesc>Data de Recepção</ColumnDesc>
</row>
<row>
<ColAlias>U_ADAT_024</ColAlias>
<ColumnDesc>Observações do Documento</ColumnDesc>
</row>
</UDO2>
<UDO3>
</UDO3>
</BO>
</BOM>
The error message is:
<ErrorList><Error>System Id = 75047768, Line Number = 1, Column Number = 79, Description = The namespace of element 'schema' must be from the schema namespace.</Error>
<Error>System Id = 75047768, Line Number = 1, Column Number = 99, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75047768, Line Number = 1, Column Number = 112, Description = The namespace of element 'complexType' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 117, Description = The namespace of element 'all' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 164, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 177, Description = The namespace of element 'complexType' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 187, Description = The namespace of element 'sequence' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 239, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 252, Description = The namespace of element 'complexType' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 257, Description = The namespace of element 'all' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 321, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 407, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 420, Description = The namespace of element 'complexType' must be from the schema
....
....
....
<Error>System Id = 75048960, Line Number = 1, Column Number = 2590, Description = The namespace of element 'all' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 2654, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 2722, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 75048960, Line Number = 1, Column Number = 2789, Description = The namespace of element 'element' must be from the schema namespace.</Error>
<Error>System Id = 74433152, Line Number = 10, Column Number = 11, Description = Unknown element 'TYPE'</Error>
<Error>System Id = 74433152, Line Number = 20, Column Number = 10, Description = Element 'TYPE' is not valid for content model: 'All(Code,Name,TableName,LogTable,MngSeries,CanDelete,CanClose,CanCancel,ExtName,CanFind,CanYrTrnsf,CanDefForm,CanLog,OvrWrtDll,UIDFormat)'</Error></ErrorList>
Thanks in advanced,
Vítor Vieira
Hello all,
The problem was identified, by the support people, as a bug in the 2007A DI API.
Best regards,
Vítor Vieira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
An suggestion: this is an example how to save BO BusinessPartners as an xml file.
Find the differences between your file and this.
I think the solution is here <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">.
May be it can help you.
Bye
Private Sub GetBusObjAsXml()
Try
If SBO_Company.Connected Then
Dim strXML As String
strXML = SBO_Company.GetBusinessObjectXmlSchema(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
oXmlDoc.LoadXml(strXML)
Dim sDir As String = System.Environment.GetEnvironmentVariable("TEMP")
oXmlDoc.Save(sDir & "\BusinessPartners.xml";)
End If
Catch ex As Exception
' log exception
End Try
End Sub
BusinessPartners xml file example...
<?xml version="1.0" encoding="UTF-16"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<element name="BOM">
<complexType>
<sequence>
<element name="BO" maxOccurs="unbounded">
<complexType>
<all>
<element name="AdmInfo">
<complexType>
<all>
<element name="Object" type="long" />
<element name="Version" type="long" minOccurs="0" />
</all>
</complexType>
</element>
<element name="QueryParams" minOccurs="0">
<complexType>
<all>
<element name="CardCode" type="string" />
</all>
</complexType>
</element>
<element name="OCRD">
<complexType>
<sequence>
<element name="row" minOccurs="0" maxOccurs="unbounded">
<complexType>
<all>
<element name="CardCode" type="string" minOccurs="0" />
<element name="CardName" type="string" minOccurs="0" />
<element name="CardType" type="string" minOccurs="0" />
...
</schema>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sierdna,
That was kinda useful. The Schema returned was
<?xml version="1.0" encoding="UTF-16"?>
<schema elementFormDefault="qualified">
<element name="BOM">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="BO">
<complexType>
<sequence>
<element maxOccurs="1" minOccurs="0" name="AdmInfo">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="Object" type="long"></element>
</all>
</complexType>
</element>
<element maxOccurs="1" minOccurs="0" name="QueryParams">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="Code" type="string"></element>
</all>
</complexType>
</element>
<element maxOccurs="1" minOccurs="0" name="OUDO">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="row">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="Code" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="Name" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="TableName" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="LogTable" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="MngSeries" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanDelete" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanClose" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanCancel" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="ExtName" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanFind" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanYrTrnsf" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanDefForm" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="CanLog" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="OvrWrtDll" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="UIDFormat" type="string"></element>
</all>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element maxOccurs="1" minOccurs="0" name="UDO1">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="row">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="TableName" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="LogName" type="string"></element>
</all>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element maxOccurs="1" minOccurs="0" name="UDO2">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="row">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="ColAlias" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="ColumnDesc" type="string"></element>
</all>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element maxOccurs="1" minOccurs="0" name="UDO3">
<complexType>
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="row">
<complexType>
<all>
<element maxOccurs="1" minOccurs="0" name="SonNum" type="long"></element>
<element maxOccurs="1" minOccurs="0" name="ColAlias" type="string"></element>
<element maxOccurs="1" minOccurs="0" name="ColDesc" type="string"></element>
</all>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</all>
</complexType>
</element>
</schema>
If we analyze theschema, the tag tags from the XML, but I get the same error.
I think this might be an error in the 2007A DIAPI. I'll post a message in SAP.
Thanks and Best Regards,
Vítor Vieira
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.