on 07-11-2016 10:10 AM
Dear All,
I have a scenario from third-party system OA to ECC via PI. I need to get the IP address of OA via UDF or java mapping . How to achieve it ?
Thank you for your advice in advance.
Many thanks & best regards,
Hubery
Hi Hubery!
As per SAP help:
The following attributes are added to the XI message header if the sender makes them available, and if you select Variable Transport Binding .
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Evgeniy,
Thank you for your information. In fact, ECC will receive the data of IP address and store. But the receiver adapter RFC,the proxy do not need to activate. so I am not sure how to get the SOAP HEADER data.
Could you please provide some advice to get the ip address?
Appreciate your input.
Many thanks & best regards,
Hubery
Hi Hubery!
Do you have any message mapping in your scenario?
If so, create UDF like this:
DynamicConfiguration dc = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/SOAP","SRemoteHost");
String val = dc.get(key);
if(val == null) val = "";
return val;
Regards, Evgeniy.
Dear All,
Thank you all of you for your great support. Thank you for your enthusiasm and patience.
The process is the following for my condition:
1. Enabled the ASMA.
2. Added the UDF to get the IP address.
Many thanks & best regards,
Hubery
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hubery,
Configuring the Sender SOAP Adapter - Advanced Adapter Engine - SAP Library
Use the technical name SRemoteHost when querying using ASMA.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Never tried this but a quick google provided me with multiple Java Sample Code references for this. One such is available here : Convert a hostname to the equivalent IP address : IP Address « Network P...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Hubery,
- If I understand this right, you are planning to expose an Interface using a SOAP Sender adapter and there can be multiple systems that trigger this call to PI.
- Depending on the system that has triggered the call you would like to identify this in some mode and then process the same in PI?
Is this understanding correct?
Regards
Bhavesh
If you want to get the IP Address of the system that is triggering the call to PI, then this is pretty straight forward.
- In your SOAP Sender Adapter Select the Set Adapter Specific Attributes,
- Now your ASMA Parameters in the runtime will contain a parameter called SndrClientAddr under namespace http://sap.com/xi/XI/System/SOAP. This contains the IP Address of the calling system.
My Sender SOAP Adapter
Corresponding IP Address in the Dynamic Configuration
Local System IP Address as seen from my Command Prompt Matching what you see in PI
Hi Hubery,
You can try this UDF
public static String getIPAddress(String url) throws Exception
{
InetAddress address = InetAddress.getByName(new URL(url).getHost());
url=address.getHostAddress();
return url;
}
output of the code for following input
http://www.yahoo.com, IP address=106.10.139.246
http://www.google.com, IP address=216.58.221.36
include these import statement
import java.net.InetAddress;
import java.net.URL;
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Anupam,
Thank you for your response. I forget to explain one point. In fact, There are 3 third-party system(OA,SEI and NSTC) to call the one PI interface. the website is different. I get the IP address according to the sender system(OA, SEI and NSTC), and handle different business. The sender system is random. There is no interface field to identify the website or IP address.
Hubery
Dear Anupam,
In fact , the interface is to query the salary according to the department number. The all of three system need to send the department number to query the salary. As you know, the salary is high security. But the three system can query all salary. So we want to control it via IP address. The interface is done. The receiver adapter is RFC.
Please kindly give some advice. How to achieve it.
Hubery
In addition to the detailed response I have provided to get the IP Address of the calling system, if all you would like to make sure if that only the calls from these 3 systems are allowed to call these service, you may use Access Control List of your Integrated Configuration.
What this means is, in your ICO, you can assign a User in the Assigned Users tab and then only these users will be allowed to access this Interface.
Eg: My ICO has user kantilalb assigned to it. When I trigger this ICO now for any other user (bhaveshk) I would get en error.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.