Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: How you did it?

  1. #1
    vedran is offline Member
    Join Date
    Jun 2012
    Posts
    98

    Default How you did it?

    Hello

    we will be using WSI. Excel is abandoned, simply cant do it.

    I will be getting data from excel sheet nicely ordered in List<string> and then I need to build xml based on that data.
    How did you solved the following:
    1. What is the best to waycreate XML, having in mind there are lots of nesting
    2. How did you solve the image in base64 encoded image data here
    3. How did you simplify kit creation? Excel system kits listed below the product. I might do the same... dont know yet.

    My idea is to build product (keep in memory) and then send it to service for upload. Rather than making one huge xml file. My concern is image sizes. File can grow very, very huge.


    Any opinions, experience or ideas are very welcome.


    Thank you

  2. #2
    vedran is offline Member
    Join Date
    Jun 2012
    Posts
    98

    Default

    WSI communication is progressing very good. While constructing XML document, in the same time I am making my own excel format.

    As I progress, I will post what I did, how I did and Why I did. Hopefully it might be of help to people.

    Also, I might be stuck with something... hopefully not

  3. #3
    joshwold is offline Junior Member
    Join Date
    Oct 2011
    Location
    Fergus Falls, MN
    Posts
    6

    Default Care to share?

    Could you please share your experiences with this? I'm curious to know how you are managing products with WSI.

  4. #4
    bwarrior is offline Junior Member
    Join Date
    Mar 2013
    Posts
    15

    Default

    I don't know if this is the "best" way to create the xml but this is how I'm doing it:

    XElement ele = new XElement("AvailableComponents");
    var list = ComponentList(context); <!-- this just returns an Enumerable List (IEnumerable<your_object> i.e. List<ProductComponents>)

    if (list.Any())
    {
    foreach (MyComponent ac in list)
    {

    ele.Add(new XElement("Component",
    new XElement("ObjectName", "comp_" + ac.ProductVariant.VariantID),
    new XElement("ProductName", ac.ProductVariant.Product.Name),
    new XElement("CategoryID", ac.CategoryID),
    new XElement("VariantID", ac.VariantID),
    new XElement("SKU", ac.ProductVariant.Product.SKU),
    new XElement("Price", ac.ProductVariant.Price),
    new XElement("Description", new XCData(ac.ProductVariant.Product.Description).ToSt ring()),
    new XElement("Height", ac.Height),
    new XElement("Width", ac.Width),
    new XElement("Length", ac.Length),
    new XElement("FrontImage", ac.FrontImage),
    new XElement("TopImage", ac.TopImage)
    }
    }