473,394 Members | 1,737 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,394 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 3098
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.