Axis question: what is the correct way to use Axis?

Discussion in 'Java' started by ed, Dec 8, 2006.

  1. ed

    ed Guest

    Hello,

    I am investigating creating webservices with axis.

    I notice that you can just create a bean as a jws file and it will
    generate the wsdl.... instant web services....

    Yet, I see that many people are running wsdl2java -First creating the
    WSDL to generate the java stubs BUT WHY would you do it this way as
    opposed to writing your java first, and then exposing it as a service?
    Seems very backward....

    Ed
    ed, Dec 8, 2006
    #1
    1. Advertising

  2. ed

    Lew Guest

    ed wrote:
    > Hello,
    >
    > I am investigating creating webservices with axis.
    >
    > I notice that you can just create a bean as a jws file and it will
    > generate the wsdl.... instant web services....
    >
    > Yet, I see that many people are running wsdl2java -First creating the
    > WSDL to generate the java stubs BUT WHY would you do it this way as
    > opposed to writing your java first, and then exposing it as a service?
    > Seems very backward....
    >
    > Ed


    Actually it's very forward. Starting from implementation to create
    specification is what's backwards.

    Trouble is, going Java -> WSDL ties you to the first implementation, and may
    not be easily interoperable with non-Java Web service clients.

    The WSDL is a specification for the Web service. Like an interface in Java, a
    WSDL document defines the contract for the service. It should come first as a
    concomitant to the design process.

    Also, one can tune the WSDL to accord with the whims of different popular
    environments, like .NET, which is most comfortable with certain conventions
    about SOAP element names and the use of "document-literal" specification
    rather than "RPC" modes. Then all possible expressions of the WSDL, be they
    C#, Perl, Java or whatever, can play nicely together.

    The tradeoff, as with just about all frameworks, is that the easy "wizard" way
    builds in assumptions about the implementation but is easy, whereas the
    trickier "developer" way gives more control at the expense of harder work.

    I recommend starting all Web service implementation with a good WSDL, then
    writing servers and clients to match, over generation of the WSDL by automatic
    means from an implementation.

    - Lew
    Lew, Dec 8, 2006
    #2
    1. Advertising

  3. Lew wrote:
    > ed wrote:
    >> Hello,
    >>
    >> I am investigating creating webservices with axis.
    >>
    >> I notice that you can just create a bean as a jws file and it will
    >> generate the wsdl.... instant web services....
    >>
    >> Yet, I see that many people are running wsdl2java -First creating the
    >> WSDL to generate the java stubs BUT WHY would you do it this way as
    >> opposed to writing your java first, and then exposing it as a
    >> service? Seems very backward....
    >>
    >> Ed

    >
    > Actually it's very forward. Starting from implementation to create
    > specification is what's backwards.
    >
    > Trouble is, going Java -> WSDL ties you to the first implementation,
    > and may not be easily interoperable with non-Java Web service clients.
    >
    > The WSDL is a specification for the Web service. Like an interface in
    > Java, a WSDL document defines the contract for the service. It should
    > come first as a concomitant to the design process.
    >
    > Also, one can tune the WSDL to accord with the whims of different
    > popular environments, like .NET, which is most comfortable with
    > certain conventions about SOAP element names and the use of
    > "document-literal" specification rather than "RPC" modes. Then all
    > possible expressions of the WSDL, be they C#, Perl, Java or whatever,
    > can play nicely together.


    Also, if someday you're going to create rev. 2 of the service without
    breaking compatibility with the rev 1. clients, the XMLSchema in the WSDL
    makes it clear how to do this compatibly (add optional elements and
    attributes to existing types, create derived types using substitution
    groups, etc.), while trying to modify Java in a way that produces compatible
    WSDL is nearly hopeless.
    Mike Schilling, Dec 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. joon
    Replies:
    1
    Views:
    504
    Roedy Green
    Jul 8, 2003
  2. Replies:
    0
    Views:
    873
  3. Dan

    correct or not correct?

    Dan, Oct 2, 2003, in forum: HTML
    Replies:
    7
    Views:
    424
  4. J.Ram
    Replies:
    7
    Views:
    635
  5. froil
    Replies:
    12
    Views:
    297
    Gunnar Hjalmarsson
    Mar 2, 2006
Loading...

Share This Page