Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > help!! ResponseSoapContext.Current is always null

Reply
Thread Tools

help!! ResponseSoapContext.Current is always null

 
 
Nick
Guest
Posts: n/a
 
      04-24-2004
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;
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
Trying to create a CSS box that is always is always the width of an image placed inside it (and no wider) Deryck HTML 4 06-22-2004 08:25 PM
Re: When do I always put a "else NULL" statement in my VHDL code? walala VHDL 2 10-11-2003 10:51 PM
About Latches and Registers was (When do I always put a "else NULL"statement in my VHDL code?) Ingmar Seifert VHDL 0 09-14-2003 07:57 PM
Re: When do I always put a "else NULL" statement in my VHDL code? Kelvin VHDL 1 09-13-2003 11:07 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57