Re: Returning Dataset or Datatable via Web Service

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Joseph Geretz" <jgeretz@xxxxxxxxxx> wrote in message
news:OcR0TV4VHHA.3652@xxxxxxxxxxxxxxxxxxxxxxx
Hi John,

Sorry, you're mistaken. .NET does not equate to RAD, esepecially not for
web services.

I (and some other developers on the team here) don't quite understand what
you are saying. When using Visual Studio 2005 for Web Service application
development, the IDE takes care of all the wire-up necessary in order to
connect the client with the Web Service. This includes creating the WSDL
on the server and creating the proxy class for the client which consumes
the WSDL and presents a strongly typed interface to the client. Seems
pretty RAD to us.

Microsoft has sold you a bicycle with training wheels on it. Those wheels
are not welded on. Take them off.

When Microsoft first introduced .NET, Web Services were a large part of the
marketing message. In order to encourage developers to jump onto the Web
Services bandwagon, Microsoft did a number of things which I believe were
not good ideas in the long run. They introduced a way to create a web
service that screen-scrapes HTML, for instance. This is a very bad way to
create an application, but makes perfect sense back in 2001, when it was a
useful way to get developers to start using .NET.

Similarly, they introduced the ability to "magically" create web services
simply by putting a [WebMethod] attribute on the public methods to be
exposed. "Look how easy it is!", they said.

But this is not a best practice, and it leads to many of the mistakes that
you and others are making. It is only because of the "magic" going on behind
the scenes that newcomers like yourself can actually ask about how to make
the client use the same class as the server. The question actually makes no
sense at all, but because you're using the training wheels, and thinking
that's how bicycles are made, you have the illusion that the two classes
should be the same and that there's simply some setting you need to change
to make them be the same.

I have similarly heard of a developer who, when he couldn't add a web
reference via http://somewhere/something.asmx?WSDL complained that the
service didn't work, and that there was a connectivity problem. There
wasn't. The "documentation" protocol was deliberately disabled. He thought
that "?WSDL" was some standard.

BTW, the client absolutely does _not_ get a strongly-typed interface! The
interface exposed by the server is interpreted by .NET to produce a WSDL
file which the client interprets to produce proxy classes unrelated to the
original classes. If you want strongly-typed, you should use .NET Remoting,
or WCF. The proxy classes are only a convenience.


What's wrong with defining your tabular data with a schema, without
relying on a DataSet?

There's nothing wrong with it, in general. However consider the context in
particular. The data is retrieved from the database in DataTable format.

That is an implementation detail. What happens when your implementation
changes?

At the (our) UI it's going to be bound to a data-bound widget (very
convenient, for us at least) in DataTable format.

Again, an implementation detail. Your widget will no doubt like you just as
well if you bind it to a custom object exposing strongly-typed properties.
Data binding is not unique to DataTables and DataSets.

Given that this is the case, I'm going to need a compelling reason to
persist this into a secondary XML format, and then to convert it back from
secondary XML format into a DataTable at the UI. And to do this again,
when modified data is sent back to the server. It'll cut down development
expense significantly to just leave this in its native format and to let
the Framework take care of everything for us.

Absolutely. And you will be tied to the framework. If that's part of your
requirement, then you're all set. Many people developing Web Services are
interested in at least the possibility that some client other than .NET will
use their service.

And, you may find some market resistance if you are asking partners to
parse through your XML.

But if we sent back a list of information (as opposed to scalar data item
or items) in XML format, that's exactly what the consumer would need to do
in order to process each row.

Absolutely not! Why would they need to do any parsing if you've given them a
schema? They'll no doubt do the same thing that you would do - run their
equivalent of XSD.EXE to produce classes from the schema! No parsing
(manual) required.

This is unavoidable for any service which returns a list or array of data.
So why would our own hand-coded XML list representation be more convenient
than the native DataSet XML representation? Tabular data representation is
tabular data representation. What's the difference whose XML format it is
encoded in?

Have you tried strongly-typed datasets? They're nice and RAD, but they at
least define the data via XML Schema. You get to benefit from RAD, your
customers benefit from a strong schema.

Excellent suggestion, I will look into this - thanks!

BTW, I presume you realize that you need to be careful when changing the
structure of the data you're returning?

Remember, you're talking to an ex-COM (hey, I like that term - you heard
it here first! ;-). Keeping an interface constant (or should I say
coMstant?) is second nature to guys like me!

That's what I thought. I'd just point out to you, that the namespace is
somewhat equivalent to the IID - if you change the interface, you need to
change the namespace.

At the end of the day, the vast majority of our Web Services are going to
be consumed by our own application. In this context, RAD development is of
benefit to us. We can always see our way going forward to provide
alternate service methods which could be consumed by eventual partners.
Even if our own in-house services aren't suitable, having the application
engineered on the Web Services platform is going to give us a tremendous
boost when it comes to providing services to even non-.NET clients.

Just keep in mind that the web services platform doesn't include the
training wheels. In fact, you'll find that the aftermarket assumes you've
taken the training wheels off!


John


.



Relevant Pages

  • Re: Returning Dataset or Datatable via Web Service
    ... Basically, what you see as 'training wheels' I (and others I am sure, as ... to make the client use the same class as the server. ... Web Services were a large part of ... from secondary XML format into a DataTable at the UI. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Php/Java justifcation please help
    ... It is a good solution for large scale apps if your developers know it. ... If you want to support a wide variety of mobile phones, ... should only access the main application's web services. ... Write your web site in a suitable language which your development ...
    (comp.lang.php)
  • [OT]: lower-cost tools that did much lower-quality work
    ... Crashes Deserve a Closer Look ... He compared C and C++ developers trying to ... a level of reliability sufficient to the intended task, ... Web services should enjoy no less. ...
    (comp.os.vms)
  • Re: [ANN] Oracle JDeveloper 10g production is now available for download.
    ... >> developers to join the Java camp. ... >> services, JavaBeans, Toplink and Oracle ADF Business components) ... >> you easily bind EJB, Web services, Javabeans, TopLink, or ADF Business ... Can you specify where in eclipse do you get any of the following? ...
    (comp.lang.java.softwaretools)
  • Re: [ANN] Oracle JDeveloper 10g production is now available for download.
    ... > developers to join the Java camp. ... However, experienced developers will ... > services, JavaBeans, Toplink and Oracle ADF Business components) ... > objects, and Web services. ...
    (comp.lang.java.softwaretools)