Loading ...
Sorry, an error occurred while loading the content.

Dime Attachements

Expand Messages
  • sseier
    I ve recently created a web service in .NET that replies with an embedded JPG file (Dime Attachment). I can call other methods in this web service properly via
    Message 1 of 2 , Sep 30, 2003
    • 0 Attachment
      I've recently created a web service in .NET that replies with an
      embedded JPG file (Dime Attachment). I can call other methods in this
      web service properly via Perl and SOAP::Lite. However, when I call
      the service that replies with the embedded file I get the contents of
      the binary file scrolled across the window.

      I want to be able to save this file to my local directory on the
      computer that I run this with. Here's a sample of the server code:

      [WebMethod(Description="Using DIME attachments")]
      public void GetImageDIME()
      {
      SoapContext soap = HttpSoapContext.ResponseContext;
      string filepath = ImageDirectory ;
      DimeAttachment dimeImage = new DimeAttachment("image/jpg",
      TypeFormatEnum.MediaType, ImageDirectory);
      HttpSoapContext.ResponseContext.Attachments.Add(dimeImage);
      }

      and the client code:

      use SOAP::Lite ;

      my $soap = SOAP::Lite
      -> uri('http://myserver/WS4/')
      -> on_action( sub { join '/', 'http://myserver/WS4', $_[1] } )
      -> proxy('http://myserver/WS4/Service1.asmx');
      print $soap->GetImageDIME()->result;

      When I run this script I get the following error: Unexpected Content-
      Type 'application/dime' returned.

      I want to be able to save this file as in:

      my $result = $soap->GetImageDIME();
      open(FL, ">> sample.jpg") || die "Failure";
      write (FL, $result->result);
      close(FL);

      Any thoughts?
    • Alasdair Allan
      ... While Byrne Reese s SOAP::MIME module adds attachement support to SOAP::Lite for MIME transport, there isn t, as far as I know, any support for DIME
      Message 2 of 2 , Sep 30, 2003
      • 0 Attachment
        > I've recently created a web service in .NET that replies with an
        > embedded JPG file (Dime Attachment). I can call other methods in this
        > web service properly via Perl and SOAP::Lite. However, when I call
        > the service that replies with the embedded file I get the contents of
        > the binary file scrolled across the window.

        While Byrne Reese's SOAP::MIME module adds attachement support to
        SOAP::Lite for MIME transport, there isn't, as far as I know, any
        support for DIME attachments.

        > When I run this script I get the following error: Unexpected Content-
        > Type 'application/dime' returned.
        >
        > I want to be able to save this file as in:
        >
        > my $result = $soap->GetImageDIME();
        > open(FL, ">> sample.jpg") || die "Failure";
        > write (FL, $result->result);
        > close(FL);
        >
        > Any thoughts?

        If you want this, you're probably going to have to write it yourself. I've
        been toying with putting a module together to do DIME attachments, but
        don't really have the time or a pressing need right now.

        Al.
      Your message has been successfully submitted and would be delivered to recipients shortly.