cancel
Showing results for 
Search instead for 
Did you mean: 

Get IP address of Remote System which is consuming SAP PI Web Service

former_member455947
Participant
0 Kudos

Dear Experts

We have a scenario where third party system (remote system) is consuming web service which is hosted in SAP PI.

We need to got the IP address of third party system in message mapping so that we can perform some validation in SAP ECC.

Kindly suggest us some UDF (User Defined Function) in message mapping to get the IP of third party system. OR any other solution to validate the remote system IP in SAP PI or in ECC.

We are on SAP PI version 7.0

Trace level 2 is activated and we are able to see the remote system IP address in message log as shown in below screen shot.

Kindly note that we already test UDF described in link Get ip address from third-party system via UDF

Regards,

Iftikhar Ali

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member190293
Active Contributor

Hi Iftikhar!

Use "Set Adapter-Specific Message Attributes" parameter in SOAP adapter's settings:

In message mapping you can use UDF to get value from Dynamic configuration:

public String getDynamicFileName(Container container) throws StreamTransformationException{
  String ipValue = "";
  try{ DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);  DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "SndrClientAddr"); ipValue = config.get(key1);
  }catch(Exception e){
    ipValue = "";
  }
  return ipValue;
}

Regards, Evgeniy.

markangelo_dihiansan
Active Contributor

Hi,

Can you open your ESR and then go to

SAP BASIS -> SAP BASIS 7.00 -> http://sap.com/xi/XI/System -> Adapter Metadata -> SOAP and then search for the word "Dynamic Attributes"? It should give a list of the technical names supported in your system. For example, in my PI 7.11 system, here are the ones valid:

and share your screenshot here?

Regards,

Mark

former_member455947
Participant
0 Kudos

Thanks for the reply.

We are unable to find the suggested path "SAP BASIS -> SAP BASIS 7.00 -> http://sap.com/xi/XI/System -> Adapter Metadata -> SOAP..."

Kindly advice.

markangelo_dihiansan
Active Contributor
0 Kudos

Please check evgeniy.kolmakov 's reply. It looks like he has a PI 7.0 system.

former_member455947
Participant
0 Kudos

We checked the UDF shared by Evgeniy Kolmakov. Unfortunately still we did not get the IP address.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Iftikhar,

Have you checked Use Adapter-Specific Message Attributes in the sender channel? Can you show us a screenshot in sxmb_moni wherein the dynamic configuration section is in the soap header (should be located a few sections above the trace)?

Regards,

Mark

former_member455947
Participant
0 Kudos

Dear Mark Dihiansan

We shared the screen shot in new "Answers" tab. We were not able to attach multiple screen shots in comments section.

Regards,

Iftikhar Ali

former_member455947
Participant
0 Kudos

Dear Exerts, I am still unable to get the client IP in UDF. Currently I am doing following:

In SOAP sender channel I checked both "Set Adapter Specific Message Aattributes" and "Variable Transport Binding".

From ESR I found the dynamic attributes: "SRemoteHost" and namespace "http://sap.com/xi/XI/System" as shown in below screen shot:

I create UDF in message mapping with following code:

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;

I am getting null in message mapping. Kindly suggest me the solution to get the client IP in message mapping. I am able to see the client IP in message monitory "SXI_MONITOR" at trace level "1" as shown in below screen shot:

Regards,

Iftikhar Ali

former_member455947
Participant
0 Kudos

Dear Mark Dihiansan

Thanks for the reply.

In SOAP sender communication channel, Adapter Specific Message Attribute is active. Unfortunatilly we cannot find Dynamic Configuration section in SOAP header from Message Monitory (SXMB_MONI). I am sharing you some screen shots:

Regards,

Iftikhar Ali

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Iftikhar,

Can you check Variable Transport Binding and then resend the message again?

Regards,

Mark

former_member455947
Participant
0 Kudos
Same results after activating the Variable Transport Binding.

I think there may be the problem with technical name of host. I am testing with "SndrClientAddr" and "SRemoteHost". Can you help us to find the technical host name in our system which is PI 7.0.