cancel
Showing results for 
Search instead for 
Did you mean: 

how to create web service

Former Member
0 Kudos

hai friends,

Iam new to soa.. I wanna to ceate a simple web service... Now am using NWDS 2.0.9... which version of NWDS will be the best one for creating web service... Please help me...

regards,

Krish

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Krish,

NWDS 2.0.9 means (is part of) NetWeaver 2004 SP9. This is quite old (a couple of years) actually, but it does support WS development, though not according to the Java EE / J2EE standards (NetWeaver 2004 is J2EE 1.3 compatible and WS were added to the J2EE platform in J2EE 1.4).

On the other hand, [NetWeaver CE 7.1|https://www.sdn.sap.com/irj/sdn/nw-ce-downloads] is Java EE 5 compatible and allows you to use the latest WS standards in the Java EE platform. For more information:

- [Creating and Configuring Web Services and Web Service Clients|http://help.sap.com/saphelp_nwce10/helpdata/en/45/11b4961ea304a8e10000000a155369/frameset.htm]

- [Supported Specifications|http://help.sap.com/saphelp_nwce10/helpdata/en/46/b1401bf96c41d5e10000000a1553f7/frameset.htm]

HTH!

-- Vladimir

P.S.: Please take a minute to get familiar with the [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] and close or update your open threads.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi krish,

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