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: 

Web Service authentication when accessing from Flex

Former Member
0 Kudos

Hi,

I have a Flex application that accesses data in SAP via a BAPI web service. I have effectively turned off authentication by specifying a username and password in SICF on the sap-bc-soap-wsdl11 service. However, I won't be allowed to do this in production.

So, I want to be able to send across the username and password from flex to authenticate properly.

I have the following code:

private function loadStuff():void {
	wsBAPI.wsdl = "http://bizaps88.bz1.com:8000/sap/bc/soap/wsdl11?services=BAPI_CUSTOMER_GETDETAIL2&sap-client=800";
	var opBAPI:Operation = Operation(wsBAPI.getOperation("BAPI_CUSTOMER_GETDETAIL2"));
	opBAPI.resultFormat="e4x";
	opBAPI.service.setCredentials("MYUSER","MYPASS");
	wsBAPI.addEventListener(FaultEvent.FAULT, handleFault);
	wsBAPI.addEventListener(LoadEvent.LOAD, handleLoad);
	wsBAPI.addEventListener(ResultEvent.RESULT, handleResult);
	wsBAPI.loadWSDL();
}

However, I get a "Authentication not supported on DirectHTTPChannel (no proxy)" error when I run this. It seems to suggest that I need to go back and create proxies for all my web service calls, but I don't have time.

Has anyone had a similar issue? Did they manage to get authentication working?

Thanks

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

i havent tried this (opBAPI.service.setCredentials("MYUSER","MYPASS");) approach. however,you can pass the user id (sap-user) and password (sap-password) along with the wsdl url for authentication.

you had mentioned, that you wont be allowed to set the default lon on info in SICF. is it a policy decision or do you have problems setting that up in production?

Regards

Raja

8 REPLIES 8

athavanraja
Active Contributor
0 Kudos

i havent tried this (opBAPI.service.setCredentials("MYUSER","MYPASS");) approach. however,you can pass the user id (sap-user) and password (sap-password) along with the wsdl url for authentication.

you had mentioned, that you wont be allowed to set the default lon on info in SICF. is it a policy decision or do you have problems setting that up in production?

Regards

Raja

0 Kudos

Thanks Raja,

That is interesting that you can pass the username and password credentials in the URL....I guess the only issue is the security.

The problem with setting the username and password in SICF was a policy one - we want to have quite tight security and don't want to simply expose the web service to anybody.

What we have decided to do in the end is to use Web Service Security - we finally got this working....of course this involves setting anonymous login in SICF using a service user, but the credentials are then passed in the SOAP header and there are even some options for encrypting those.

Cheers,

Tristan

0 Kudos

Hi Tristan,

We are also facing the same problem. Could you please tell me, How you have achived this.

How you have decoded at the time of calling SICF service?.

Thanks & Regards,

Hemachandran.R

0 Kudos

Hi Hemachandran,

You managed to solve the problem that appeared to you?

I have the same problem.

0 Kudos

Hi Juan,

Yes problem solved for us.

We have changed the log on procedure.

In Authentication we have changed to internet user.

Then in the logon procedure, we have changed in the below sequence.

Logon Through HTTP Fields

Basic Authentication

Logon Through SSL Certificate

SAP Logon/Assertion Ticket

SAP RFC Logon

Logon Through Service Data

and also in flex we have to some change in get or post method.

Thanks & Regards,

Hemachandran.R

0 Kudos

Thanks Hemachandran.

You could say please, how you have reached the change in the method get and pos in the flexion.

I tried to change in the SICF but it has not left me. It leaves a message to me that says: The service cannot be modified by means of this transaction.

former_member261145
Discoverer
0 Kudos

Hi Tristan,

I have the same problem, you can show your solution, thanks.

I have used no authentication in soamanager, but even so it requests the access to me to server sap also I tried in transaction SICF, but it did not let to me modify the service.

please, I need your aid

0 Kudos

Hi Juan,

I had posted a document on Webservice consumption scenario in flex,which talks about the posted

thread topic..

http://scn.sap.com/docs/DOC-37791

Thanks,

Nandi.