|
Blogs
This blog will explain how to use existing Java System services in SAP System. One of the solutions is to make the Java function as Web Service and consume in SAP System. Here we have shown simple steps to develop Web-Service in J2EE using NWDS Tool, Testing the Web Service and will show in the next blog how to consume this web Service in SAP NetWeaver Visual Composer.
Prerequisites: • SAP NetWeaver Developer Studio 7.0. • SAP J2EE Engine. • SAP NetWeaver Visual Composer 7.0.
Implementation: Launch NWDS and create new EJB Module Project.
![]() ![]() Give the EJB Name, EJB Project, Bean Type as StatelessSessionBean, package name. We get the required Home, Remote Interfaces and Bean Classes, Click finish. Here we are going to create two Business logic methods.
![]() After creating Business Methods, finish the EJB creation. We can see the created EJB Module Project hierarchy as follows. ![]() Go to the source code of BusinessBean.java class and implement the business logic like below, finally we are making these business logic methods as Web Services. public String concatinationOfStrings(String fString, String sString) { return fString.concat(sString);}public String conCatinationsOfStrings( String fString, String sString, String tString) { return fString.concat(sString).concat(tString);}We need to create Enterprise Application Project to make EAR file to deploy on WAS. ![]() Give the name of the Enterprise Application Project and select the created EJB Module Project, Finish. We can see the Enterprise Application Project hierarchy. Process of Making Web Service….. Go to created EJB Module Project and Make the Business Methods as Web Services. ![]() ![]() ![]() ![]() Select the Enterprise Application Project and click OK After creating Web Services Build the EJB Module Project. ![]() If the build is successful we get the successful message. Add the EJB Module Project to EAR Project. ![]() Build the Enterprise Application Project ![]() Deploy the EAR file to the WAS Server. ![]() Deployment is finished. To Capture WSDL file and to test Web Service, go to the following URL http://<Host>:<Port>/wsnavigator Go to Your Web Service and get the URL of WSDL file for the usage of consuming. To test the deployed Web Service, select the service and click Test. ![]() ![]() Web Service is working fine on WAS. Now we can consume the Web Service in SAP NetWeaver Visual Composer, ref blog 2. lakshmi Prasad Lakshmi Prasad SAP Net Weaver EP consultant and SCJP certified java professional. Add to: del.icio.us | Digg | Reddit
| |||||||||||||||||||||