<WebMethod(Description:="Upload data")> _
Public Function Upload() As DataSet
Try
Dim _httpRequest As HttpRequest = HttpContext.Current.Request
Dim _requestLength As Long = _httpRequest.InputStream.Length
Dim _xmlFileAsByteAray() As Byte
ReDim _xmlFileAsByteAray(_requestLength)
_httpRequest.InputStream.Read(_xmlFileAsByteAray, 0, Convert.ToInt32(_requestLength))
Dim _xmlFile As String = System.Text.Encoding.UTF8.GetString(_xmlFileAsByteAray)
' Now process the xml file
Catch ex As Exception
' Send error back to app
End Try
' Now do your return dataset if you need one
End Function