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 web sevice in jdevelolper using the existing Java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "create a web sevice in jdevelolper using the existing Java file " Watch "create a web sevice in jdevelolper using the existing Java file " New topic
Author

create a web sevice in jdevelolper using the existing Java file

tahir ahmed
Greenhorn

Joined: Dec 20, 2011
Posts: 7
I am pl/sql developer and new to java, I want to create a web sevice in jdevelolper using the existing Java file eg.accessfile.java.
I like to how to open the existing .java in jdeveloper and using with this file I want to create the web sevice.
I already create the webservice using this tutorial in the below link but there they create Java class and then create web service. But I want to use the exisitng java file
http://www.baigzeeshan.com/2010/11/creating-webservice-from-java-class-in.html
Please help me where to start.
Arun Kumar
Ranch Hand

Joined: Oct 10, 2007
Posts: 30
you could follow the same steps mentioned in the link/video (copy your java file content to the new file and create a web service out of it)
tahir ahmed
Greenhorn

Joined: Dec 20, 2011
Posts: 7
Thanks for the reply,
I can able to open and the exisitng Java and run succesfully. Again I stop when creating the web service in step 5 all the methods are disable and I can't proceed with out it it give me STATIC METHOD " method name" CANNOT BE PUBLISH IN WEB SERVICE if I remove the statiC in the java script then I can't able to compile and it's give me the error "Error(14,37): non-static method getPrintServices() cannot be referenced from a static context".
Please reply me how to solve this issue.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

I haven't gone through the video you are following, but for the latter issue you are facing use an instance of the class and call the method "getPrintServices()" on that instance. Would that help here?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
tahir ahmed
Greenhorn

Joined: Dec 20, 2011
Posts: 7
I was able to create the webservice and deployed into the webloigc server and successfully tested from the weblogic server. But when we call this webservice from the Oracle database using utl_http.
I am forwarding the WSDL file and the PL/SQL fucntion which calling the webservice in given below.
And how can I test this webservice from browser.
Please help me to resolve this.
Thanks in advance.

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

And how can I test this webservice from browser.


You can write a servlet (and related other components needed) to be invoked as necessary, so that it talks to your DB function eventually. You can have the servlet then send the response to the browser...
tahir ahmed
Greenhorn

Joined: Dec 20, 2011
Posts: 7
Thanks for the reply. As I new to java & web services can please send me any sample for that which is related to my service as I have short time to complete this.
Thanks in advance.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3859

Have a look at thid for a servlet example. And then you can call any other POJO bean method(s) form there which is responsible of handling procedure/function call to the DB. And then return any response as needed from the doGet() method itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create a web sevice in jdevelolper using the existing Java file