jQuery in Action, 2nd edition*
The moose likes Web Services and the fly likes JAX-WS - WSDLS - Where are they? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS - WSDLS - Where are they?" Watch "JAX-WS - WSDLS - Where are they?" New topic
Author

JAX-WS - WSDLS - Where are they?

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Hi all,

I was doing a hello world application with JAX-WS from Martin Kalin's JWS - Up and running when I noticed that I had no wsdl in the project, yet it still works.
Do annotations like @Soapbind(Style=Style.RPC) replace the need for having a wsdl?


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 393
What does the book says about your question?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If you deploy an annotated web service endpoint implementation class to a server like, for instance, GlassFish, then the WSDL will be generated by GlassFish.
Actually, it is taken care of by the Metro web service stack, which also can be installed on Tomcat.
This approach in which the WSDL is generated is called a code-first approach. It has the drawback of risking changes to the WSDL in case the endpoint implementation class (etc) are changed, which may break the contract with clients using the earlier version of the WSDL.
The annotation used to tell the web service stack that a class is to be exposed as a web service is called @WebService.
The @SOAPBinding annotation specifies the following properties of a web service:
  • Messaging style
  • Encoding
  • Parameter style

  • Best wishes!


    My free books and tutorials: http://www.slideshare.net/krizsan
    Duran Harris
    Ranch Hand

    Joined: Nov 09, 2008
    Posts: 598

    Thanks for clearing that up for me!
    Duran Harris
    Ranch Hand

    Joined: Nov 09, 2008
    Posts: 598

    I see now that the WSDL being generated dynamically is POSSIBLY a result of using Endpoint.publish( which I guess is from Java SE 6 - Metro). I say possibly because I think I'm confused as to whether it's the standard java/wsdl mapping taking place or whether it's because I'm using Metro?

    Jignesh Patel
    Ranch Hand

    Joined: Nov 03, 2001
    Posts: 626

    Can we use wsdl with restful web services? I am always under the impression that RESTful web services works with HTTP Post only?
    Duran Harris
    Ranch Hand

    Joined: Nov 09, 2008
    Posts: 598

    I think so....I saw something about HTTP binding in WSDL for Rest...But I think Rest is using GET?
    Ivan Krizsan
    Ranch Hand

    Joined: Oct 04, 2006
    Posts: 2198
        
        1
    Hi!
    There is this article about using WSDL 2.0 to describe a RESTful web service:
    http://www.ibm.com/developerworks/webservices/library/ws-restwsdl/
    I have never seen this being used in real life.
    Best wishes!
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: JAX-WS - WSDLS - Where are they?
     
    Similar Threads
    JAX-RPC vs JAX-WS some differences
    JAX-RPC vs JAX-WS
    Username and password security for webservices using JAX WS
    where to put missing xsd? web-inf?
    How to learn WS*?