cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service Log on Language change dynamically based on calling app's langu

Former Member
0 Kudos

Hello,

We have a requirement to expose BAPIs as well as some bespoke RFCs as web services. They will be consumed by a CE application in the UI. Now this application will be rolled to multiple countires and the messages returned by web service are expected to be in the calling apps language.

These web services will be registered on SR and at design time the CE application will fetch meta data from there. It will support basic authentican. For runtime a RFC destination on CE portal is created with a technical user which will execute the web service calls from CE portal. This user has a defined default language setting which needs to be over ridden for every session if calling UI has different language.

I need a way to influence the ECC/backend execution of web service to have the calling apps language as default language or sy-langu if you like for that session.So that ECC generates the messages in the required language by default.This has to be achieved dynamically so that all languages can be catered for with minimum configration/development.

What is the best way to achieve it. We are on CE 7.2 and ECC 701 ehp1.

Any help is appreciated.

-Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The lenguage of the service is the language of the user.

You can manage in SU03 transaction.

Former Member
0 Kudos

Hello J.H.

Thanks for taking interest, I know language is configurable in SU03. But that is something which cannot be influenced dynamically when a web service call is placed( or at least that is what I am trying to find out whether it is possible to influence the language dynamically for the session you are in) .

Have a look at this article, you would understand what I am trying to achieve.

Situation is, the approach proposed in this article will lead to multiple endpoints ( in my case we are rolling to 20+ countries) for same service, resultant number will be huge i.e. for e.g. if I create 5 services I will end up with 100 aliases.Moreover, the consumer application in CE has to create that many models and impose logic to select correct one to call web service based on language of the application.

more ideas please

(calling for experts to jump on)

-Praveen

Edited by: Praveen Johri on Nov 7, 2011 6:54 PM, corrected some typos

Former Member
0 Kudos

My view:

1. Create different consumer by adding additional parameter "sap-language=XX" for different Language

AND/OR

2. Use different users (with different default language) to consume service.

In this case German user will be using WSDL with parameter sap-language=DE in url while english user will use sap-language=EN.

Same way, german webservice consumer will be using user XYZ (whose default language is DE) and english user will be using user ABC (whose default language is EN).

Regards,

Gourav

Former Member
0 Kudos

Hi Gourav,

Let me explain the scenario once again.

The consumption of web service will happen via WD4J application in CE environment which means the connection will be set up between the systems via technical user rather than using user token. This imples that the connection details are static.Moreover the web service meta data is fetched from Service Registry at design time and WISDL in SR will not have this parameter or lets say that wisdl is not used to call the web service, the option of SR is used.

I am not clear in this scenario how can I add the parameter for language. Another question which comes in mind is, even if we are able to pass the parameter somehow, the connection is opened before the web service call in this method in that case the log on language will already be set to user default, the passed parameter will not have any effect...correct me if I am wrong.

option 2 to have different users set up at the backend for different language options is not an elegent way of dealing with it, I am not sure that I will be able to convince the basis to do that. Moreover, let's say we have it even then the call will happen between systems using a technical user.I am not sure at design time I have the option to say that change the technical user at runtime based on some condition.

I am little confused with all this primarily because it seems the option to infliuence the language lies at the consumer side which in this case is not my domain i.e. dependent on other developers to tell me what they can achieve.Unless I get some clear guidance in the forum.

Therefore, I wonder if there could be any solution by which I can handle the switch on the provider side.

I understand your solution may work in situations where I am calling the web service out of SAP domain where I have to specify all the connection options, can a suggestion be given for CE/ECC scenario.

Thanks in advance.

-Praveen

Former Member
0 Kudos

Hi Praveen,

Please refer to the thread below & see if it meets your requirements:

[]

Regards, Trevor

Former Member
0 Kudos

Hi Trevor,

Thanks for that thread, I had seen that when I was searcing the forum before positng the question.

I have asked for developers to try and pass the language in HTTP header to see if that works. It is WIP.

But there is an issue with approach, the sequence which you had posted from sap help on that thread to determine the log on language on provider side picks the language defined in SICF, if not found there then it goes to HTTP header.

Issue is, when I generate the web service from FM wizard( in my knowledge that is the only way to generate the service definiton for function module), the SICF service by default have EN set as default language. Obviously I can't change that in SICF and I don't get the straight option to change that in SOAMANAGER.(at least on 701)

What I have noticed is, if I generate webservice using NO authentication/secufity profile, the way secuirty information appears on SOAMANAGER is different to what it appears when you choose to create the service using 'LOW' or 'MEDIUM' security profile. In first case, I do see the option to pass the authentication parameters like userid, pwd and language. In latter case,

I only get the option to specify the type of security I want i.e. HTTP vs HTTPS etc.In this case it just says authentication 'HTTPbasic' or 'UserToken' etc but does not give the option to change anything there. This is true if you generate endpoint from SOAMANAGER intead of wizard.

The troubling aspect is, even using the first scenario I am able to change the default in SOAMANAGER, it is not reflected in SICF which does not give me much confidence.

The other thing which I do not understand is, when I change the default language and set the authentication to basic, I am having issues in testing this from WSNavigator. It asks for user Id/pwd and the credentials which always works are not working in this case. Not sure if it needs a service user there....

Enough of rant from me.....

-Praveen