Skip to Content
In WebDynpro forums we can find many posts on …

“How to create secured webservices? “

“How to access secured services in webDynpro? “

“How can i get rid of hard coding user credentials in my webdynpro code “

So lets starts how can we do this using Netweaver Studio. We will take very simple example (i.e) creating a Calculator service

1. Creating secured WebService

1.1 Goto “J2EE Development perspective” , Create Enterprise Application Project with name “SimpleApp”

1.2 Select File->New-> create new EJB Module project .

1.3 Right click on the project select New -> EJB

1.4 Give EJB Name and select “stateless session bean” from Beantype.Enter the packageName and choose “Finish”

1.5 Open the Bean add a business method “add” which takes two integer parameters and return integer(sum of two numbers).

image

1.6 Right Click on the bean, select WebService and provide the details like WebService Name , EAR project etc

image


1.7 Open WebService Definitions and go to features Tab.Select Authentication from the list and choose “Basic (Username.password) radio button as shown below

image


1.8 Now Build the EJB Archive and add it to EAR Project

1.9 Select EAR project and Build application archive and deploy the .ear file.

2. Testing the webservice

2.1 Go to Window->ShowView->Other->WebServices-> select WebServiceNavigator

2.2 Expand the “servers->Local server” node in the WebServiceNavigator window. You should be able to see list of webservices deployed on to your WAS

2.3 Rightclick on the webservice and choose Open

image

2.4 Go to “Test” menu, you can see the methods exposed by the webservice

2.5 Click on the method and enter the two parameter values

image

2.6 In the next screen it will ask for the username and password

image

2.7 You can see the result/response once you submit the user details

I will be explaining about consuming this service in webDynpro in my next Blog

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Jan Stor
    Thank you Sir. Would you be able to recommend a general guideline to a Web based application (not bound to a specific product and/or technology platform), aimed at user authentication practices ? Something that is auditable…

    Thanks

    Jan

    (0) 
  2. Gopi Gopi
    Hi Anil,

         this blog doesn’t really help a person trying his hand for the first time. a more clear step by step would have helped.

    -Portal

    (0) 

Leave a Reply