Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create a web sevice in jdevelolper using the existing Java file

 
tahir ahmed
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
tahir ahmed
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic