Skip to Content
0

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

Nov 02, 2017 at 05:03 AM

236

avatar image
Former Member

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

pi-remote-ip.jpg (280.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Evgeniy Kolmakov Nov 02, 2017 at 07:50 AM
2

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.


Share
10 |10000 characters needed characters left characters exceeded
Mark Dihiansan Nov 02, 2017 at 06:03 AM
2

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


Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

Please check Evgeniy Kolmakov 's reply. It looks like he has a PI 7.0 system.

0
Former Member

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

0

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

0
Former Member

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

0
avatar image
Former Member Nov 03, 2017 at 05:11 AM
0

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


pi1.jpg (283.0 kB)
pi2.jpg (179.7 kB)
pi3.jpg (497.2 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Iftikhar,

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

Regards,

Mark

0
Former Member
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.

0
avatar image
Former Member Apr 02 at 04:57 AM
0

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


pi-screen1.jpg (237.4 kB)
pi-screen2.jpg (91.1 kB)
Share
10 |10000 characters needed characters left characters exceeded