Once the application has been configured, it will be deployed and tested in a Oracle Weblogic Server. We will execute the webservice through a web browser and check it by connecting to the database with a sqlplus console.
Step-by-step:
1) Create a generic java application and add the webservice component
2) Create a new java class and add some methods to publish. Here you have an example:
NOTE: Remember to adapt this code to your requirements.
public void InsertValue(String user, String value){
try{
//Example from http://studentsatoracle.blogspot.com
Connection con=null;
Class.forName("oracle.jdbc.driver.OracleDriver");
//Configure the jdbc connection: jdbc:oracle:thin:@host:port:SID,username,passwd
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:owcdb01", "DEV_WEBCENTER","welcome1");
Statement s = con.createStatement();
//Configure the SQL query as you want, the table must exists
s.execute("INSERT INTO DEV_WEBCENTER.uservalues (ID,USERNAME,INSERTDATE,VALUE) VALUES (DEV_WEBCENTER.uservalues_seq.nextval,'"+user+"',To_char(SYSDATE),"+value+")");
s.close();
con.close();
}catch(Exception e){
System.out.println("ERROR: "+e.getMessage());
}
}
3) Configure the webservice and publish the desired methods
4) Deploy the application. You can follow this guide to create a deployment profile: http://studentsatoracle.blogspot.com/2011/02/jdeveloper-how-to-deploy-application-to.html
5) Open a Weblogic Server console and test the application
Documentation:
Oracle's official documentation for jDeveloper 11g
Downloads:
Oracle jDeveloper 11g
Viewlet:
(Duration: 3 min.)
The post describes steps to create and deploy Java web services. The given steps are easy to understand and perform. You can view the detail in the video. You just need to follow the given steps. You are doing excellent work. Thanks.
ReplyDeleteCuando intento exponer el insert me dice null
ReplyDeleteThanks, very useful post
ReplyDeleteData not inserting into the table and I get the following XML...
ReplyDelete
ReplyDeletewe are the leading oracle fusion trainers in Hyderabad. we have our services online also.
ReplyDeletewe have globally recognized the platform is http://www.erptree.com where people come and
subscribe for various oracle related courses. we provide free instance access for our subscribers.
for more details please visit our site erptree.com thank you.
oracle fusion financials training
oracle fusion financials online training
oracle fusion Procurement training training
oracle fusion procurement online training
Thank you for sharing such a nice and interesting blog with us.
ReplyDeleteOracle Fusion Financials Online Training
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.
ReplyDeleteoracle fusion scm online training