XML & Web services: Why do a web service?
I have spent the last 3 weeks trying to learn about what is available for web services. What I have found is that they are not terribly portable (try to get C# to call a java based service) and they are tied in to the server they run on - ie, if you use Axis then you need the Axis jar files for your server to run and you can't put it on another server.
So, I am thinking it makes more sense to just have my server listen on a given port, use http protocol to accept requests that must be in a SOAP format, and respond to them. And then write small client apps in java and C# that talk to the server. This would be portable and a lot less hassle.
????? - dave
- Re: Why do a web service? by Trevor Brosnan on April 19 2004 14:56 EDT
- Why do a web service? a stupid Question. by Yu Fengdong on April 20 2004 10:48 EDT
In the recent past, interoperability has been a problem,but I think newer versions of AXIS are much better for .NET interop - although you probably need to take great care when passing complex types around. I guess that the technology and business demand was out-pacing the specifications - e.g. things like transactions and security were not specced out.
However, the WS-I has done a lot to address these problems - check out the Basic Profile 1.0 at http://www.ws-i.org/.
With the approach you are suggesting, you need to write a lot more code. I found the great thing about web services was that I could just define a proper business services layer over my application, and then to move it from say a Swing front-end to web services, I merely needed to use AXIS to generate all the required classes to expose it as a web service.
With the approach I think you are suggesting, you would need to write a huge amount of boilerplate code yourself - xml parsing, validation etc. The advantage of web services tools like AXIS is that they do all this work for you - so actually creating and deploying a web service is effectively done by a single script.
My situation is two-fold.
1) In my specific instance, I have a library we sell to others. So we can't say use Axis or use WebLogic. We have to run with what they have.
2) With the amount of time I have put in so far trying to get Axis to work using document/literal (I finally gave up on that as using Jave2WSDL to create the WSDL and then WSDL2Java to create the client and server code gave me programs that could not pass across 2 ints and return an int) will be less than if I just read in xml over a http port and use dom4j to parse it.
I understand the utility of web services and wsdl if you are putting out a service to allow lots of others to connect to it. Although, I'm not sure it's easier doing that than giving them client code for your own interface, it should at least be close.
But for the case where I have to write the client code regardless, there is a big advantage in not using something like Axis (no setup issues) and no real downside. Plus I think it will be faster.
Excuse me for my frank,this is a stupid question.
It's important for you to understand web service before you learn it.
How can you understand something before you learn it? You have to learn in order to understand.
And that said, why is it stupid? Most database (like Oracle and SQL Server) do exactly what I am proposing.
there is no such thing as a stupid question; only stupid answers.