facebook

Generating a WSDL for REST Web Service

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #311086 Reply

    avishaic
    Member

    I just went through the tutorial “Developing REST Web Services Tutorial” and it worked fine but now I’d like to create a WSDL for the service so I can share the REST web service with other developers. How do I do that? Is it done digfferently with REST services?

    #311094 Reply

    Brian Fernandes
    Moderator

    avishaic,
    WSDL files exist only for SOAP web services, not for REST based services. REST services have a WADL file which you can see referenced in section 5 of the tutorial.

    When you say “share the web service” with developers, what do you mean – do you want them to be able to recreate the service or use the service?

    For the former, we don’t have a wizard that will create the service from a WADL file, for the latter, you can share the WADL file which they can use to test the service in the rest explorer (you will need to modify the addresses in the WADL file to point to the real location of the service).

    There is no standard for the consumption of web services, you can choose whatever technique you wish to access the URLs and parse the returned data. Please see this page: http://www.myeclipseide.com/module-htmlpages-display-pid-379.html under the “Web Services and SOA: Beyond the Hype” section for a few example projects.

    Hope this helps.

    #311098 Reply

    avishaic
    Member

    Brian thanks for the quick response.
    Where do I find the WADLfile for the customers example in the tutorial? Or how do I generate it?
    In the tutorial the WADL is only referenced in context of the proffesional version I have the standard version

    A.

    #311099 Reply

    Brian Fernandes
    Moderator

    Avishaic,

    The WADL file is automatically generated by the REST runtime (Jersey). You can access it at http://localhost:port/<appname>/services/application.wadl (where “services” is the default, unless you changed the servlet-mapping value in web.xml)

    To clarify, the REST explorer testing application is a PRO only feature, but the wadl file is generated by the framework and available to all.

    #311100 Reply

    avishaic
    Member

    Thanks – That WADL solved the problem.
    A.

    #311127 Reply

    avishaic
    Member

    Another quick question about the tutorial – the customer has 3 properties ID,Name, Address – how would I add another attribute like phone number where the customer may have 1 or few numbers? Do I add an array?
    Secons question is how do I write a REST service that returns all the customer that their name is John Smith (or any other search function)?
    Thanks
    A.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Generating a WSDL for REST Web Service

You must be logged in to post in the forum log in