I have a web service that performs some action on a file. My service exposes two web methods. The first accepts a single file path to work on. The second accepts an array of paths to work on, it then breaks open the array and calls the first method on each in turn.
My question is what is the best way to call this web service from a front end asp.net page? Should I instantiate a single web service object and send the array of paths or should I create the loop to open the array on the client page and call a new web service object for each of the paths?
I'm going to begin testing both methods to see what happens. Here is how I envision it:
Will the code for Mode 2 actually work? Or should I be creating an array of web service objects?
My question is what is the best way to call this web service from a front end asp.net page? Should I instantiate a single web service object and send the array of paths or should I create the loop to open the array on the client page and call a new web service object for each of the paths?
I'm going to begin testing both methods to see what happens. Here is how I envision it:
PHP:
'Mode 1
'Send an array of all the paths to be done
Dim obj As New TransService.TransService
obj.Timeout = -1
Try
obj.TranslateDrawings(aList)
Catch ex As Exception
Me.txtError.Text = "Error Loading Array : " & ex.Message
End Try
'Mode 2
'Break open the array here and send each path to a different web method
For j = 0 To aList.GetUpperBound(0) - 1
Dim AnObj As New TransService.TransService
AnObj.Timeout = -1
Try
AnObj.TranslateDrawing(DGNList(j))
Catch ex As Exception
Me.txtError.Text = "Error sending single path to service"
End Try
Next
Will the code for Mode 2 actually work? Or should I be creating an array of web service objects?