@Bill and all others:
I used your code, yet it doesn’t works fine. The method still inserts a new document instead of updating a document. There are no parse errors.
Here is the code:
Function UpdateXMLStringCheckStringNr
dim XML, getal, AFINPRODATA, TamX2, myResponse, InoUnprotected, InoLockWaitYes
'XML = “<?xml version=""1.0"" encoding=""iso-8859-1"" ?><AFINPRODATA xmlns:ino=”“http://namespaces.softwareag.com/tamino/response2"” ino:id=“”“&request.Cookies(“stringnr”)&”“” />“
XML = XML & request.Cookies(“XMLString”)
'Response.Write XML
'Response.End
'replace afinprodata with afinprodata including ino id
XML = Replace(XML, “”, “<?xml version=""1.0"" encoding=""iso-8859-1"" ?><AFINPRODATA xmlns:ino=”“http://namespaces.softwareag.com/tamino/response2"” ino:id=”“”&request.Cookies(“stringnr”)&“”" >")
'response.Write XML
'response.End
'create XML document and load it with data
Set AFINPRODATA = Server.CreateObject(“MSXML2.DOMDocument”)
AFINPRODATA.async = false
AFINPRODATA.loadXML(XML)
Response.Write AFINPRODATA.xml
'Response.End
'error handling
If AFINPRODATA.parseError.errorCode <> 0 Then
Response.Write( "XML Parse Error code: " & AFINPRODATA.parseError.errorCode & ", reason: " & AFINPRODATA.parseError.reason & " online: " & AFINPRODATA.parseError.line & “
”)
Else
Response.Write (“XML Parsed successfully
”)
End If
'Create connection with Tamino database voor het updaten
Set TamX2 = Server.CreateObject(“TaminoX.TaminoX1”)
TamX2.Initialize()
TamX2.CsDatabaseURL (“http://INFA04/tamino/MijnKluis”)
'TamX2.StartSession InoUnprotected, InoLockWaitYes
Tamx2.LPagesize(5)
TamX2.ContentType = “text/xml”
TamX2.Encoding = “ISO-8859-1”
set myResponse = TamX2.Process (AFINPRODATA, “/mijnkluis_info”)
Response.Write ("Tamino Response: " & myResponse.xml)
TamX2.Commit
End function
BTW: XML is a XMLstring that is retrieved from a document in Tamino. In another function the ino:id is removed because otherwise the web-engines(for making calculations) won’t work. When all data in this string has been updated the string is set into the cookie XMLstring. That string is the one that has to update the document in Tamino where its ino:id is the key.
I myself think that Tamino doesn’t reconize the ino:id correct since it inserts the data in a new document with a new ino:id.
grtz,
[This message was edited by Djenga on 15 Nov 2002 at 09:17.]
#webMethods#webMethods-Tamino-XML-Server-APIs#API-Management