Imports System.Web.Services Imports System.IO Imports System.XML Imports Microsoft.Web.Services Imports Microsoft.Web.Services.DimeAnd, 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 FunctionThe error is reported on the line:
loContext.Attachments.Add(loDimeAttachment)Anyone knows what I am missing?