Re: String compression

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 03/17/04


Date: Wed, 17 Mar 2004 09:11:48 -0500


    There is a problem with this. If you want to still use Web Services,
then you will have to encode the binary attachments as base 64, or use DIME
(which is being deprecated as well). If you go the base64 route, whatever
binary you create is going to be represented in approximately 4/3 the size
of the original binary (larger), and that has to be wrapped in an XML
payload which is transmitted to the web service.

    Basically, you will have to perform a calculation to determine if the
overall size of the payload is larger or smaller than what it would be
compressed, encoded, and wrapped in a call to another web service. Not
exactly the easiest of things.

    To be honest, I think that the OP might have better luck optimizing the
performance of the code that the web service runs, instead of going this
route.

    Also, it should be mentioned that there is a lot of talk regarding a
"binary infoset" for the purposes of efficiency.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uRJBAYCDEHA.240@tk2msftngp13.phx.gbl...
> Hi,
>
>  The best way of doing it would be create a ZIP and send the zip, now, I
> don;t think that you can send a binary stream using a webservice, if not
the
> the zip stream should be converted and sent as text. and then decompress
in
> the receiving, I think that this solution should be faster than sending
the
> XML per se, but there are better solutions like:
>
> 1- Using remoting with a binary encoding and the TcpChannel.
> 2- If you don;t wanna use remoting you can make a Tcp connection and send
> the binary stream.
>
> Now, you could also persist the stream to a file and then send this file
as
> many times as needed, this allow you to decouple the generation of the
data
> and the sending operation.
>
>
> Cheers,
>
> -- 
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
>
> "skg" <anonymous@discussions.microsoft.com> wrote in message
> news:3EB5E255-4FCB-424D-AFF1-77AF4A9DD78F@microsoft.com...
> > I'm looking for code on how to compress a (XML) string to send through a
> WebService. Due to the size of the data we are sending it takes an
> unacceptable amount of time to accomplish the task. If we can compress the
> string into a string then we can speed up the task and make eveyone happy.
>
>


Relevant Pages

  • Re: File Uploads to Web Service in both SOAP and HTTP-POST
    ... Currently I have it working perfectly for a SOAP/XML request reading ... to encode a file on a POST to the same web service. ... binary stream which the SOAP envelope delivers as a byte. ... The webservice sees this as your bit and the file is demarshalled ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... I've added the web service call directly to my Data binding method ... expected but not present in the security header of the incoming ... the username token to the message. ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Consume Web Service...
    ... to call a web service in my orchestration. ... Xml parameters as string datatypes and processes this Xml and returns ... ignoreCommit, XMessage msg) ...
    (microsoft.public.biztalk.general)
  • Re: DateTime WebService Discrepancy.
    ... When the datetime is sent by the webservice, ... > Ofcourse I had not even though of just passing a string as a parameter ... > locally and cut out the call to the web service. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: proxy error when consuming web service
    ... public string GetQuote ... I *didn't* pass anything to the proxy property of the service ... 'Assume RemoteWebService is a remote web service proxy class. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)