0

I'm working on a project that has an API and one of the function's signature is as follows:

public System.Threading.Tasks.Task<farmersmarket.service.Results> zipSearchAsync(string zip, string callback)
{
    return base.Channel.zipSearchAsync(zip, callback);
}

The string callback parameter is confusing to me. Is this a .net delegate? Is it the same as a javascript callback?

Update: I'm working with this api: http://search.ams.usda.gov/farmersmarkets/v1/svcdesc.html. There's an object called "MarketServiceClient" and that's about it for documentation.

Robert
  • 1,638
  • 7
  • 34
  • 45
  • That's not a callback. It's simply a string. Without more context, it's impossible to tell what purpose this parameter serves. – spender Jul 21 '13 at 23:56
  • 2
    It's a `string`! I think you're making assumptions about that parameter's function based on it's naming. You'll have to take a look at the implementation of the method to work it out, *or the documentation*. – Pero P. Jul 21 '13 at 23:57
  • maybe it's supposed to be the name of a function that you would like to be called asynchronously? can only guess without looking at the API documentation. – Dave Cousineau Jul 21 '13 at 23:58
  • I've updated my question if this helps at all. – Robert Jul 21 '13 at 23:59
  • 1
    I don't see any reference to a parameter `callback` in the WSDL. How did this c# code come into existence? – spender Jul 22 '13 at 00:06
  • At the top of the page is says to run this: `svcutil.exe http://search.ams.usda.gov/FarmersMarkets/v1/data.svc?wsdl` and two files will be generated that I have to include in my project (C# and an configuration file). – Robert Jul 22 '13 at 00:07
  • 2
    @spender I do, [check the tempuri.org namespace WSDL](http://search.ams.usda.gov/FarmersMarkets/v1/data.svc?xsd=xsd0) – Scott Chamberlain Jul 22 '13 at 00:08

1 Answers1

3

Given that this is an API that can be consumed via AJAX, I imagine that the callback parameter is for the server to write into JSONP results when serving JSONP.

spender
  • 117,338
  • 33
  • 229
  • 351