473,289 Members | 1,842 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,289 software developers and data experts.

Streaming from webservice problem. This should be chicken feed for WS developers.

Hi,

I have a webservice with a method that returns an instance of
System.IO.MemoryStream.

For example:
[WebMethod]
public MemoryStream myMeth()
{
return new MemoryStream();
}

When I call that method from the client,

MemoryStream ms = myWS.myMeth();

I receive a type cast error ("Cannot implicitly convert type
'myWS.localhost.MemoryStream' to 'System.IO.MemoryStream"). I've tried
explicitly casting it to System.IO.MemoryStream, but to no avail.

Btw. I'm trying to stream data from WS to client. Not sure if
MemoryStream is the best way of doing it

Any help or guidance would be appreciated greatly.

Thanks,
Andre
Nov 23 '05 #1
7 3093
I am not sure if you ahve posted this before on another newsgroup, but
I would convert the MemoryStream to a byte array and pss the byte array
to the client from there you can convert the byte array back into a
MemoryStream

Nov 23 '05 #2
Hello redraven,
These [0] are the supported data types. Anything else that you send accross
the wire must be 'XmlSerializable'

[0] http://support.microsoft.com/default...b;en-us;326791

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a webservice with a method that returns an instance of
System.IO.MemoryStream.

For example:
[WebMethod]
public MemoryStream myMeth()
{
return new MemoryStream();
}
When I call that method from the client,

MemoryStream ms = myWS.myMeth();

I receive a type cast error ("Cannot implicitly convert type
'myWS.localhost.MemoryStream' to 'System.IO.MemoryStream"). I've tried
explicitly casting it to System.IO.MemoryStream, but to no avail.

Btw. I'm trying to stream data from WS to client. Not sure if
MemoryStream is the best way of doing it

Any help or guidance would be appreciated greatly.

Thanks,
Andre


Nov 23 '05 #3
What if the byte arry is gigantic?
Is there a way to actaully stream the array? Or will HTTP/SOAP take
care of the streaming?

"Keenan Newton" <ka*********@yahoo.com> wrote in message news:<11**********************@c13g2000cwb.googleg roups.com>...
I am not sure if you ahve posted this before on another newsgroup, but
I would convert the MemoryStream to a byte array and pss the byte array
to the client from there you can convert the byte array back into a
MemoryStream

Nov 23 '05 #4
What if the byte arry is gigantic?
Is there a way to actaully stream the array? Or will HTTP/SOAP take
care of the streaming?

"Keenan Newton" <ka*********@yahoo.com> wrote in message news:<11**********************@c13g2000cwb.googleg roups.com>...
I am not sure if you ahve posted this before on another newsgroup, but
I would convert the MemoryStream to a byte array and pss the byte array
to the client from there you can convert the byte array back into a
MemoryStream

Nov 23 '05 #5
Thanks for your reply.

What is the best way then to stream loads of data with a WS?

Dilip Krishnan <dk*******@NOSPAM.geniant.com> wrote in message news:<32**********************@msnews.microsoft.co m>...
Hello redraven,
These [0] are the supported data types. Anything else that you send accross
the wire must be 'XmlSerializable'

[0] http://support.microsoft.com/default...b;en-us;326791

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a webservice with a method that returns an instance of
System.IO.MemoryStream.

For example:
[WebMethod]
public MemoryStream myMeth()
{
return new MemoryStream();
}
When I call that method from the client,

MemoryStream ms = myWS.myMeth();

I receive a type cast error ("Cannot implicitly convert type
'myWS.localhost.MemoryStream' to 'System.IO.MemoryStream"). I've tried
explicitly casting it to System.IO.MemoryStream, but to no avail.

Btw. I'm trying to stream data from WS to client. Not sure if
MemoryStream is the best way of doing it

Any help or guidance would be appreciated greatly.

Thanks,
Andre

Nov 23 '05 #6
Hello redraven,
You cannot stream data. if you have large files then you would need to
use DIME [0] attachments or just send data as base64 encoded bytes

[0] - http://msdn.microsoft.com/msdnmag/is...s/default.aspx

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Thanks for your reply.

What is the best way then to stream loads of data with a WS?

Dilip Krishnan <dk*******@NOSPAM.geniant.com> wrote in message
news:<32**********************@msnews.microsoft.co m>...
Hello redraven,
These [0] are the supported data types. Anything else that you send
accross
the wire must be 'XmlSerializable'
[0] http://support.microsoft.com/default...b;en-us;326791

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi,

I have a webservice with a method that returns an instance of
System.IO.MemoryStream.

For example:
[WebMethod]
public MemoryStream myMeth()
{
return new MemoryStream();
}
When I call that method from the client,
MemoryStream ms = myWS.myMeth();

I receive a type cast error ("Cannot implicitly convert type
'myWS.localhost.MemoryStream' to 'System.IO.MemoryStream"). I've
tried explicitly casting it to System.IO.MemoryStream, but to no
avail.

Btw. I'm trying to stream data from WS to client. Not sure if
MemoryStream is the best way of doing it

Any help or guidance would be appreciated greatly.

Thanks,
Andre


Nov 23 '05 #7
It won't matter if it is "gigantic", however your other options are to
convert it base64, which i think would have a bigger foot print then a
byte array or use WS-Attachments with WSE 2.0. Again I think the
easiest way in your case is the byte array. Why don't you create a
simple web service and try out the differences.

Nov 23 '05 #8

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

Similar topics

2
by: Toma Marinov | last post by:
Hello ! I have a WebService. When I execute WS in browser on local machine - its OK! When I execute WS in browser on the server machine /with remote desktop/ - its OK! When I execute WebService...
5
by: David | last post by:
When I call a webservice with an ASP.NET application, I get the following error: "The underlying connection was closed: Unable to connect to the remote server. " With my brower, I can get the...
1
by: woodpecker woodpecker | last post by:
I have a webservice in my computer,it runs with no problem in my application,and can be called in other computers or server in the same intranet.If I don't let the server become a domain...
0
by: Fahad | last post by:
Hi, I am trying to update a list on sharepoint server via calling its standard built in web service. When ever i call the UpdateListitems() method, I get the following exception: at...
0
by: perschrotti | last post by:
I have simple .NET webservice coded in C# running on IIS 5 windows 2000 sp4 with .NET framework 1.1. I have a client coded in java with a webservice client stub generated by wsdl2java (axis). ...
1
by: Sukh | last post by:
Hello anyone, I am printing a pre-printed continue paper on dot-matrix printer using vb.net winform. For printing I am creating custom size paper and selecting the same for printing. Everything...
2
by: jack | last post by:
Hi all, good morning (im using vs2005) I want to commulicate with a web service in c# i did followed all the instructions in the book. i have tried it and worked perfectly in my local machine...
1
by: Mahesh Devjibhai Dhola | last post by:
Hi, Scenario: The webservice was developed on windows 2000 Pro and deployed previously on windows XP pro for testing. We have tested for many days. The client for that service was 30+ and...
0
by: Rado | last post by:
I have one problem. I have one webservice which is written in java.The webservice has method public long Test(long lastId, String login, String password) When I'm calling this method from...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.