Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q307248

↑ Back to the top


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.

↑ Back to the top


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.

↑ Back to the top


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
				

↑ Back to the top


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).

↑ Back to the top


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("Commerce.DictionaryXMLTransforms")
    Set objX = CreateObject("Commerce.OrderGroup")
    
    'Call objX.Initialize("Provider=SQLOLEDB.1;User ID=sa;Password=*****;Initial Catalog=HeinzStuff_commerce;Data Source=ATCHEN6;Network Library=dbmssocn;", _
                         "{A43A1FB6-8518-41B6-8D17-698DB601DFE8}")
    Call objX.Initialize("Provider=SQLOLEDB.1;User ID=sa;Password=*****;Initial Catalog=Retail_commerce;Data Source=ATCHEN1;Network Library=dbmssocn;", _
                         "{FF31C279-BE31-4C86-AD6F-3059917DE988}")
                         
    Call objX.LoadBasket
    'Call objX.LoadOrder("{75CCB468-97D2-4B4F-94BE-E1BCD0A8C5A9}")
    
    'objX.SaveAsOrder

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

    
    Dim objDOM As New MSXML.DOMDocument
    Dim objNode As IXMLDOMNode

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

↑ Back to the top


Keywords: KB307248, kbhotfixserver, kbcommserv2000sp2fix, kbqfe, kbcommserv2000presp2fix, kbfix, kbbug

↑ Back to the top

Article Info
Article ID : 307248
Revision : 2
Created on : 9/23/2005
Published on : 9/23/2005
Exists online : False
Views : 421