Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit request from JSP

Status
Not open for further replies.

botatun

Programmer
Mar 7, 2006
40
US
I have example of code on C# how to submit data in XML format:
Code:
Imports must use POST, see sample code examples below.

QueryString:

[URL unfurl="true"]https://www.sunandski.com/net/WebService.aspx?Login=rsmith@retailconcepts.cc[/URL]
&EncryptedPassword=4B89AE74CE7907DCB38CBBFF7712AE3BD3488D0D8BBDBE6340AD247EF64BD0B6
&Import=Update  

api_request = "";
api_request = api_request + "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
api_request = api_request + "<xmldata>";
api_request = api_request + "<Products>";
api_request = api_request + "       <ProductCode>0003050526081-0019003</ProductCode>";
api_request = api_request + "       <StockStatus>5</StockStatus>";
api_request = api_request + "       <ListPrice>30</ListPrice>";
api_request = api_request + "       <ProductPrice>24.99</ProductPrice>";
api_request = api_request + "       <SalePrice>20.97</SalePrice>";
api_request = api_request + "       <HideProduct>Y</HideProduct>";
api_request = api_request + "       <TaxableProduct>Y</TaxableProduct>";
api_request = api_request + "       <UPC_Code>871556000000</UPC_Code>";
api_request = api_request 
+ "<Vendor_Price>5.5017</Vendor_Price>";
api_request = api_request 
+ "<Yahoo_Category>PERFORMANCE MENS THERMOTC</Yahoo_Category>";
api_request = api_request 
+ "<ShoppingDotCom_Category>SKI ACCESSORIES</ShoppingDotCom_Category>";
api_request = api_request 
+ "<Yahoo_Medium>Men's</Yahoo_Medium>";
api_request = api_request 
+ "<FreeShippingItem>N</FreeShippingItem>";
api_request = api_request + "</Products>";
api_request = api_request + "</xmldata>";

xml_http = new XMLHTTP();
xml_http.open("POST", api_url, false, "", "");
xml_http.setRequestHeader("Content-Type", "application/x-[URL unfurl="true"]www-form-urlencoded;[/URL] charset=utf-8");
xml_http.setRequestHeader("Content-Action", "Volusion_API");
xml_http.send(api_request);
api_response = xml_http.responseText;

how to do that in JSP?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top