General discussion

Locked

ebay API problem! Get "Unsupported Verb"

By shirsch4 ·
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)
<?xml version="1.0" encoding="UTF-8"?>
<eBay><EBayTime>2005-08-21 05:48:44</EBayTime><Errors><Error><Code>2</Code><ErrorClass>RequestError</ErrorClass><SeverityCode>1</SeverityCode><Severity>SeriousError</Severity><Line>0</Line><Column>0</Column><ShortMessage><![CDATA[ Unsupported verb. ]]></ShortMessage></Error></Errors></eBay>
***********************

(EbayAPISimpleCall.java:142) is:

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

Any help would be GREATLY appeciated

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums