3

I am trying to interface with the ebay API in C#. The sample code in C# that they give to get the time works fine. This seems to be using a "web reference" in VS (I'm using 2008 Express).

When I have a go by adding a "service reference" to my project I have to use the eBayAPIInterfaceClient in the following way (I can't find a reference to any ebayAPIInterfaceService like their example uses):

eBayAPIInterfaceClient client = new eBayAPIInterfaceClient();

CustomSecurityHeaderType credentials = new CustomSecurityHeaderType();

credentials.Credentials = new UserIdPasswordType();

credentials.Credentials.AppId = AppSettings.EbayAppID;
credentials.Credentials.DevId = AppSettings.EbayDevID;
credentials.Credentials.AuthCert = AppSettings.EbayCertID;
credentials.eBayAuthToken = AppSettings.EbayToken;

GeteBayOfficialTimeRequestType ebayTimeReq = new GeteBayOfficialTimeRequestType();

ebayTimeReq.Version = "551";

GeteBayOfficialTimeResponseType response = client.GeteBayOfficialTime( ref credentials, ebayTimeReq );

Anyway, it doesn't work (obviously I am using the same settings such as AppID, token etc.). It gives me back:

com.ebay.app.pres.service.hosting.WebServiceDisabledException: The web service eBayAPI is not properly configured or not found and is disabled.

Any ideas? I mean I'm assuming I'm not doing anything really dumb here :)

Cray
  • 2,774
  • 7
  • 22
  • 32
indigo
  • 84
  • 6
  • There is no Url property for eBayAPIInterfaceClient also there is no credentials property for the asynchronous call. –  Oct 12 '12 at 14:37

1 Answers1

1

Looks like you forgot to set the url. You need to indicate the appropriate url for the webservice, to indicate whether you're trying to use the live environment or the sandbox.

See https://ebay.custhelp.com/app/answers/detail/a_id/861/~/error---webservicedisabledexception

Try this instead (for live):

eBayAPIInterfaceClient client = new eBayAPIInterfaceClient();
client.Url = "https://api.ebay.com/wsapi";

// etc...
devlord
  • 4,054
  • 4
  • 37
  • 55
  • I think https://ebay.custhelp.com/app/answers/detail/a_id/2045/~/c%23.net-code-sample-to-call-ebay-trading-api-using-.net-framework-4 is a bit better of a description. I'd agree that the URL is necessary - and that I'm just now coming to that conclusion myself. – David T. Macknet Jul 25 '12 at 22:41