user3525511
user3525511

Reputation:

How to return list from webservice

within webservce MyService. DocumentList Class containing properties id, name -- Class is Serializable

Public Function getDocList(args...) as List(Of DocumentList)
'code to add to documentlist
'no issue here...
End Function

Within project.

Dim thisService as New MyService

Sub Main
Dim docList as New List(of DocumentList)
docList = thisService.getDocList(args...)
End Sub

I get error - cannot convert -1 dimensional array to generic list of DocumentList. If I consume DocumentList within the service, no issues. I can iterate with for each. But, within the project, which calls the service, I cannot consume DocumentList. I have set the service to pass a string, and this is possible. Only the List(Of DocumentList) is an issue.I think I may need reflection, or a proper understanding of collections. Not sure. Thank you.

Upvotes: 0

Views: 148

Answers (1)

user3525511
user3525511

Reputation:

Dim docList as DocumentList()

Cannot return a complex type, had to set my DocumentList as an array in the project calling the webservice. http://www.asquestion.com/question/60333227137608045/Problem-returning-a-collection-from-a-web-service

Upvotes: 1

Related Questions