ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Using ProductCart
  New Posts New Posts RSS Feed - Using XML API and Java to retrive order details
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using XML API and Java to retrive order details

 Post Reply Post Reply Page  12>
Author
Message
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Topic: Using XML API and Java to retrive order details
    Posted: 02-May-2011 at 11:10am
Hello

I am trying to write a java code to import orders automatically every hour or so using ProductCart XML API's. I wrote the java code to post the XML query to our product cart store with required ParterID, Password, PartnerKey. I receive the following response to my GetOrderDetailsRequest.

<?xml version="1.0"?>
<ProductCartResponse><RequestStatus>100</RequestStatus><ErrorList><ErrorCode>110
</ErrorCode><ErrorDesc>You do not have permission to access XML Tools. Please co
ntact the Administrator for more information.</ErrorDesc></ErrorList><RequestKey
>1H930N4AZU081BQ</RequestKey></ProductCartResponse>

Any thoughts??

Thank you


PC7313
Back to Top
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2011 at 11:15am
Does anyone have any suggestions, I am still not able to find out the solution.

Thank you
PC7313
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2011 at 11:21am
Have you read the XML SDK PDF instructions?
 
Have you created a PARTNER via the admin?
Back to Top
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2011 at 11:27am
Yes I created the Partner. I used following java code to post request

String inputString ="<?xml version=\"1.0\"?><GetOrderDetailsRequest xmlns=\"http://www.productcart.com/schema/xmltools/v1\"><PartnerID>xxxxx</PartnerID><PartnerPassword>xxxxxx</PartnerPassword><PartnerKey>xxx-702F33V490S4763UJ921ER4011</PartnerKey><OrderID>2859</OrderID><ExportedFlag>0</ExportedFlag></GetOrderDetailsRequest>";

URL u = new URL("http://www.xxxxx.com/xxxx/xml/gateway.asp");
        URLConnection url = u.openConnection();
        url.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
        url.setDoOutput(true);
      url.setDoInput(true);
     
      DataOutputStream    printout=new DataOutputStream (url.getOutputStream ());
      printout.writeBytes (inputString);
      printout.flush ();
    printout.close ();
    DataInputStream     input= new DataInputStream (url.getInputStream ());
    String str;
    while (null != ((str = input.readLine())))
    {
    System.out.println (str);
    }
    input.close ();

When I run the above code I get the following response.

<?xml version="1.0"?>
<ProductCartResponse><RequestStatus>100</RequestStatus><ErrorList><ErrorCode>110
</ErrorCode><ErrorDesc>You do not have permission to access XML Tools. Please co
ntact the Administrator for more information.</ErrorDesc></ErrorList><RequestKey
>37159641XWRR58Y</RequestKey></ProductCartResponse>

Any Help?? Thank you.
PC7313
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2011 at 12:02pm
Sorry, no idea.  Might want to file a support request and talk to Early Impact directly, or engage a developer directly who will dig in and perform debugging.  There is a list of developers here:  http://www.earlyimpact.com/productcart/partners-dev.asp
Back to Top
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Posted: 10-May-2011 at 12:04pm
@Greg: Thanks for looking in to this.

I found the sample ASP code in the ProductCart XML Tools SDK. I modified it to work for me ans now this time I am getting response from server as following

<?xml version="1.0" ?>
- <ProductCartResponse>
  <RequestStatus>100</RequestStatus>
- <ErrorList>
  <ErrorCode>101</ErrorCode>
  <ErrorDesc>Invalid XML document</ErrorDesc>
  </ErrorList>
  <RequestKey>5X3SE86HC08W7Z1</RequestKey>
  </ProductCartResponse>

Below is the ASP code I used.


<%



Dim orderid, tmpBody
MethodName = "GetOrderDetailsRequest"
orderid = "2859"


PartnerID=xxxx
Password="xxxx"
PartnerKey="xxx-xxUFH3xx290Sxx60UJ9xxR40xx1"

ProductCartXMLServer="http://www.xxxxxx.com/xxxx/xml/gateway.asp"

tmpBody = "&ltOrderID&gt" & orderid & "&lt/OrderID&gt"

Set objXML = Server.CreateObject("MSXML2.serverXMLHTTP")
objXML.open "POST",ProductCartXMLServer, false

objXML.setRequestHeader "XML-Agent", "ProductCart XML Partner"
objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
requestText="&lt?xml version='1.0'? &gt&lt"&MethodName&" xmlns='http://www.productcart.com/schema/xmltools/v1' &gt&ltPartnerID&gt" & PartnerID & "&lt/PartnerID&gt&ltPartnerPassword&gt" & Password & "&lt/PartnerPassword&gt&ltPartnerKey&gt" & PartnerKey & "&lt/PartnerKey&gt" & tmpBody & "&lt/"&MethodName&"&gt"
objXML.send(requestText)
set x = objXML.responseXML
'response.write requestText
response.write x.XML
response.End()

Any help???

Thank you

%>
PC7313
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 10-May-2011 at 12:13pm
What XML parser is the store set to use?  If it's not 3, try 3.  If it is 3, try other choices.   If that does not work, I encourage you once again to submit a support request.
Back to Top
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Posted: 10-May-2011 at 12:21pm

My store is currently using the following XML Parser: MSXML2 v6.0 parser.

Does changing it to MSXML2 v3.0 parser effect anything on my store??

Thank you

PC7313
Back to Top
Greg Dinger View Drop Down
Certified ProductCart Developers
Certified ProductCart Developers
Avatar

Joined: 23-September-2006
Location: United States
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Greg Dinger Quote  Post ReplyReply Direct Link To This Post Posted: 10-May-2011 at 12:26pm
it should not, and it may well resolve your issue.
Back to Top
PC7313 View Drop Down
Newbie
Newbie


Joined: 02-May-2011
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote PC7313 Quote  Post ReplyReply Direct Link To This Post Posted: 10-May-2011 at 12:30pm
I just changed and ran the code, still get the same response. Do I have to wait for some time to get XML Parser changed??

Thank you
PC7313
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.078 seconds.