Wednesday, 15 January 2014

F# Type providers and Sky Biometry -



F# Type providers and Sky Biometry -

has used f# type providers sky biometry?

a bulk of calls work great type providers. however, when phone call faces/recognize method, getting fails using both json , xml type provider.

using json one, declare type this:

type skybiometryjsonfacerecognition = jsonprovider<"http://api.skybiometry.com/fc/faces/recognize.json?uids=default@imagecomparer&urls=https://lg2014dev.blob.core.windows.net/d69bdda9-d934-448c-acae-99019f3a564f/01ee184f-ff0b-426f-872a-cbc81ef58d90.jpg&api_key=xxxxx&api_secret=yyyyy">

when seek , utilize type in code, failing on lastly part of graph:

let recognition = skybiometryjsonfacerecognition.load(stringbuilder.tostring())

it should be:

recognition.photos.[0].tags.[0].uids.[0].confidence

but instead get:

recognition.photos.[0].tags.[0].uids.[0].jsonvalue

i swapped on xml type provider 1 phone call , getting intellisense working:

let recognition = skybiometryxmlfacerecognition.load(stringbuilder.tostring()) recognition.photos.photo.tags.tag.uids.uid.confidence

but when run it, get

system.xml.xmlexception: info @ root level invalid. line 1, position 1.

looking @ xml in phone call browser, sure looks fine me:

does have suggestions? thanks

thanks ntr's suggestion, changed type def utilize local storage. json tp found of props , actual phone call worked expected. everyone.

f# type-providers f#-data

No comments:

Post a Comment