Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object reference not set to an instance of an object
Message
From
17/02/2004 16:49:43
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web Services
Title:
Object reference not set to an instance of an object
Miscellaneous
Thread ID:
00878121
Message ID:
00878121
Views:
60
When I make a call to my Web Service, I have a message:

Object reference not set to an instance of an object

This is my import status:
Imports System.Web.Services
Imports System.IO
Imports System.XML
Imports Microsoft.Web.Services
Imports Microsoft.Web.Services.Dime
And, this is the method which is concerned:
   <WebMethod()> _
   Public Function UTDCDownloadFile(ByVal tnNumero As Integer) As String
      '      Return Me.GetData("2," + tnNumero.ToString, 7)

      ' Get the SoapContext for the response message
      Dim loContext As SoapContext
      loContext = HttpSoapContext.ResponseContext

      ' Get the file name
      Dim lcFile As String
      lcFile = "D:\IIS\Universa\About1.jpg"

      ' Create a new DIME attachment using the the file name and 
      ' specifying the encoding of the attachment using the MIME media type
      Dim loDimeAttachment As DimeAttachment
      loDimeAttachment = New DimeAttachment("image/jpeg", TypeFormatEnum.MediaType, lcFile)

      ' Generate a GUID-based URI reference for the attachment object
      ' and assign in to the ID property of the DIME record
      loDimeAttachment.Id = "uri:" + Guid.NewGuid().ToString()

      ' Add the new DimeAttachment object to the SoapContext object
      loContext.Attachments.Add(loDimeAttachment)

      ' Return the file name of the attachment
      Return "About1.jpg"

   End Function
The error is reported on the line:
      loContext.Attachments.Add(loDimeAttachment)
Anyone knows what I am missing?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform