When you utilize a web service to return an existing type, the service
framework will create a new type for its purposes; it does this because not
everything that can be found in a .Net "type" makes sense in a webservice
"type". What you are more than likely encountering is a casting issue
because the type generated by the service framework is different than the
windows forms treenode. This is a basic/fundamental issue of typing.
If you absolutely have to pass a treenode instance from a web service, you
could always use serialization and return a byte stream; I have never done
this but I can't see why it wouldn't work.
.....not sure of your ultimate goal here, though.
--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog
"djp" <pi*************@gmail.comwrote in message
news:4e***************************@news.chello.pl. ..
Hi
I add web reference to my C# client app and call web method that returns
TreeNode.
I tried to cast WebService TreeNode to Windows Forms TreeNode, but without
any effect.
Any ideas?
Thanks
PK