cancel
Showing results for 
Search instead for 
Did you mean: 

how to create web service?

Former Member
0 Kudos

hai friends,

Iam new to NWDS ... Am using NWDS 2.0.9... How to create web service in this version and how to call the web service client using session bean... Can anybody help me...?

Thanks in advance...

Regards,

Hameem

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Hameem,

Do the following to expose an java application as web services.

ie to create an web service in NWDS

1) Go to NWDS -> open perspective ->j2ee -> select EJB Module Project ->create a project with name as u like

2) RC on ejb-jar.xml --> Select new --> EJB

3) Select Stateless session Bean

4) After that Expand ejb-jar.xml and then select the CalculateEJB and double click on this on method tab double click you will get business method where you create the methods for business logic here I take business methods like add with two parameters n1,n2 and so on (Here you can have any business logic as per your requirement)

5) Now Double click on CalculateEJB and then RC on bean tab and write required business logic in bean window as follows(based on requirement you will design a business logic

6) Rebuild your project

7)To delpoy this ejb application in EAR file you create Enterprise application project as

File -->Enterprise Application Project -->create a project (NameEAR)

8)Here you will have ear projects and then you select specific project required for your application.(here select CalculateEJB)

After that your EAR project will be available on j2ee explorer.

9) Right click on Calculate Bean here select New-->Web Service > give a name to webservice and select Default configuration type as simple SOAP .>click next --> Finish.

10)RC CalculateEJB --> Build EJB Archive RC on CalculateEAR -->Build application archive

11) After this you can tesst your web service in j2ee engine by clicking your web service.

12)There you will get an wsdl url which is needed in your Web Dynpro java application.

These steps will help you to use the webservice which you have created in web dynpro application

13) In NWDS create a regular Web Dynpro java application.

14) In model creation take web service model instead of adaptive RFC model, there it will ask you the wsdl url. You need to give this url to create model.

15) Finish your application by creating the view and mapping it with context.

I hope this will help you in creating a simple web application and exposing it as a web service and then using it in web dynpro application

Thanks

Sagar Ingalwar