ebay API problem! Get "Unsupported Verb" - TechRepublic
General discussion
August 21, 2005 at 06:06 AM
shirsch4

ebay API problem! Get “Unsupported Verb”

by shirsch4 . Updated 20 years, 10 months ago

So I’m trying to connect AND GET A RESPONSE from the ebay sandbox server utilizing Java 1.5 & JDOM 1.0. Here’s the entry point (adapted from O’reilly’s Real World Web Services):
public static void main(String[] args) throws IOException
{
EbayAPISimpleCall myCall = new EbayAPISimpleCall();
myCall.setApiVerb(GetOfficialTime);
Document myDocument = myCall.executeCall();
new org.jdom.output.XMLOutputter().output(myDocument, System.out);
myCall.setApiVerb(GetSearchResults);
myCall.setArgument(“Query”, “![CDATA[‘abbey road’]]”);
myDocument = myCall.executeCall();
System.out.println(“myDocument = ” +myDocument.toString());
new org.jdom.output.XMLOutputter().output(myDocument, System.out);

String result = myDocument.getRootElement().getChild(“eBayOfficialTime”).getText();
System.out.println(“result is: ” + result);

result = myDocument.getRootElement().getChild(“Search”).getChild(“GrandTotal”).getText();
System.out.println(result);

}

Here’s what I keep getting:

**************************
Exception in thread “main” java.lang.NullPointerException
at com.hirsch.WebServices.EbayAPISimpleCall.main(EbayAPISimpleCall.java:142)

2005-08-21 05:48:442RequestError1SeriousError00
***********************

(EbayAPISimpleCall.java:142) is:

String result = myDocument.getRootElement().getChild(“eBayOfficialTime”).getText();

Any help would be GREATLY appeciated

This discussion is locked

All Comments