N
Nick
below is the code. I don't really see anything wrong with it, but the
ResponseSoapContext.Current is always null. If anyone know how to
solve this please let me know. thanks a lot.
[WebMethod]
public string GetFile(string file)
{
// Get the SoapContext for the response message
SoapContext myContext = ResponseSoapContext.Current;
// String that represents the file name and path for the attachment.
string filePath = Server.MapPath(file);
// Create a new DIME attachment using the the file name and
// specifying the encoding of the attachment using the MIME media
// type of image\jpeg.
DimeAttachment dimeFile = new DimeAttachment("image/gif",
TypeFormatEnum.MediaType, filePath);
// Generate a GUID-based URI reference for the attachment object
// and assign in to the ID property of the DIME record.
dimeFile.Id = "uri:" + Guid.NewGuid().ToString();
// Add the new DimeAttachment object to the SoapContext object.
myContext.Attachments.Add(dimeFile);
return file;
}
ResponseSoapContext.Current is always null. If anyone know how to
solve this please let me know. thanks a lot.
[WebMethod]
public string GetFile(string file)
{
// Get the SoapContext for the response message
SoapContext myContext = ResponseSoapContext.Current;
// String that represents the file name and path for the attachment.
string filePath = Server.MapPath(file);
// Create a new DIME attachment using the the file name and
// specifying the encoding of the attachment using the MIME media
// type of image\jpeg.
DimeAttachment dimeFile = new DimeAttachment("image/gif",
TypeFormatEnum.MediaType, filePath);
// Generate a GUID-based URI reference for the attachment object
// and assign in to the ID property of the DIME record.
dimeFile.Id = "uri:" + Guid.NewGuid().ToString();
// Add the new DimeAttachment object to the SoapContext object.
myContext.Attachments.Add(dimeFile);
return file;
}