VB.NET

55 views
Skip to first unread message

Manuel Cavallaro

unread,
May 2, 2012, 9:41:24 AM5/2/12
to fotol...@googlegroups.com
Hi to all,
my website is provided with framework 3.5 and so i can't use FTTK REST v.1.1

Someone can give me the link for a older version of FTTK REST for framework 3.5?

or an'example of httprequest in VB.net for Fotolia API REST..

Thanks

Massimo Bonanni

unread,
May 6, 2012, 12:19:46 PM5/6/12
to Fotolia API
Hi, Manuel
FTTK was born for .NET Framework 4.0.
You can try to download source code (it's opena source) and you can
try to compile with .net framework 3.5.
I suggest you to use Visual Studio 2010 and compile the code for .net
3.5 (in this case you don't change all the compact property definition
used inside code).
The only typical .net framework 4.0 class that I used is Tuple that
you can implements easily.
If you'll have some problems, you'll contact me and I'll try to help
you.

Max

Manuel Cavallaro

unread,
May 8, 2012, 3:41:28 AM5/8/12
to fotol...@googlegroups.com
Hi Massimo,
i tried to use the Rest 1.1 in a website with framework 4.0

I get this error: "The type initializer for 'FTTK.Services.Implementations.Rest.BaseService' threw an exception"

Do you know the reason?

Thanks

Massimo Bonanni

unread,
May 9, 2012, 1:33:44 PM5/9/12
to fotol...@googlegroups.com
Hi Manuel.
Please, can you post the complete exception and the code you use to create instance of PartnerService?
 
Thanks
Max

Manuel Cavallaro

unread,
May 9, 2012, 2:29:51 PM5/9/12
to Fotolia API
This is the load function:

Try
Dim Ft As New
Services.Implementations.Rest.PartnerService("API_KEY")
Dim i, iNrFoto, iNrGallery As Integer
Dim request As New FTTK.Entities.SearchRequest
Dim filter As New FTTK.Entities.SearchFilters
Dim Cat As System.Collections.Generic.IEnumerable(Of
FTTK.Entities.Category)
Dim Foto As System.Collections.Generic.IEnumerable(Of
FTTK.Entities.Media)

Cat = Ft.GetConceptualCategories(6)

iNrFoto = Cat.Count

'Carico le foto
filter.ContentType = Entities.SearchResultsContentType.All
filter.Licenses = Entities.SearchResultsLicense.All
filter.PanoramicImages = True

request.LanguageID = 6
request.DetailLevel = Entities.SearchDetailLevel.Extended
request.Filters = filter
request.ResultsOrderCriteria =
Entities.SearchResultsOrder.Relevance
request.ConceptualCategoryId = "1000000"
request.MaximumResult = 10

Foto = Ft.GetSearchResults(request, iNrFoto,
Entities.SearchResultsColumns.All, False)

For i = 0 To Foto.Count - 1
'Per ogni foto
If i <> 0 And i Mod 10 = 0 Then
PHbody.Controls.Add(New LiteralControl("<br/>"))
End If
PHbody.Controls.Add(New LiteralControl("<a href='" &
Foto(i).AffiliationLink & "'><img src='" & Foto(i).Thumbnail110.Url &
"' /> - " & Foto(i).Id & "</a> &nbsp;"))
Next

Catch ex As Exception
Response.Write(ex.Message)
End Try


in the "Bin" directory i saved all the dll files that i find in the
zip download.

Thenks

Massimo Bonanni

unread,
May 10, 2012, 3:09:20 PM5/10/12
to fotol...@googlegroups.com
Are you sure that API_KEY is OK? (I hope yes)
Your software use framework 4.0 complete or client?
Tomorrow, I try tu use directly your code in a my project and I'll post the results.
 
Max
Reply all
Reply to author
Forward
0 new messages