Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > web service ( + WSE 2.0 ) hangs after adding an output filter

Reply
Thread Tools

web service ( + WSE 2.0 ) hangs after adding an output filter

 
 
DaberElay
Guest
Posts: n/a
 
      06-27-2004
Hi,
I have a server that returns a dataset of over 10,000 records. i added a output filter to the web.config file and i zip the body,create an empty body and add the zip as an attachment ( using #ZipLib freeware project ) in the processMessage method, it all runs fine and in a responsive manner.
on the client side i add an input filter to the pipeline that do exactly the oposite : i unzip the attachment & replace the body with the unzip version.

i have 2 problems : 1. between the server's filter end of call and the call to the client filter, i'm unresponsive for as much as +30 seconds ( changing each run ).
2. the client filter is being called twice, i can overcome this but it proves that there is a problem.

I attached the code in question,

please advise,
much appriciated.



server side code :
XmlElement soapHeader = envelope.CreateHeader();
XmlDocument document = soapHeader.OwnerDocument;
XmlElement customHeader = document.CreateElement( "ZipFilter" );
customHeader.SetAttribute("bZipped","1");
soapHeader.AppendChild(customHeader);

MemoryStream original = new MemoryStream( System.Text.Encoding.UTF8.GetBytes(envelope.Body.I nnerXml ) );

MemoryStream Zipped = new MemoryStream();
ICSharpCode.SharpZipLib.BZip2.BZip2.Compress( original,Zipped,1024);

MemoryStream res = new MemoryStream( Zipped.GetBuffer() );
Microsoft.Web.Services2.Attachments.Attachment attch = new Microsoft.Web.Services2.Attachments.Attachment( "APPLICATION/OCTET-STREAM",res );
envelope.Context.Attachments.Add( attch );
XmlElement newBody = envelope.CreateBody();
newBody.RemoveAll();
envelope.SetBodyObject( newBody );

client side code :
XmlNodeList elemList = envelope.Header.GetElementsByTagName("ZipFilter");
if ( elemList[0].Attributes["bZipped"].Value.Equals("0") )
return;
envelope.Header.RemoveChild( elemList[0] );
Stream original = envelope.Context.Attachments[0].Stream;
MemoryStream UnZipped = new MemoryStream();
ICSharpCode.SharpZipLib.BZip2.BZip2.Decompress( original,UnZipped );
XmlElement body = envelope.CreateBody();
body.InnerXml = System.Text.Encoding.UTF8.GetString( UnZipped.GetBuffer() );



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to a web service using WSE 2.0 Shawn ASP .Net 0 02-19-2006 05:03 PM
Proxy for WSE 2 enabled web service ? Chakra ASP .Net Web Services 1 02-28-2005 05:11 PM
Clear hangs up - & hangs up - & hangs up Sue Bilstein NZ Computing 26 03-07-2004 01:33 AM
Has anyone tried using cache within WSE filter?? Naresh ASP .Net Web Services 0 10-12-2003 08:28 AM
Bug in WSE for C++ Web Service? Daniel Johansson ASP .Net Web Services 0 08-25-2003 03:13 PM



Advertisments