help!! ResponseSoapContext.Current is always null

Discussion in 'ASP .Net Web Services' started by Nick, Apr 24, 2004.

  1. Nick

    Nick Guest

    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;
    }
    Nick, Apr 24, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    26,427
    Mike Schilling
    Mar 29, 2006
  2. Deryck
    Replies:
    4
    Views:
    502
    derek giroulle
    Jun 22, 2004
  3. ns
    Replies:
    4
    Views:
    4,328
  4. Nieko Punt
    Replies:
    3
    Views:
    724
    Joe_Langley
    Jun 20, 2005
  5. KDawg44

    AJAX Help - responseXML always NULL

    KDawg44, Aug 2, 2008, in forum: Javascript
    Replies:
    6
    Views:
    202
    KDawg44
    Aug 3, 2008
Loading...

Share This Page