473,325 Members | 2,816 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,325 software developers and data experts.

Converting objects thru Web Services or Disconnected

I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my data
objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and placed
this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me that
it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same
objects?

I appreciate your help, please let me know if the above makes no sense.

JW
I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my data
objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and placed
this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me that
it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same
objects?

I appreciate your help, please let me know if the above makes no sense.

JW
Nov 21 '05 #1
2 2276
You will need to cast the datatype explicitly, even though you know it's the
same type. It seems redundant, but if you think about it, there's only one
workaround, which is to have both the Web service and the client reference
the same type definition assembly. To do this, you would (ideally) generate
an XSD file for the custom type, then use xsd.exe to generate the code
definition of the type. You would then compile this definition into an
assembly, that you could reference from clients, services, whoever needed
access to the exact same type definition.

Of course, this approach is not practical in most cases, and it creates a
level of tight coupling that goes against SOA tenets. So you pretty much
have no choice but to treat the Web Service version and the local version as
two separate data types that can cast to eachother. I would still generate
an XSD definition, because this abstracts the definition away from any one
implementation.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx

"John Wilson" <JW@nospam.com> wrote in message
news:e2**************@TK2MSFTNGP09.phx.gbl...
I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my data objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and placed this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me that it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same
objects?

I appreciate your help, please let me know if the above makes no sense.

JW
I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my data objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and placed this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me that it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same
objects?

I appreciate your help, please let me know if the above makes no sense.

JW

Nov 21 '05 #2
DC
also, maybe this article will help
http://msdn.microsoft.com/library/en...ce07162002.asp

-D

"Jeffrey Hasan" <an*******@noemail.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
You will need to cast the datatype explicitly, even though you know it's the same type. It seems redundant, but if you think about it, there's only one
workaround, which is to have both the Web service and the client reference
the same type definition assembly. To do this, you would (ideally) generate an XSD file for the custom type, then use xsd.exe to generate the code
definition of the type. You would then compile this definition into an
assembly, that you could reference from clients, services, whoever needed
access to the exact same type definition.

Of course, this approach is not practical in most cases, and it creates a
level of tight coupling that goes against SOA tenets. So you pretty much
have no choice but to treat the Web Service version and the local version as two separate data types that can cast to eachother. I would still generate
an XSD definition, because this abstracts the definition away from any one
implementation.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx

"John Wilson" <JW@nospam.com> wrote in message
news:e2**************@TK2MSFTNGP09.phx.gbl...
I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my

data
objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and

placed
this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me

that
it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same objects?

I appreciate your help, please let me know if the above makes no sense.

JW
I have an application that can access data both locally and through web
services (it may be working in a disconnected mode). I have defined my

data
objects (e.g. ObjectA) in a separate component (e.g. DataDefiner) and

placed
this on the local machine and the webserver.

When I get my Object A back from the webserver, Visual Studio tells me

that
it cannot convert WebService.ObjectA to DataDefiner.ObjectA. How can I
define objects that can be read locally or via webservices, using the same objects?

I appreciate your help, please let me know if the above makes no sense.

JW


Nov 21 '05 #3

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

Similar topics

5
by: Brian Kiser | last post by:
What is Microsoft's stance on developing business objects vs datasets when creating n-tier apps. Is anyone doing business objects? It appears that most articles from MS recommend passing...
4
by: Chuck Ritzke | last post by:
I keep asking myself this question as I write class modules. What's the best/smartest/most efficient way to send a large object back and forth to a class module? For example, say I have a data...
2
by: J. L. Goddard | last post by:
Suppose I were designing a web service to accept many data transactions per second and put them into a sql server database. What design recommendations would you make ? For examply, should I...
5
by: Mountain Bikn' Guy | last post by:
How would I do this? public sealed class UtilityClass { public static MyObject Object1;//see note below about importance of static object names in this class public static MyObject Object2;...
0
by: GBR | last post by:
Hi, We are using classes to send objects across from server to client thru web server using web services. I have one question though regarding some complex objects. Assume I have a class like...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
11
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
11
by: Keith Hughitt | last post by:
Hi, I am having a little trouble figuring out how to convert a python datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a UTC date so that when I send it to...
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...
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)...
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.