I am getting a System.InvalidCastException under the following scenario:
Server (hosted by .NET 1.0)
---------------------------
public object Server.GetObject()
{
returns a System.Data.DataSet;
}
WebService (hosted by .NET 1.1)
-------------------------------
public object WebService.GetObject()
{
return Server.GetObject(); // this is a Remote Call to the Server Singleton instance
}
Client (running under .NET 1.0)
-------------------------------
public void SomeClientFunction()
{
object oDs = WebService.GetObject();
DataSet ds = (DataSet)oDs; // throws invalid cast exception
}
In affect, the 1.0 client calls into our IIS http web service hosted by .NET 1.1.
This in turn calls into a remote singleton object on our server that is running under
1.0. The remote server object successfully creates a DataSet, passes it back to the
web service, which immediately passes it back to the client.
Looking in the debuger on the client, the oDs var is of type System.Data.DataSet, but
the invalid cast exception still occurs. I am guessing that somewhere in the web
service, the dataset has been converted into a 1.1 version DataSet - hence the invalid
cast exception on the client.
If I am right, my question is:
- if the Web Service can convert the 1.0 dataset received into a 1.1 dataset, why
can't the 1.0 client
convert it back.
- is it fair to expect this behaviour
- does anyone know how to make this work?
Thanks
Mark
************************************************************************
This email (including any attachments to it) is confidential, legally
privileged, subject to copyright and is sent for the personal attention
of the intended recipient only. If you have received this email in error,
please advise us immediately and delete it. You are notified that
disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.Although we have
taken reasonable precautions to ensure no viruses are present in this
email, we cannot accept responsibility for any loss or damage arising
from the viruses in this email or attachments.We exclude any liability
for the content of this email, or for the consequences of any actions
taken on the basis of the information provided in this email or its
attachments, unless that information is subsequently confirmed in
writing. If this email contains an offer, that should be considered
as an invitation to treat.
*************************************************************************
==================================================================