Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Calling Secure Webservice.

Former Member
0 Kudos

Hi Gurus,

I'm using a secured webservice in my webdynpro application. I'd also assigned

role to this webservice. My Portal is connected to LDAP, so when I call this

webservice through Webservice Navigator, it prompts me for username and

password, after supplying same it authenticate the user against LDAP.This is

working fine.

Now when I'call this webservice through my webdynpro application, it requires

username and password. I write follwing code:

Request_VI_RFP_CountriesDocument_displayCountries display = new

Request_VI_RFP_CountriesDocument_displayCountries();

wdContext.nodeRequest_VI_RFP_CountriesDocument_displayCountries().bind(display)

;

display._setUser("User");

display._setPassword("Password");

try {

wdContext.nodeRequest_VI_RFP_CountriesDocument_displayCountries().currentReques

t_VI_RFP_CountriesDocument_displayCountriesElement().modelObject().execute();

} catch (Exception e) {

e.printStackTrace();

}

It also works fine. Now my question is there any other method to call this

webservice without setting password in code( as one can easilly find it out)?

As this application is ultimately deployed on Portal, i have to follow Single

Sign On concept.

Plz help me out.

Thanks & Regards

Abhinav Sharma

1 ACCEPTED SOLUTION

WolfgangJanzen
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sounds like SAML would be the solution.

Can you provide some information on your Portal version (where the WebDynpro application is deployed which is submitting the WebService call)? Which system component is the WebService provider? Is it a NetWeaver Java or NetWeaver ABAP system? Which version?

Regards, Wolfgang

5 REPLIES 5

WolfgangJanzen
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sounds like SAML would be the solution.

Can you provide some information on your Portal version (where the WebDynpro application is deployed which is submitting the WebService call)? Which system component is the WebService provider? Is it a NetWeaver Java or NetWeaver ABAP system? Which version?

Regards, Wolfgang

0 Kudos

Hi Wolfgang

I'm using NWDS version 2.0.13 and Portal version SP13. It is Netweaver Java Stack..

What is SAML?

Regards, Abhinav

0 Kudos

Hi Abhinav,

no SAML won't help you.

Please have a look at the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/4bf969fb2a48908224679e83e9d805/frameset.htm">destination service</a>. You can use it to authenticate to the backend system and also make use of the SSO infrastructure. in addition, the credentials can be maintained after deployment.

BTW: if this is an OASIS (stnadard) webservice, you should also be able to use the WS proxies and infrastructure to do the same for you.

Kind regards,

Patrick

martijndeboer
Advisor
Advisor
0 Kudos

Hi,

With NW04 SP10 and later, the Web Dynpro Web Service model supports HTTP destinations. So you can create an HTTP destination in the Visual Administrator tool, and in you coding you must specify the name of the HTTP destination service. To use SSO, configure the destination to authentication method "Logon Ticket".

 
Request_QuickCarRentalServiceViDocument_saveBooking modObj =
wdContext.currentSaveBookingElement().modelObject();
modObj._setHTTPDestinationName("CarRental");      
modObj.execute();

Please refer to the tutorial at

http://help.sap.com/saphelp_erp2005vp/helpdata/en/e9/9a204142d6b167e10000000a155106/frameset.htm

When following the tutorial, please ensure you have a classloader reference from your WD application to service "tc/sec/wssec/service". This is done in the project properties of your WD application in the IDE.

Regards,

Martijn de Boer

Message was edited by:

Martijn de Boer

0 Kudos

Thanks Patrick and Martjin,

Let me check this first. I'll get back to you if it works.

Thanks again for your response.

Regards, Abhinav