I have added the DMXService.asmx file as web reference. The following code errors out with following message:
" ex.Message "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Common.Globals.ConvertDataReaderToDataTable(IDataReader reader) at DotNetNuke.Common.Globals.ConvertDataReaderToDataSet(IDataReader reader) at Bring2mind.DNN.Modules.DMX.Webservice.Service.GetPortalCollectionlist() --- End of inner exception stack trace ---"
Am I doing something wrong?
Imports
Bring2mind.DNN.Modules.DMX.Business.EntriesController
Imports
System.IO
Imports
DotNetNuke.Entities.Users
Imports
System.Web
Module
ProgramSub Main()Dim User As New UserInfo()Dim PortalId As Integer = 0Dim CollectionId As Integer = 1Dim File As System.IO.Stream = New FileStream("D:\vmware license.txt", FileMode.Open)Dim OriginalFilename As String = "desktop.ini"
Dim Title As String = "desktop.ini"
User.UserID = 5
Try
'Dim rc As Integer = SimplifiedUpload(PortalId, CollectionId, File, OriginalFilename, Title, User, True)
lc.PortalId = 0
lc.Username =
Dim lc As New DMXService.LoginCredentials()"name"
lc.Password =
"password"
Dim ssc As New DMXService.ServiceSoapClient()Dim buffer(File.Length) As Byte
File.Read(buffer, 0, File.Length)
ssc.Open()
If ssc.Login(lc) Then
Dim ds As System.Data.DataSet = ssc.GetPortalCollectionlist(lc)'Dim i As Integer = ssc.SimpleUploadNewEntry(lc, 3, buffer, "vmware license.txt")
End If
MsgBox(ex.Message)
Catch ex As ExceptionFinally
File.Close()
End Try
End
End Sub Module