File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Create a WebService (REST) using WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Create a WebService (REST) using WSDL" Watch "Create a WebService (REST) using WSDL" New topic
Author

Create a WebService (REST) using WSDL

Marcelo Tataje
Ranch Hand

Joined: Jan 31, 2011
Posts: 64

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

Joined: Nov 06, 2000
Posts: 1510
When you right click on the WSDL what options do you get? Do you see the "Web Services" option?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

WSDLs cannot define a restful interface. I think what you have is a WADL ? http://wikis.sun.com/display/Jersey/WADL


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Feb 24, 2006
Posts: 6661
    
    5

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

Joined: Jan 31, 2011
Posts: 64

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create a WebService (REST) using WSDL