Friday, December 22, 2006

Commerce Server Catalog Manager Encoding (UTF-8/UTF-16) issue

While working on Automated Catalog process using BizTalk Server Adapters for Commerce Server Catalog Subsystem found some thing interesting with Xml file (Processed by Catalog Manager) I am using Aggregator Pattern in BizTalk to generate final XML file which grabbed and processed by the Catalog Web service.

First I wasn't successful, thought that issue with encoding in the XML file, so decided to deploy Pipeline to set the encoding UTF-16 instead of default UTF-8 in XML assembly but again the end results wasn't fruitful (thou the file grow twice because of encoding).

While comparing the xml file got an idea!!. How about open the file in the Explorer copy and past the content into notepad and save the file as xml (removed -, + then Change "&" to "&" etc) then pass it to Catalog Web service also failed

Then I realized to use hex editors or Unicode editors. Since UTF-8 is the byte-oriented encoding form of Unicode. Quickly googled out and found few wonderful freeware did the same as above this time it worked with out any glitch.

Then I open up both file in Binary Editor found the difference, before it was 3E 3C where as with the Unicode editor (since open up the file in explorer) saved file 3E 20 0D 0A 3C

20 --> Space; 0D --> CR; 0A --> NL
With this can I say that Catalog Manager Parser expecting a well formatted XML file. Or it’s not well written to handle above scenario!?? at this point I don't know yet it to be consider as bug!!

Thursday, December 14, 2006

Need Well Formatted XML File for uploading Catalog


MSCommerceCatalogCollection2 version 3.0 need to be well formatted and encode if it’s contains special characters like “Tracker™ “other wise upload won’t be successful and system won’t show any errors and display as if it was successfully uploaded. In other words we will see this kind of behavior/result in the Catalog Manager Status paint for all unformatted xml file.

BizTalk Adapter For MSCS2007 Catalog System

Be aware that If you won’t set the Parent Category tag for Base Category in the MSCommerceCatalogCollection2 xml file While uploading through Catalog Manger or through BizTalk Adapters for CS2007 using Catalog web Service
You will end up having sub categories as base, hence no base category exist for sub categories Simply because base wasn’t created prior to inserting sub categories
So Set some value in the Parent Category tag Like
< ParentCategory >Same As Base Category Display Value </ParentCategory >