• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

eric
#1 Posted : Wednesday, November 28, 2007 4:14:33 PM(UTC)
eric

Rank: Member

Joined: 4/25/2003(UTC)
Posts: 71

How do I pass a collection via webservices? This post shows how to pass an object (a single product) via webservices, however, I would like to pass a collection of products.


I tried the following, but get an error ("value of type bvc5.product cannot be converted to system.collections.objectmodel.collection(of bvc5.product)"
), on the highlighted line.



Module Module1
Sub Main()
Dim service As New bvc5.WebServices3
Dim token As bvc5.AuthenticationToken

token = service.Login("admin", "password")
If token.TokenRejected Then
Console.WriteLine("You are not authorized to use BVC5 web services.")
Exit Sub
End If



Dim productList As New System.Collections.ObjectModel.Collection(Of bvc5.product)
[color=blue> ][/color] If token.TokenRejected Then
Console.WriteLine("You are not authorized to access the Catalog.")
Exit Sub
End If

' do some stuff....



End Sub
End Module





TIA.
Marcus
#2 Posted : Friday, November 30, 2007 1:38:00 PM(UTC)
Marcus

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 1,786

Collections are serialized as arrays over SOAP web services:

Code:


Dim productList() as bvc5.product = service.Catalog_InternalProduct_FindAll(token)

if productList IsNot nothing then
for i as integer = 0 to productList.Length -1
Console.WriteLine(productList(i).ProductName
end for

end if

Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012