cancel
Showing results for 
Search instead for 
Did you mean: 

Authentication while consuming a BAPI exposed as a web service

Former Member
0 Kudos

Hi all,

This is the scenario - I am consuming a web service in my web dynpro application. The web service is nothing but a BAPI which is exposed as WS.

My query - how do I achieve authentication from the web dynpro application to the web service using SAP Logon ticket?

In NWDS, after I import the Web service and create a WS model, there's a node called 'Logical Ports'. In that node, I've set the authentication type in the security tab as 'Use SAP Logon Ticket'. But that doesn't work.Is there any other configuration to be made?

Also, immaterial of the type of authentication I specify(even if I specify 'no authentication'), only if I set the userid & password for accessing the backend in my code, does my application work!! Otherwise, it throws an authorization error!!

I'm struck with this issue for quite sometime. Have gone through help.sap links and also SAP docs. Most of the docs deal with either security for an RFC model or for a Web service project(EJB). I am not able to find a solution for my case.

Can somebody help me solve this?

Points assured.

Thanks & regards,

M.Subathra

Accepted Solutions (1)

Accepted Solutions (1)

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

the authentication for the webservices could be set through ABAP.

In ABAP go to SICF tcode, find your web service over there,

double clicking it , will open the windo where u can set the logon procedure , security requirement etc.

hope it helps,

regards,

Abhijeet

Former Member
0 Kudos

Hi Abhijeet,

Thanks for that answer. Can you please tell me where to navigate to change the logon procedure of the web service?

Thanks & regards,

M.Subathra

abhijeet_mukkawar
Active Contributor
0 Kudos

go to the tcode SICF, navigate as follows,

default host->sap->bc->srt->rfc->sap

here you will find your web services , double click on the relevant ws and set the security or logon or basic authentication procedure over there...

hope it helps

regards,

abhijeet.

Former Member
0 Kudos

Thanks Abhijeet.. But I was not able to find the web service there!!

I need to find the standard web services.(standard BAPIs exposed as web services).

Am using ECC6.0.

Regards,

M.Subathra

Message was edited by:

M Subathra

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

if you kno the web service name or have abstract idea about its name, then go to tcode WSCONFIG, search your web service over there through value help.

There it will give you the Access Address of your ws. Then access that using the path given (in WSCONFIG) from SICF tcode and then double click ws to set the security requirement.

hope it helps .

Regards,

Abhijeet

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Have a look at the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9bdcb279-0e01-0010-b5ac-ef7f99e44c68">following document</a> (or <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webservices/authentication%20of%20a%20ws%20client%20using%20a%20sap%20logon%20ticket.pdf">this one</a>).

I hope it answers some of your questions.

Kind regards, Jack

Former Member
0 Kudos

Hi Jack.. Thanks for those links.. But unfortunately, I already have them & have gone through!! Couldn figure out a solution from them.

Thanks & regards,

M.Subathra

Former Member
0 Kudos

Hi,

Check the web log

/people/anilkumar.vippagunta2/blog/2006/11/20/secured-webservices--i

Here i feel you need to select Autherization as "Strong" and read the following also

http://help.sap.com/saphelp_nw2004s/helpdata/en/2b/07074155bcf26fe10000000a1550b0/frameset.htm

Regards,ANilkumar

Former Member
0 Kudos

Hi all,

Solved the problem. I had to create a HTTP destination in Visual Admin and set the destination in my webdynpro implementation.

Then,I had to add a service reference tcsecwssec~service in the webdynpro project.

Regards,

M.Subathra

Former Member
0 Kudos

Hai,

You can Pass Authorizations to web service model before executing

wdContext.currentRequestXXX.modelObject()._setUserName();

wdContext.currentRequestXXX.modelObject()._setPassword();

wdContext.currentRequestXXX.modelObject().excecute();

Regards,

Former Member
0 Kudos

Hi Naga Raju,

Kindly go through my post carefully. I do not want to pass the username/password. Instead I need to use Logon ticket.

Regards,

M.Subathra