WebMethods and Byte Arrays

Posted on 2003-03-14
Medium Priority
Last Modified: 2012-05-04

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.

[1]  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?

[2]  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.
Question by:bryker
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Hummusx earned 800 total points
ID: 8137020
1) I think you aren't giving the HTTP protocol enough credit.  Firstly, the firewall is only going to be checking the port number that you are sending data to, which is going to be the HTTP port.  It is VERY unlikely that the firewall would be looking inside the packets to try to determine what you are sending.  Secondly, think about the HTTP protocol.  You can download files via HTTP, right?  Executables, zip files, PDF files, text files, etc, etc.  Most of those are NOT encoded as string while being transferred over HTTP.  Also, if you've ever worked with a web app that uploaded files, it is sent as a byte stream.

2) No need! =)

Author Comment

ID: 8139268
Thanks, Hummusx.  I feel better about this now, like some SysAdmin of Company A isn't going to go off on us if we're sending binary data in over their HTTP.  In fact, as you say, he probably won't even know, unless we tell him.

Woo-hoo!  I say.


Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

741 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