Solved

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

Posted on 2013-05-18
1
533 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
Comment Utility
You set an "Accept" header that allows also binary responses like images...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now