Application Development and Automation 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: 
Read only

authentication with HTTP_POST

Former Member
0 Likes
1,065

I want to call a web services from Sap 4.7 in a server in my intranet. I can call it when the target server haven't security administration. But when the security is activated the the funcion HTTP_POST returns the error 401.

I send in the funcion the parameters USER and PASSWORD.

The function HTTP_POST works with the rfc destination SAPHTTP with comunicates with saphttp program.

What can I Do ????

5 REPLIES 5
Read only

thomas_jung
Developer Advocate
Developer Advocate
0 Likes
991

Since you are on 4.7 you might want to try using class cl_http_client instead of the http_post.

Read only

Former Member
0 Likes
991

But the problems is not HTTP_POST. I also tray to use this clases but I can't connect to the server .

Read only

0 Likes
991

How did u pass the USER and PASSWORD value? plain text?

then it will fail. you need to scramble user name and password before passing it to the FM.

here is the example.

call 'AB_RFC_X_SCRAMBLE_STRING'

id 'SOURCE' field user id 'KEY' field key

id 'SCR' field 'X' id 'DESTINATION' field user

id 'DSTLEN' field slen.

Regards

Raja

Read only

0 Likes
991

The AB_RFC_X_SCRAMBLE_STRING is nessary if you calling HTTP_POST because it is called via RFC. However if you the CL_HTTP_CLIENT, this is not necessary. You interacting directly with the ICM and for HTTP, the username and password is passed unencrypted via the HTTP headers (Basic Authentication). When you tried the CL_HTTP_CLIENT, you did call the AUTHENTICATE method? If you did you didn't try and scramble the password? Also have you tried calling the URL for the WebService from your browser, just to make sure that everything is setup right on that side and that you username and password are good? Also what kind of security are they expecting - Basic authentication, HTTPS, Certificate, etc.

Read only

0 Likes
991

Hi Thomas,

I am working with NetWeaver Developer Studio 2.0.3 and J2EE 630. I got success in

calling my webservice, but now I need to call it with security access. How shoud I go on ?

In the definition of my WebService in Developer Studio I have specified HTTP authentication and Basic, but where should I set up the user and password ? Do I have to complete anything else in Document Security tab or in the Visual Administrator ?

Best regards.