You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Robert Mecklenburg <me...@realmsys.com> on 2004/05/06 16:17:12 UTC

Why use WSDL?

I'm new to axis and web services and I have a basic question.

Why bother with wsdl?

Here is a service:

public class Service
{
  public String doSomething(String name) throws RemoteException
  { ...
    return result;
  }
}


Here is a client:

public class Client
{
  public String add(String name) throws AxisFault
  {
    Call call = new Call(getServerURL() + "/Service");
    return (String) call.invoke("doSomething", new Object[] {name});
  }
}


What could be simpler?  When I started with axis I wrote interfaces,
then ran Java2WSDL, then generated client and server stubs with
WSDL2Java.  For a similar service I wound up with 7 classes and 200
lines of code -- all of which appears to be pointless.  I can do the
same thing with 0 extra classes and two lines of simple java if I
avoid the WSDL.


So I'm trying to figure out what I'm missing.  Obviously someone
thinks WSDL is worth all the extra obscurity, code bloat, and build
complexity.  Please tell me your reasons.


Thanks!
-- 
Robert