Results 1 to 2 of 2
- 05-25-2012, 10:20 PM #1
Member
- Join Date
- May 2012
- Posts
- 1
- Rep Power
- 0
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
- 05-26-2012, 04:28 AM #2
Re: Importing XML into Volusion eCommerce platform
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Which framework should i use for building ecommerce webiste in java
By mirror in forum New To JavaReplies: 8Last Post: 04-13-2012, 05:23 AM -
ecommerce CMS
By java1 in forum Advanced JavaReplies: 0Last Post: 11-18-2011, 10:34 AM -
Any ecommerce application sample using java
By mirror in forum Web FrameworksReplies: 0Last Post: 02-23-2011, 05:34 AM -
Ecommerce Internet Marketing
By Jacksparrow in forum Reviews / AdvertisingReplies: 0Last Post: 05-28-2010, 10:19 AM -
How to add wishlist in ecommerce website?
By 82rathi.angara in forum Advanced JavaReplies: 1Last Post: 08-26-2008, 10:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks