WebMethods and Byte Arrays
Posted on 2003-03-14
This is kind of a long-winded question, but I don't think it's terribly complicated. Some of it should demonstrate my lack of understanding of how Web Services work behind the scenes.
I have a large XML dataset that I need to send to a Web Service. That works fine--my WS takes a string parameter and I send the XML string over that parameter.
However, as I said, the XML is large. Therefore, I'm now compressing the XML (using XMILL) to binary format, on the client side, then sending that resulting byte array "over the wire" to another Web Method. As you can imagine, this is much faster. On the web side, I decompress that byte array back to XML and I have everything I need.
All this testing is happening on my own PC, by the way, where I have IIS running.
 Thinking ahead, I know that my clients are going to allow HTTP calls through their firewall, but nothing else. Here's the big question: when I send that byte array to my Web Method, is it still using HTTP?
Goofy question, probably, but I understand HTTP only to send text data. Can I assume, then, that somewhere behind the scenes, my byte array is formatted as text, somehow, then packaged into the SOAP message that's sent to my Web Method? Can I assume that there's some kind of conversion going on to get this byte data across in a way that's palatable to HTTP?
 IF THAT'S NOT TRUE, and if somehow this Web Method is not receiving its byte-array parameter over HTTP (and what else would that be?), then is there some way I can "convert" the byte array back to a String type before sending it, so that it WILL go over HTTP? Obviously, I wouldn't want to convert it back to XML, or I'd be back to the original problem (XML dataset too large).
Please let me know if I need to explain this 2-part question further.