in

wWorkflow.net

Erik Westermann, Komplett Systems test

dispatches

Erik Westermann's blog about BizTalk, Commerce Server, Integration, Writing (technical and otherwise). All content is Copyright, 2008, Erik Westermann. Permission required to duplicate. Citations appreciated.

May 2008 - Posts

  • Criticize by Creating


    I am amazed and disappointed in Commerce Server 2007. I explained my disappointment in my last post, so I won't repeat the details.

    Instead of becoming more frustrated with CS 2007, my critiques became the source of a number of Visual Studio Code Snippets. Code Snippets are reusable, often customizable, blocks of code. You can access Code Snippets in Visual Studio simply by highlighting something, right-click it, and then select (for example) Refactor. There are other types of Code Snippets, and the tasks to Commerce Server lend themselves well to Snippets

    I created Code Snippets for:

    • Adding properties to classes that extend the Order system (adds support for the SetDirty method)
    • Class/Type Constructor and the GetObjectData method
    • Adding code to the serialization constructor and GetObjectData method
    • Working with OrderObjectMapping.xml
       

    Of course, all of this would not be complete with a script to execute OrderMapping.exe and then deploy the changes to SQL Server.

    All of this has made it easier for me to work with Commerce Server. I can now easily extend the Order data model since I don't have to think about keeping data types and names synchronized across source, XML, and Web.config files.

    I am using the Snippets on a project now and plan to publish them once I have a better workflow. There is still some copy/paste work, but it is easier and much faster than handling the details manually.

    One interesting thing I was reminded of is to use sgen.exe - it is an invaluable tool for troubleshooting serialization issues. I was having problems with getting the Orders Web Service working and after much troubleshooting, I finally found the cause of the problem using sgen.exe. I'll give you more details later; however, for now I offer advice about being careful with the names you use in your types that you use to extend Commerce Server: avoid using common (as in repetitive) property names - you'll avoid a lot of frustration and save a great deal of time.

    ** Don't Let someone learn on you Enterprise Proect. Expert BizTalk Server Consulting. Proof of Concepts. Architectural Assessments. ESB and SOA Strategy, Guidance, and implementation. Erik Westermann has 15 years industry experience and is a recognized expert in SOA, ESB, and a range of other areas. Contact Erik by clicking the Contact link or call +1-416-809-1453 (Canada / Eastern Time Zone).

  • Commerce Server Will Test Your Patience

    I have been working with Commerce Server 2007 for a couple of months now. Like many products, CS is great if you happen to be a user/developer that works with the base/included functionality and are happy with customizing the starter site's appearance.

    If you are part of the unfortunate 20% that needs to go furhter by customizing the database and objects like OrderForm, Shipping, and Basket, you're likely to be very frustrated for a while.

    While the documentation and SDK try to make the process of extending CS easier, the fact remains that the CS API is just a thin layer over the CS database. In fact, at a point, developers must resort to using a DataSet object to modify orders and other data.

    In extending an OrderForm, for examlpe, you'll have to modify one XML file and copy the same data thoughout it at least four times (and you get to slightly modify the data each time too). Then you'll have to create yet another copy and add it to new XML file. Head over to web.config and edit that. Now, modify some code to implement your extensions (often creating a new type derived from a CS type and adding custom properties to it).

    Think you are ready now? Not yet. You'll have to run a program called OrderMapping.exe and get the command line arguments just right for it to work. If you have any error messages, pay attention to them because there isn't any documentation that explains the more cryptic ones. Once you run OrderMapping successfuly, you'll end up with a SQL script you have to execute against your transaction database.

    Now you are finally ready to test your extensions! But....here is the fun part....you just went through the headache of getting your site working, and now you can do it all over again by trying to get your Orders web service running.

    It starts off by copying XML and config files over. Then you need to run azman. Also, check the site's secuirty settings - if you enable anonymous access you'll get some really strange problems. Getting an error about some missing data? Head over to SQL Management studio and add some stuff to CS's configuration database. Still not working? Check the blogs because there isn't any documentation about problems like this.

    And so it continues....

More Posts
Powered by Community Server (Non-Commercial Edition), by Telligent Systems