• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create a WebService (REST) using WSDL

 
Marcelo Tataje
Ranch Hand
Posts: 64
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody, I'm here to ask for some help because I'm new to this. I have a WSDL File an schema files (.xsd), I'm using Rational Application Developer and WebSphere Application Server 7.0. I need to generate the web service to implement functionalities, I think the webservice is a RESTful type since the WSDL file contains the methods: CREATE, DELETE, GET and PUT with some policies.

I don't know how to start, I've already created a Dynamic Web Project and imported the required libraries from JAX-WS, but how can I generate? Please I will be really grateful if you could help me, thanks in advance.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you right click on the WSDL what options do you get? Do you see the "Web Services" option?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WSDLs cannot define a restful interface. I think what you have is a WADL ? http://wikis.sun.com/display/Jersey/WADL

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, WSDL 2.0 (2007) supposedly supports defining a RESTful interface. Personally I think the implementation in AXIS2 is a kludge.

I don't see a whole lot of WADL actually in use but maybe I'm not looking in the right place.

The big sites using REST seem to depend on text descriptions and sample code.

Bill
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Actually, WSDL 2.0 (2007) supposedly supports defining a RESTful interface. Personally I think the implementation in AXIS2 is a kludge.

I don't see a whole lot of WADL actually in use but maybe I'm not looking in the right place.

The big sites using REST seem to depend on text descriptions and sample code.

Bill


Thanks for the correction Bill. You are right. I assumed the OP was talking about WSDL 1.1

Marcelo,

You can go through REST description via WSDL for starters
 
Marcelo Tataje
Ranch Hand
Posts: 64
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everybody for your replies, I've finally deployed my WebService based on my WSDL, but I have a problem when I try to consume the WebService. I've just implemented "Create" method that receives an XML file as parameter and copies it to another directory. When I execute the client, at first, it seems to copy the file successfully in the folder, but when I execute it for the second time I'm getting this:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: java.lang.ClassCastException: org.w3._2009._02.ws_tra.Create incompatible with javax.xml.bind.JAXBElement
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:190)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:123)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:120)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:90)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:119)
at $Proxy27.create(Unknown Source)
at org.busdox.transport.start.client.AccessPointClient.send(AccessPointClient.java:176)
at org.busdox.transport.start.client.AccessPointClient.send(AccessPointClient.java:78)
at com.alfa1lab.sample.impl.transport.client.Main.testService(Main.java:139)
at com.alfa1lab.sample.impl.transport.client.Main.SendMessageToAccessPoint(Main.java:79)
at com.alfa1lab.sample.impl.transport.client.Main.main(Main.java:62)

I'm using RAD, WebSphere Application Server 7 and Web Features Pack 2.

Don't know the cause of why I'm getting that error

Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic