cancel
Showing results for 
Search instead for 
Did you mean: 

WebService from Web Dynpro

Former Member
0 Kudos

Hello,

Im a while for Web Dynpro but I`m new to Web Services.

So i`ve seen that Web Dynpro can consume Web Services via Model Creation Wizard.

But can I create a Web Service from my Web Dynpro too? That means that a special functionality of my Web Dynpro application could be offerd to other applications via Web Service?

best regards

Mathias

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Mathias, I would suggest better to move common logic to middle layer and change WD part to consume common logic from middle layer. Seems like it EJB-WS is good choice in this case.

Best regards, Maksim Rashchynski.

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Mathis,

what is a Web Service ?

A Web service is any piece of software that makes itself available over the Internet and uses a standardized XML messaging system. There should be some simple mechanism for interested parties to locate the service and locate its public interface. The most prominent directory of Web services is currently available via UDDI, or Universal Description, Discovery, and Integration.

Refer Chapter 8 of this doc http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

steps to create Web Service from EJB:

1. Create EJB Project(Stateless session bean is recommended).

2. Create interface according to your requirements and develop the business logic.

3. Signature(Parameters, data type) should be same in Remote,Bean and Local interface

4. Create EAR Project and corresponding add the EJB Project

5. Expose EJB as Web service. goto JAVA Perspective Right click on EJB Project->other->web services->web service(new VI and VSD).

6. Deploy to Application Server.

7. Goto http://localhost:50100/index.html. click on Web service navigator you can find web service

8. Test the web service.

From webdynpro you can generate model using web services

Let me know if want more details

Regards, Suresh KB

Answers (1)

Answers (1)

sridhar_k2
Active Contributor
0 Kudos

Hi,

You are true that you can consume web Service from Web Dynpro. But you cant create in Web Dynpro itself.

If you want to create Web Service from EJB's go thru with Suresh Explanation. You can create webservice from simple java program also. This is Simple.

From your NWDS - Java Perspective.

Create a Simple Java Project, with one method.. ex:- sayHello(String name){return "Hi.."+name;}

Go to WebService Perspective, Go to your Project - Class -> Right Click New -> Web Service -> Give Service name and select methods -> Finish.

Right Click on the Project -> Build Ear.

Deploy this .ear file.

Your Service is ready. It has been deployed on the Server.

Create WebService Model from Web Dynpro. For this you can go thru with this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/49/12eb82e057474994765faf83995ecb/frameset.htm

Regards,

Sridhar