sending an image by webservice..

Discussion in 'ASP .Net Web Services' started by Milsnips, Oct 18, 2004.

  1. Milsnips

    Milsnips Guest

    hi there,

    is this possible?

    i want the user to upload a image on their website, then i want to send it
    by webservice ( or another method to a second webserver) and store it there
    also?

    thanks,
    Milsnips, Oct 18, 2004
    #1
    1. Advertising

  2. Milsnips wrote:
    > i want the user to upload a image on their website, then i want to send it
    > by webservice ( or another method to a second webserver) and store it there
    > also?


    Look into using DIME and WS-Attachments. I have an article on this very
    topic here:

    An Extensive Examination of Web Services: Part 10
    http://aspnet.4guysfromrolla.com/articles/090804-1.aspx

    In fact, you may want to read the entire (currently) 10-part series on
    Web services I've written... it starts here:
    http://aspnet.4guysfromrolla.com/articles/100803-1.aspx

    You could also pick up a copy of my .NET Web Services DVD at
    http://www.amazon.com/exec/obidos/ASIN/B0002AHVPA/4guysfromrollaco -
    it's a two-disc DVD with ~10 hours of training on creating and consuming
    Web services, examining the core Web service standards along with WSE.
    In fact, the *entire* ~30-minute Chapter 14 on using DIME and
    WS-Attachments can be found online at
    http://dvpress.com/ecom/Downloads/Sample_Clips.aspx

    Happy Programming!

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
    Scott Mitchell [MVP], Oct 19, 2004
    #2
    1. Advertising

  3. Milsnips

    Nitin Guest

    well yes u can upload the image file by calling web service method,
    the Web services toolkits support adding attachments to SOAP messages using
    an object model, so that you are abstracted from the details of populating
    HTTP headers and building the compound SOAP message. Thanks to the generation
    of Web service proxies, in a few lines of code you can create a DIME
    attachment from a binary stream, attach it to the outgoing attachments
    collection, and invoke the Web service method, as shown here for a .NET Web
    service.
    DimeAttachment attachment =
    new DimeAttachment("image/jpeg",
    TypeFormatEnum.MediaType,
    data);
    svc.RequestSoapContext.Attachments.Add(attachment);
    svc.SignAttachment(text);

    more information about Soap specificaion for attachment can be found at
    http://www.w3.org/TR/SOAP-attachments
    "Milsnips" wrote:

    > hi there,
    >
    > is this possible?
    >
    > i want the user to upload a image on their website, then i want to send it
    > by webservice ( or another method to a second webserver) and store it there
    > also?
    >
    > thanks,
    >
    >
    >
    Nitin, Oct 20, 2004
    #3
    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. Flare
    Replies:
    4
    Views:
    457
    Flare
    Nov 9, 2003
  2. Nick Gilbert
    Replies:
    4
    Views:
    1,490
  3. Joe
    Replies:
    1
    Views:
    423
    Mark Rae
    Sep 27, 2005
  4. Replies:
    0
    Views:
    1,321
  5. Luke
    Replies:
    2
    Views:
    4,663
    Nigel Wade
    Mar 15, 2007
Loading...

Share This Page