473,320 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to pass data directly in stream on the WS calls

Bob
I'm trying to centralize some of the common Web User Controls used in all of
our web applications (like header, footer) and put them in a web service to
be called by all the other web applications. There are a couple of ways I
can think of that can probably accomplish what I need. I'm most interested
in rendering the control on the WS server end, and then stream the result to
the consuming clients (the other web applications). I think this is
definitely doable but just can't quite figure how this should work. The
following is what I have so far on the WS server end in the asmx class:

[WebMethod]
public void GetPageHeader() {
/*oad the user control */
UserControl uc = new UserControl();
UserControl header =
(UserControl)uc.LoadControl(@"~\UI\HeaderNoMenu.as cx");

/*render the user control into the HttpResponse stream */
TextWriter tw = new
StreamWriter(this.Context.Response.OutputStream);
HtmlTextWriter htw = new HtmlTextWriter(tw);
header.RenderControl(htw);
}

This compiles ok and runs without error when invoked from a browse (it
doesn't show anything in the browser as expected). However, I'm not sure
how to get the stream from the client end as no stream is exposed anywhere.
A fragment of the proxy class generated is shown below.

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="CommonUIElementsSoap",
Namespace="http://tempuri.org/")]
public class CommonUIElements :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.o
rg/GetPageHeader", RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public void GetPageHeader() {
this.Invoke("GetPageHeader", new object[0]);
}
Do I need to implement something myself in order to get the stream, like
maybe using SoapExtension class? Any suggestions would be helpful.
Nov 18 '05 #1
0 887

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: TJ | last post by:
I need to be able to pass a pointer to a (managed code) Stream object to a COM method so it can serialize its data into the stream. I have a C# application that makes uses of Randolf Duke's...
0
by: Bob | last post by:
I'm trying to centralize some of the common Web User Controls used in all of our web applications (like header, footer) and put them in a web service to be called by all the other web applications....
0
by: Michael B. Trausch | last post by:
I am attempting to piece together a Python client for Fotobilder, the picture management server on Livejournal. The protocol calls for binary data to be transmitted, and I cannot seem to be able...
6
by: Pat B | last post by:
Hi, I'm writing my own implementation of the Gnutella P2P protocol using C#. I have implemented it using BeginReceive and EndReceive calls so as not to block when waiting for data from the...
4
by: rakesh.usenet | last post by:
For a particular application of mine - I need a simulation of byte array output stream. * write data onto a stream * getback the contiguous content as an array later for network transport. ...
9
by: Bill E. | last post by:
I'm creating an MS Access application that connects to a SQL Server 2005 database using pass-through queries and ADO to call stored procedures. I ran a SQL trace and started clicking through...
4
by: Bill E. | last post by:
Lyle, Thanks for the information. I'm not using an ADP and I'm not using application roles, although I was considering it. I agree that it would be helpful if it were documented somewhere how...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
2
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
I'm creating a XBAP application and want it take some input from webpage dynamically? what is the best way? how to do it? Best Regards Steven -- ======================= Steven Tang SYWWUYU)
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.