cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer username when calling web service from PI?

Former Member
0 Kudos

Hi

I have a scenario where a front end application is calling a web service exposed by PI 7.11 and PI is forwarding the call to the backend web service. That is, a SOAP sender adapter and a soap receiver adapter.

Now, I would like to transfer the username, which the PI exposed web service is called with, to the backend web service.

I previously did this by using a UDF where I picked up the username like this and mapped the username to a field in the request message when calling the backend web service:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "SRemoteUser");

String WSuser = conf.get(key);

return WSuser;

However, I would like to avoid this method and in stead e.g. use either a query string like http://xxxxx:6571/ISBWS/soap/ISBCore?username=mikael or maybe transfer the username in the http header in some way.

So my question is: what are my options and how do I set it up?

BR MIkael

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Did you check this link [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d07121-07a5-2c10-5280-a081de9b851c?quicklink=index&overridelayout=true]

Former Member
0 Kudos

Thanks for the reply.

However, PI is calling an external web service and the idea is not to use the initial user to log on to the backend webservice using principal propogation but merely to transfer the username to the backend webservice e.g. in the url or in the (soap)header in some fashion.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Apparenty sending user name details in query string is not best practice in webservice. Thats why WSDL does not cover user credentials inside. Webservice deals with message level security , transport level security, encryption , certificate authentication , username token etc

If you want to use http query string in the soap receiver target url try as below and see how that helps... somthing as below..

example: http://host:port/jsppage?userid=test or use xslt mapping or java mapping create soap header as you want and specify username over there.

Former Member
0 Kudos

Thanks for the reply, Baskar

Is there a way of dynamically specifying the username in the ?name='???' so that the value of SRemoteUser is replacing the ???s?

Is it done by using "Variable Transport Binding" using XHeaderName1 = %SRemoteUser%?