473,757 Members | 9,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Serializable Objects

Has anyone come up with a slick way to make Custom Serializable Objects to
behave like DataSets when using WebServices? What I'm looking for is some
way to force the WSDL generated code to create a reference to my custom
object's namespace instead of creating it's own copy of the object in it's
own WS namespace. Either that, or some easy way to move all of the
properties from the Custom Serializable Object into the WSDL generated
object via a clone operation or something of this nature, that executes
fast. The idea is to have a common assembly with all the custom objects in
it which can be used on both the client and WS sides, since from an
architectural standpoint the UI should be separated from the Business Logic
and separated from the Data Access. Any ideas?
Aug 30 '06 #1
8 1822
"Techno_Dex " <no**********@o si-corp.comwrote in message
news:eV******** ******@TK2MSFTN GP02.phx.gbl...
Has anyone come up with a slick way to make Custom Serializable Objects to
behave like DataSets when using WebServices? What I'm looking for is some
way to force the WSDL generated code to create a reference to my custom
object's namespace instead of creating it's own copy of the object in it's
own WS namespace. Either that, or some easy way to move all of the
properties from the Custom Serializable Object into the WSDL generated
object via a clone operation or something of this nature, that executes
fast. The idea is to have a common assembly with all the custom objects
in it which can be used on both the client and WS sides, since from an
architectural standpoint the UI should be separated from the Business
Logic and separated from the Data Access. Any ideas?
Your client and server are both .NET, and you _want_ to share types between
them, right? Is there a reason you haven't considered using .NET Remoting?
It's really quite simple to get started with it.

John

P.S. Web Services is all about XML; it's not about objects. There will be
valid Web Service messages which cannot be deserialized into objects in some
given programming language, and objects which cannot be trivially serialized
into XML. There's an "impedance mismatch" there. If you want the impedance
to match, use Remoting.
Aug 31 '06 #2
I'm looking for a WebService solution. We have looked into Remoting but it
won't meet the long term needs and goals. Not to mension the fact the WCF
is aimed in the Webservice direction. The functionality in question is
being used across a WAN with all probability of opening it up to 3rd party
vendors to access also. The objects that I am passing are XML Serializable
but they can handle/contain complex structures (i.e nesting and collection
type structures of other XML Serializable objects). The whole idea behind
WS is to serialize data and pass it across the wire to be deserialized on
the other end. My question is pertaining to the fact that when I create my
custom XML Serializable object to either pass into a WS as a Param or return
from a WS, the WSDL generated code create's it own version of the object
instead of using the schema that I have specified. Say I have created a
custom object "Acme.BizObject s.Contract oContract". When I call the WS, I
want to be able to make the call "oWS.AddContrac t(oContract)" instead of
making the call "oWS.AddContrac t(oWSContract)" where oWSContract is of type
Acme.BizObjects .WS.Contract created by WSDL. When you pass a DataSet back
and forth the WSDL doesn't create an WS.DataSet object, it uses the actual
DataSet defined in the System.Data namespace.
"John Saunders" <john.saunder s at trizetto.comwro te in message
news:uo******** ******@TK2MSFTN GP03.phx.gbl...
"Techno_Dex " <no**********@o si-corp.comwrote in message
news:eV******** ******@TK2MSFTN GP02.phx.gbl...
>Has anyone come up with a slick way to make Custom Serializable Objects
to behave like DataSets when using WebServices? What I'm looking for is
some way to force the WSDL generated code to create a reference to my
custom object's namespace instead of creating it's own copy of the object
in it's own WS namespace. Either that, or some easy way to move all of
the properties from the Custom Serializable Object into the WSDL
generated object via a clone operation or something of this nature, that
executes fast. The idea is to have a common assembly with all the custom
objects in it which can be used on both the client and WS sides, since
from an architectural standpoint the UI should be separated from the
Business Logic and separated from the Data Access. Any ideas?

Your client and server are both .NET, and you _want_ to share types
between them, right? Is there a reason you haven't considered using .NET
Remoting? It's really quite simple to get started with it.

John

P.S. Web Services is all about XML; it's not about objects. There will be
valid Web Service messages which cannot be deserialized into objects in
some given programming language, and objects which cannot be trivially
serialized into XML. There's an "impedance mismatch" there. If you want
the impedance to match, use Remoting.


Aug 31 '06 #3
(Comments inline)

"Techno_Dex " <no**********@o si-corp.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
I'm looking for a WebService solution. We have looked into Remoting but
it won't meet the long term needs and goals. Not to mension the fact the
WCF is aimed in the Webservice direction. The functionality in question
is being used across a WAN with all probability of opening it up to 3rd
party vendors to access also.
Will these 3rd party vendors all be using .NET?
The objects that I am passing are XML Serializable but they can
handle/contain complex structures (i.e nesting and collection type
structures of other XML Serializable objects). The whole idea behind WS
is to serialize data and pass it across the wire to be deserialized on the
other end.
I strongly disagree with that statement. Web Services is about communicating
over the Internet using XML, in order to abstract away the particulars of
the type and object systems of any particular platform. The idea is that it
should be possible for your client to be written in C#, or Perl, or
something not yet invented.

You seem to want to use web services, but to tie it to the .NET platform.
Oh, and BTW, have you considered the versioning issues if you're going to
share the same assemblies between your clients and server?
My question is pertaining to the fact that when I create my custom XML
Serializable object to either pass into a WS as a Param or return from a
WS, the WSDL generated code create's it own version of the object instead
of using the schema that I have specified. Say I have created a custom
object "Acme.BizObject s.Contract oContract". When I call the WS, I want
to be able to make the call "oWS.AddContrac t(oContract)" instead of making
the call "oWS.AddContrac t(oWSContract)" where oWSContract is of type
Acme.BizObjects .WS.Contract created by WSDL.

See, that's where you're mistaken about this. Acme.BizObjects .Contract is a
type that you've created. You want .NET to look at your WSDL (which I hope
you created by hand, and didn't rely on .NET to create), and to produce the
same exact type. That's not going to happen, except by luck. If you want to
use the same type, you need to be using Remoting.

Even there, the suggestion is to use interfaces to define the contract
between the client and server, and to expose the interface to your
customers, and not the type implementing the interface. This is effectively
what you're doing with Web Services, though the WSDL is then the contract.

..NET Remoting works well for using an interface as the contract. And, I've
probably already mentioned to you that .NET Remoting can use SOAP over HTTP.

John
Aug 31 '06 #4
I think you are taking my comments too literally. The idea behind creating
my own custom objects which are for all intensive purposes an Interface
which adheres to a particular XML schema (xsd) is completely independent of
the underlying framework. As long as the object that the user sends in to
the WS matches up to the XML schema called Contract, it doesn't matter if
they use Java, perl, etc... It's all about the XML structure of the object.
As for creating the WSDL file by hand, that is just crazy talk, esp with the
IDE so happy to auto generate and overwrite any custom code you have written
every time you go to build in the IDE. There has got to be a way for WSDL
to automatically create the same custom object for the simple fact that they
do for DataSets. As for the remoting, I know what remoting is capable of
I've already written multiple pieces of code in remoting. Remoting is not
part of the scope of this project, it's Webservices just like in the name of
the newsgroup.

"John Saunders" <john.saunder s at trizetto.comwro te in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
(Comments inline)

"Techno_Dex " <no**********@o si-corp.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>I'm looking for a WebService solution. We have looked into Remoting but
it won't meet the long term needs and goals. Not to mension the fact the
WCF is aimed in the Webservice direction. The functionality in question
is being used across a WAN with all probability of opening it up to 3rd
party vendors to access also.

Will these 3rd party vendors all be using .NET?
>The objects that I am passing are XML Serializable but they can
handle/contain complex structures (i.e nesting and collection type
structures of other XML Serializable objects). The whole idea behind WS
is to serialize data and pass it across the wire to be deserialized on
the other end.

I strongly disagree with that statement. Web Services is about
communicating over the Internet using XML, in order to abstract away the
particulars of the type and object systems of any particular platform. The
idea is that it should be possible for your client to be written in C#, or
Perl, or something not yet invented.

You seem to want to use web services, but to tie it to the .NET platform.
Oh, and BTW, have you considered the versioning issues if you're going to
share the same assemblies between your clients and server?
> My question is pertaining to the fact that when I create my custom XML
Serializable object to either pass into a WS as a Param or return from a
WS, the WSDL generated code create's it own version of the object instead
of using the schema that I have specified. Say I have created a custom
object "Acme.BizObject s.Contract oContract". When I call the WS, I want
to be able to make the call "oWS.AddContrac t(oContract)" instead of
making the call "oWS.AddContrac t(oWSContract)" where oWSContract is of
type Acme.BizObjects .WS.Contract created by WSDL.


See, that's where you're mistaken about this. Acme.BizObjects .Contract is
a type that you've created. You want .NET to look at your WSDL (which I
hope you created by hand, and didn't rely on .NET to create), and to
produce the same exact type. That's not going to happen, except by luck.
If you want to use the same type, you need to be using Remoting.

Even there, the suggestion is to use interfaces to define the contract
between the client and server, and to expose the interface to your
customers, and not the type implementing the interface. This is
effectively what you're doing with Web Services, though the WSDL is then
the contract.

.NET Remoting works well for using an interface as the contract. And, I've
probably already mentioned to you that .NET Remoting can use SOAP over
HTTP.

John


Aug 31 '06 #5
"Techno_Dex " <no**********@o si-corp.comwrote in message
news:eZ******** ******@TK2MSFTN GP03.phx.gbl...
>I think you are taking my comments too literally. The idea behind creating
my own custom objects which are for all intensive purposes an Interface
which adheres to a particular XML schema (xsd) is completely independent of
the underlying framework. As long as the object that the user sends in to
the WS matches up to the XML schema called Contract, it doesn't matter if
they use Java, perl, etc... It's all about the XML structure of the object.
Then, I'm confused about why you're interested in duplicating what .NET does
with DataSet objects. What do you expect Perl to do with a DataSet? That's
what you should expect _any_ client to do with the DataSet, including .NET
clients.
As for creating the WSDL file by hand, that is just crazy talk, esp with
the IDE so happy to auto generate and overwrite any custom code you have
written every time you go to build in the IDE.
It's not crazy talk, it's the way I just wrote the web service I'm working
on. No overwriting of code, or any other such nonsense. Inherit from the
classes generated by WSDL.EXE, don't modify them. It allows you to be in
control of the WSDL.

John


Aug 31 '06 #6
When creating a reference to a WS in a project, the reference is created,
the *.disco, *.wsdl and Reference.map/Reference.cs class is created. In the
Reference.cs class, the a DataSet is passed into a WebMethod, a
System.Data.Dat aSet reference is added to this class as it is a known
predefined type and has an xsd of it's structure. If I have a custom object
call Contract that is passed into a WebMethod, I want the IDE when creating
the References.cs class to recognize this structure by the XSD defined in
the custom object Contract and create the reference of that type in the
class instead of creating a brand new class in the References.cs class and
giving it a brand new namespace. The reason I want this functionality is
because in the BussinessLayer behind the ClientUI, I want to be able to
reference this common Contracts object/structure in order to create an
instance of the object using the info from the ClientUI layer, then pass
this object to the ClientDataAcces s Layer which can then pass the info along
to the Webservice. The BusinessLayer should not be required to know what
format the ClientDataAcces sLayer is using to communicate with WebService
because that defeats the purpose of separating out the layers. And
currently there doesn't appear to be a good way to translate the
Common.Contract s object to the WS.Contracts object in the
ClientDataAcces sLayer, except to transform it by hand. In the case of a
DataSet, the dataset can be passed directly from the BussinessLayer to the
ClientDataAcces sLayer to the WebService without any transformation. This is
what I am looking for.

"John Saunders" <john.saunder s at trizetto.comwro te in message
news:eT******** ******@TK2MSFTN GP04.phx.gbl...
"Techno_Dex " <no**********@o si-corp.comwrote in message
news:eZ******** ******@TK2MSFTN GP03.phx.gbl...
>>I think you are taking my comments too literally. The idea behind
creating my own custom objects which are for all intensive purposes an
Interface which adheres to a particular XML schema (xsd) is completely
independent of the underlying framework. As long as the object that the
user sends in to the WS matches up to the XML schema called Contract, it
doesn't matter if they use Java, perl, etc... It's all about the XML
structure of the object.

Then, I'm confused about why you're interested in duplicating what .NET
does with DataSet objects. What do you expect Perl to do with a DataSet?
That's what you should expect _any_ client to do with the DataSet,
including .NET clients.
>As for creating the WSDL file by hand, that is just crazy talk, esp with
the IDE so happy to auto generate and overwrite any custom code you have
written every time you go to build in the IDE.

It's not crazy talk, it's the way I just wrote the web service I'm working
on. No overwriting of code, or any other such nonsense. Inherit from the
classes generated by WSDL.EXE, don't modify them. It allows you to be in
control of the WSDL.

John


Sep 1 '06 #7
I'm also dealing with this issue, as I'm being forced to consume web services
to interface with a Locally available Database, because of corporate IT
policy (Inadequate understanding of what Web Services are about, imho)

I would much rather, (in my solution space) be dealing with a .Net remoting
server, using a shared assembly containing well-defined data transfer types.

However, things being as they are, I am creating my own business classes on
the client side of the web service, but instead of coding them as wrappers or
adaptors, around the web service proxy generated types, I have coded them as
stand alone types with constructors that take the web service generated types
as constrctor input parameters.

It bothers me though, to have to be creating an entire business type
structure downstream of the web service - The issues of using a web service
(instead of remoting) are causing me to have build an entire layer of code on
the client (perhaps in each client that consumes the web service) - that in
a remoting solution would only need to be created once, in the business
layer, upstream of the remoting interface.
--
Charles Bretana Jr.
Arete Industries Inc.
"John Saunders" wrote:
"Techno_Dex " <no**********@o si-corp.comwrote in message
news:eZ******** ******@TK2MSFTN GP03.phx.gbl...
I think you are taking my comments too literally. The idea behind creating
my own custom objects which are for all intensive purposes an Interface
which adheres to a particular XML schema (xsd) is completely independent of
the underlying framework. As long as the object that the user sends in to
the WS matches up to the XML schema called Contract, it doesn't matter if
they use Java, perl, etc... It's all about the XML structure of the object.

Then, I'm confused about why you're interested in duplicating what .NET does
with DataSet objects. What do you expect Perl to do with a DataSet? That's
what you should expect _any_ client to do with the DataSet, including .NET
clients.
As for creating the WSDL file by hand, that is just crazy talk, esp with
the IDE so happy to auto generate and overwrite any custom code you have
written every time you go to build in the IDE.

It's not crazy talk, it's the way I just wrote the web service I'm working
on. No overwriting of code, or any other such nonsense. Inherit from the
classes generated by WSDL.EXE, don't modify them. It allows you to be in
control of the WSDL.

John


Sep 15 '06 #8
"CBretana" <cb******@arete IndNOSPAM.comwr ote in message
news:3A******** *************** ***********@mic rosoft.com...
I'm also dealing with this issue, as I'm being forced to consume web
services
to interface with a Locally available Database, because of corporate IT
policy (Inadequate understanding of what Web Services are about, imho)

I would much rather, (in my solution space) be dealing with a .Net
remoting
server, using a shared assembly containing well-defined data transfer
types.

However, things being as they are, I am creating my own business classes
on
the client side of the web service, but instead of coding them as wrappers
or
adaptors, around the web service proxy generated types, I have coded them
as
stand alone types with constructors that take the web service generated
types
as constrctor input parameters.

It bothers me though, to have to be creating an entire business type
structure downstream of the web service - The issues of using a web
service
(instead of remoting) are causing me to have build an entire layer of code
on
the client (perhaps in each client that consumes the web service) - that
in
a remoting solution would only need to be created once, in the business
layer, upstream of the remoting interface.
Thank you for an excellent description of why certain members of upper
management should keep their noses out of implementation decisions.

John
Sep 16 '06 #9

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

Similar topics

0
1899
by: Thomas D. | last post by:
Situation: --------------------------- I have an 'export'-wrapper to my regular objects. For each regular object there is also an export object. An export object derives from the regular object and has for each property in the base object an extra boolean property. That extra properties tells wether to include the base property in the final export (= webservice) or not. That is because not all the properties may be exposed all the time...
7
4754
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException and is defined in an assembly common to the client and server components. The custom class merely defines three (3) constructors -- the null constructor; one with a string parameter; and one with a string and innner exception parameter -- that...
6
2226
by: Shimon Sim | last post by:
Hi I am working on application that need to hold custom user information - Last and first name, email, some other domain related information. I used to create Base class for all my pages. The base class would have CurrentUser property that would hold customer class in session and that was fine for all my situations. Now ASP.NET 2.0 came and we have Profile property for pages that could be extended with configuration to have custom...
2
2446
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
1
1591
by: leodippolito | last post by:
Dear sirs, I am using custom wrappers to primitive types in my classes, so I can have some flags when working with the database ("undefined" and "null") .. So instead of: public class User
8
2020
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object like so: <Teachers> <Teacher> <Classes> <Class>
0
1836
by: a | last post by:
I need to create an instance of a custom object 'School.Teacher' and use it in a Profile object. I'm developing a bad case of "Pretzel Logic" thinking about this. Filling the custom object 'School.Teacher' as an ArrayList creates the proper information (see aspx code below), but I'm unable to use this ArrayList in the Profile object. The aspx code below shows the attempt and error message.
11
10149
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have seen erratic results. I am aware of one known defect where user classes do not show up in the list of types on the Property/Settings page in the visual designer and I am wondering if I am encountering some other peculiar issue, or if there are...
0
1876
by: jpogorman | last post by:
Hello, I am trying to get c# custom marshaling working in a particular scenario but it does not appear to be working or not jumping into my marshaling class when I try to debug it. I am try to implement a performance improvement in the transfer of thousands of objects (ClientInfoDescriptor) over a remote call. The objects all have a model object (IDataDrivenModel) to describe them but there may only two or three model objects in total. These...
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9737
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.