Results 1 to 2 of 2
  1. #1
    lackmaster is offline Member
    Join Date
    May 2012
    Posts
    1
    Rep Power
    0

    Default Importing XML into Volusion eCommerce platform

    Hello, and thanks for listening. I am newish to Java, but have successfully created code to export (XML) to a local file and manipulate the xml file, but am having a heck of a time trying import the XML backup. I haven't been able to get any help from Volusion or their dev forum. The only guidelines I have are:

    Using a Url is the only way to call an import and a Url can only and have a maximum length of approximately 1024 characters. Imports must use POST.
    When Importing the Url needs to contain the following. http://www.yourdomain.com/WebService.aspx?Login=<YourLogin>&EncryptedPasswor d=<YourEncryptedPassword>&Import=<ImportMode>

    This is my code I've been working with, but I may be way off:

    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;

    public class SendXML {

    public static void main(String[] args)
    throws Exception {

    String sUrl = "https://MyWebsite/net/WebService.aspx?"
    + "Login=MyUsername&EncryptedPassword=MyEncryptedPas sword"
    + "&Import=Update";

    URL url;
    HttpURLConnection urlConn;

    url = new URL(sUrl);
    urlConn =(HttpURLConnection)url.openConnection();
    urlConn.setDoInput(true);
    urlConn.setDoOutput(true);
    urlConn.setUseCaches(false);
    urlConn.setRequestMethod("POST");

    try (FileInputStream is = new FileInputStream("c:\\folder\\newfile.xml");){
    OutputStreamWriter out = new OutputStreamWriter(urlConn.getOutputStream());

    int nextChar;
    while ( ( nextChar = is.read() ) != -1 )
    out.write((char) nextChar);

    out.flush();

    out.println();
    } catch (IOException e) {
    System.out.println(e.getMessage());
    }
    }
    }

    Thanks

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,452
    Rep Power
    20

    Default Re: Importing XML into Volusion eCommerce platform

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 8
    Last Post: 04-13-2012, 06:23 AM
  2. ecommerce CMS
    By java1 in forum Advanced Java
    Replies: 0
    Last Post: 11-18-2011, 11:34 AM
  3. Any ecommerce application sample using java
    By mirror in forum Web Frameworks
    Replies: 0
    Last Post: 02-23-2011, 06:34 AM
  4. Ecommerce Internet Marketing
    By Jacksparrow in forum Reviews / Advertising
    Replies: 0
    Last Post: 05-28-2010, 11:19 AM
  5. How to add wishlist in ecommerce website?
    By 82rathi.angara in forum Advanced Java
    Replies: 1
    Last Post: 08-26-2008, 11:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •