cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI Java Mapping Transport

Former Member
0 Kudos

Hi All,

I have a java mapping where I do a SOAP Lookup to target client system using a USER ID/ PASSWORD to get a session ID. I further use this Session in my target SOAP mapping.

My question is I have hardcoded USER ID / PASSWORD in string variable and use it while constructing my SOAP Lookup xml.

So when I am moving from one environment to another the client USER ID / PASSWORD will change. In that case I have to manually change the java mapping explicitly and transport it.

What is the best way to handle it ? So that I don't have to change the USER ID/ PASSWORD when I am transporting my java mapping from environment to environment.

Regards

Ravijeet

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

You could store the values for user and password in value mapping.

Then you can change the values easily without changing the code.

Former Member
0 Kudos

Hi Stefan,

I also thought in these lines but didn't have the java lines I need to add to access the Value mapping.

Regards

Ravijeet

stefan_grube
Active Contributor
0 Kudos

You can access the value mapping with this class:

com.sap.aii.mapping.value.api.XIVMService

https://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/value/api/XIVMService.html

for example:

result = XIVMService.executeMapping(sourceContext, sourceAgency, sourceScheme, sourceValue, targetContext, targetAgency, targetScheme);

Former Member
0 Kudos

you can also read user id and Password from property file. You store property file for each environment and maintain ID and password in the File.

Former Member
0 Kudos

I would consider Java Parameter Mapping, you can change the userid/password in configuration for each environment. Refer to this blog [/people/shabarish.vijayakumar/blog/2009/12/07/parametrized-java-mapping-in-pi-71-plus-some-other-delicacies|/people/shabarish.vijayakumar/blog/2009/12/07/parametrized-java-mapping-in-pi-71-plus-some-other-delicacies]

Regards

Asif

rajasekhar_reddy14
Active Contributor
0 Kudos

write a logic in JAVA to idetify environment (dev or qual or prod),and hard code 3 environment passwords in java mapping,based on environment pass user name and password.

this is the best way to handle this kind of requirement,to get system environment use system.getProperty

.Regards,

Raj