Hello,
I am trying to create a Xml-File with a custom Schema using a XMLPort
I am working according to an article which I found on Partnersource:
"How to use XMLports to connect to web services in MBS Navison 4.0", which is saying:
"1. Sending XML documents
In the XMLport, the TagType “Attribute” can be used to define XML namespaces.
For example, add the following tag in an XMLport:
TagName: xmlns
TagType: Attribute
SourceType: Text
DataSource: xmlns1
Add the following C/AL code line in the OnPreXMLport() trigger of the XMLport:
xmlns1 := '
http://schemas.xmlsoap.org/soap/envelope/';"
Unfortunately it is not working, the attribute tag is always empty. Has anyone solved this problem? Thank you!
Answers
Why do you need a different datasource name..use same datasource name..
Did you specify any gobal variable?
Can you show the xml structure?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
thanks for your fast reply, this is my xmlport
Node Name Node Type Source Type Data Source
ExportAuftraege Element Text <ExportAuftraege>
xmlns:xsi Attribute Text <xmlns>
xsi:noNamespaceSchemaLocation Attribute Text <xsi:noNamespaceSchemaLocation>
Double_Weighing Element Table <Rhewa_SingleWeighing>(Rhewa_SingleWeighing)
DocumentNo Element Field Rhewa_SingleWeighing::Document No.
etc.
Yes I have specified a global Variable, which is added in the Datasource.
I don't understand your question about the datasource Tag, I have a varialbe referenced at this place, the name of it shouldnt be a matter at all...
I am using Nav 6.2, does this make any difference
Change the node name to xmlns1 and delete global variable and try
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
How can I get Xml-File looking like this:
<?xml version="1.0" encoding="UTF-8" ?>
<ExportAuftraege xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Schema\ExportAuftraege.xsd">
And how can I get a Tag like xmlns:xsi when I change it to xmlns as you suggested?
http://www.mibuso.com/forum/viewtopic.php?f=7&t=21867&start=0
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav