ASP.Net, c# Web Service with WSE, Handle SOAP/DIME attachments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    ASP.Net, c# Web Service with WSE, Handle SOAP/DIME attachments

    Hi Folks,

    Sorry if this is a bit vague, but I am REALLY struggling to find an answer to this (hopefully simple) question.

    I have a web service running on a system that we are using to integrate with another system running on that box.

    One of the things that I really really need is to accept a zip file from a user's system, and 2/3 strings with some details.

    I am aware that we can use SOAP and DIME to attach this file to this request, and have been able to find code on MSDN to RETURN DIME attachments. But I can't seem to find any code that recieves it in the web service.

    i.e.

    user invokes web service by sending data and file in SOAP request and the service then goes and does things with that file then returns some data.

    Can anyone help me out with how to catch and read in this file in the request?

    Something like this.. but working :)

    Code:
    [WebMethod]
            public string testing(string fileName)
            {
                string answer = "";
    
                if (HttpSoapContext.RequestContext.Attachments.Count > 0)
                {
                    answer = "Got it!";
                }
                else
                {
                    answer = "Nothing there mate...";
                }
                return answer;
            }
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Is it actually possible to handle an attachment with a request and not a responce???

    Comment

    Working...