Solved

c# web service returns xml on most calls, but one returns binary

Posted on 2013-05-18
1
538 Views
Last Modified: 2013-05-18
Hi,
I am not sure how to handle this.  I have a web service that returns xml and everything was working well.  I was making requests and getting the response.  Apparently one function call streams binary data.  I am not sure how to deal with this.

Here is my code:
                XMLHTTP xmlHttp = new XMLHTTP();
                xmlHttp.open("POST", queryString, false, _userId, _password);
                xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                xmlHttp.setRequestHeader("Accept",
                                         "Accept      image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*");
                xmlHttp.send(postData);
                apiResponse.XmlHeaders = xmlHttp.getAllResponseHeaders();
                apiResponse.XmlResponse = xmlHttp.responseText;
0
Comment
Question by:jackjohnson44
1 Comment
 
LVL 12

Accepted Solution

by:
HugoHiasl earned 500 total points
ID: 39177864
You set an "Accept" header that allows also binary responses like images...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question