Re: Converting objects thru Web Services or Disconnected

From: Jeffrey Hasan (anonymous_at_noemail.com)
Date: 08/03/04


Date: Tue, 3 Aug 2004 00:20:31 -0700

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:e2I$i5EeEHA.1652@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
>
>



Relevant Pages

  • Re: Converting objects thru Web Services or Disconnected
    ... which is to have both the Web service and the client reference ... > two separate data types that can cast to eachother. ... >> this on the local machine and the webserver. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: httpd in /tmp - Sound advice sought
    ... also check your webserver for world writeable directories, ... > pointer without a cast ... Slapper exploits vulnerabilities in OpenSSL up ...
    (freebsd-questions)
  • Re: FTP and Web Service stop by itself
    ... What do you run on your webserver - static HTM, ASP pages, COM ... WEB service stopping ... >Publishing Service, and FTP Publishing Service? ... >© 2002 Microsoft Corporation. ...
    (microsoft.public.inetserver.iis.security)
  • WSE464: No policy could be found for this message.
    ... This is an app and web service that have been working together with WSE2 for ... from numerous computers. ... hitting the same webserver, I did not have the problem. ... What type of event would cause this to disappear and then reappear. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: FTP and Web Service stop by itself
    ... What do you run on your webserver - ... >>Publishing Service, and FTP Publishing Service? ... FTP and Web Service stop by itself ...
    (microsoft.public.inetserver.iis.security)