• twix
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Can anyone tell me if  it is possible to get binary data back from a web service callout?

 

I am using the apex Http, HttpRequest and HttpResponse classes to call an external  service that returns a binary file. I then attach that file to an email programatically. Everything works fine, except that my binary data in the attachment is mangled, because of the string conversion on response.getBody(). Is there a way to retrieve the binary stream from the HttpResponse class without corrupting it? 

 

Or is there another set of classes I should use to perform this function to get the results I'm looking for? 

 

Thanks for any help!

Gretchen

 

 

  • November 04, 2009
  • Like
  • 0