Microsoft KB Archive/307248

= Unable to Convert an Order Form to XML by Using the DictionaryXMLTransforms Object =

Article ID: 307248

Article Last Modified on 9/23/2005

-

APPLIES TO


 * Microsoft Commerce Server 2000 Service Pack 1

-



This article was previously published under Q307248



SYMPTOMS
When you attempt to use the DictionaryXMLTransforms object to convert an order form to XML in Commerce Server 2000 Service Pack 1 (SP1), you may receive an error message.



CAUSE
Commerce Server SP1 includes the fix that is documented in the following Microsoft Knowledge Base article:

291391 DictionaryXMLTransform Object Returns 'Object Required' Error

Commerce Server performs the following actions after you install SP1:
 * 1) Commerce Server no longer assumes that all dictionaries are dictionaries of dictionaries. If the dictionary is not a dictionary of dictionaries, Commerce Server checks for a dictionary of miscellaneous. If the dictionary is not a dictionary element, Commerce Server checks ISimpleList.
 * 2) Commerce Server determines whether the subelement is a dictionary. All of the elements in the list must be a dictionary for the dictionary to be a list of dictionaries. If any element is not a dictionary, the element is ignored.
 * 3) Commerce Server determines whether the first subelement is an ISimpleList. If the first subelement is an ISimpleList, the element is not converted to XML.
 * 4) Commerce Server checks for a list of scalars. If any of the elements is an object, the conversion fails and the element is not converted to XML.



RESOLUTION
To resolve this problem, obtain the latest service pack for Commerce Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

297216 INFO: How to Obtain the Latest Commerce Server 2000 Service Pack

The English version of this fix should have the following file attributes or later:

  Date         Time   Version     Size  File name -  13-Jun-2001  15:08  1.0.0.1   28,944  Hotfixsetup.exe 05-Sep-2001 13:16               421  Qfehotfix.ini 05-Jul-2001 13:51           142,336  Qfepatch.msp 05-Jul-2001 14:16             7,168  Qfeunpatch.msp The file installed should have the following attributes:   Date         Time   Version     Size     File name 05-Jul-2001 10:10  4.0.0.2055  217,178  Requisition.dll



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Commerce Server 2000 Service Pack 2 (SP2).



MORE INFORMATION
In versions of Commerce Server earlier than Commerce Server 2000 SP1, you can convert an order form to XML by using the DictionaryXMLTransforms object, but without line items. After you install the fix, however, you must invoke the IPersistXML interface in either Microsoft Visual Basic or Microsoft Visual C++. The following code sample demonstrates a possible use of IPersistXML: Dim objFileStream As New Scripting.FileSystemObject Dim objTextFile As TextStream Dim objX As OrderGroup Dim objY As IPersistXML Dim objZ As DictionaryXMLTransforms Dim objOrderForm As COrderForm Dim strTmp As String Set objZ = CreateObject(&quot;Commerce.DictionaryXMLTransforms&quot;) Set objX = CreateObject(&quot;Commerce.OrderGroup&quot;) 'Call objX.Initialize(&quot;Provider=SQLOLEDB.1;User ID=sa;Password=*****;Initial Catalog=HeinzStuff_commerce;Data Source=ATCHEN6;Network Library=dbmssocn;&quot;, _                        &quot;{A43A1FB6-8518-41B6-8D17-698DB601DFE8}&quot;) Call objX.Initialize(&quot;Provider=SQLOLEDB.1;User ID=sa;Password=*****;Initial Catalog=Retail_commerce;Data Source=ATCHEN1;Network Library=dbmssocn;&quot;, _                        &quot;{FF31C279-BE31-4C86-AD6F-3059917DE988}&quot;) Call objX.LoadBasket 'Call objX.LoadOrder(&quot;{75CCB468-97D2-4B4F-94BE-E1BCD0A8C5A9}&quot;) 'objX.SaveAsOrder

'***********************   ' Do the Visual Basic style query interface. '***********************   Set objY = objX 'objX.SaveAsBasket strTmp = objY.SaveXML(1033) Set objTextFile = objFileStream.OpenTextFile(&quot;C:\mytest4.xml&quot;, ForWriting, True, TristateFalse) Call objTextFile.Write(strTmp) objTextFile.Close

Dim objDOM As New MSXML.DOMDocument Dim objNode As IXMLDOMNode

Call objDOM.Load(&quot;C:\mytest4.xml&quot;) Call objY.LoadXML(1033, objDOM.xml) 'strTmp = Replace(strTmp, &quot;US&quot;, &quot;CANADA&quot;,, , vbTextCompare) 'Call objY.LoadXML(1033, strTmp) 'strTmp = objY.SaveXML(1033) 'strCountry = objX.GetOrderFormValue(&quot;ship_to_country&quot;) 'objX.SaveAsBasket objX.SaveAsOrder 'strTmp = objY.SaveXML(1033) Set objX = Nothing Set objY = Nothing Set objZ = Nothing

Keywords: kbbug kbfix kbcommserv2000presp2fix kbqfe kbcommserv2000sp2fix kbhotfixserver KB307248

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.