Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 244,258 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,286 people online right now. Registration is fast and FREE... Join Now!




Web Service Array Problem

 
Reply to this topicStart new topic

Web Service Array Problem, Cannot pass arrays over a webservice and copy them normally

karimallen
7 Jan, 2009 - 05:00 AM
Post #1

New D.I.C Head
*

Joined: 7 Jan, 2009
Posts: 1

I have a simple webservice with a function that returns a simple string array of ten items. When I call the function from my application it will not let me copy the returned array to another variable. I can count the array and access individual items however whenever I try to copy as shown below..

dim i as string()
i = webservice.getstringarray()

the program complains saying

'arrayofstring cannot be converted to 1-dimensional array of string'

the code is below im totally lost!!!!!!
CODE

<WebMethod()> _
Public Function Get_Practices() As String()
Dim PCB_Practices(1) As String
PCB_Practices(0) = "one"
PCB_Practices(1) = "two"
Return PCB_Practices
End Function

Public Sub Get_Practices()
Dim i As String()
i = dummy_web_service_pointer.Get_Practices() <<Error line!
End Sub


User is offlineProfile CardPM
+Quote Post


TVW
RE: Web Service Array Problem
13 Feb, 2009 - 10:27 PM
Post #2

New D.I.C Head
*

Joined: 13 Feb, 2009
Posts: 1

So. Dim I() as string = webservice.getstringarray() will work better for ya.
smile.gif

QUOTE(karimallen @ 7 Jan, 2009 - 05:00 AM) *

I have a simple webservice with a function that returns a simple string array of ten items. When I call the function from my application it will not let me copy the returned array to another variable. I can count the array and access individual items however whenever I try to copy as shown below..

dim i as string()
i = webservice.getstringarray()

the program complains saying

'arrayofstring cannot be converted to 1-dimensional array of string'

the code is below im totally lost!!!!!!
CODE

<WebMethod()> _
Public Function Get_Practices() As String()
Dim PCB_Practices(1) As String
PCB_Practices(0) = "one"
PCB_Practices(1) = "two"
Return PCB_Practices
End Function

Public Sub Get_Practices()
Dim i As String()
i = dummy_web_service_pointer.Get_Practices() <<Error line!
End Sub



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 11:13AM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month