Here are some reasons.
1) You might want compile-time type checking in your client code as opposed to using the dynamic invocation approach you show below.
2) You might want to invoke your web services from other programming languages that will require WSDL so that they can generate client proxies.
> -----Original Message-----
> From: Robert Mecklenburg [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 06, 2004 9:17 AM
> To: Axis Users
> Subject: 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
>
-------------------------------------------------------------------------------------
A.G. Edwards & Sons' outgoing and incoming e-mails are electronically
archived and subject to review and/or disclosure to someone other
than the recipient.
-------------------------------------------------------------------------------------
