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.
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
You can access the value mapping with this class:
result = XIVMService.executeMapping(sourceContext, sourceAgency, sourceScheme, sourceValue, targetContext, targetAgency, targetScheme);
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]