cancel
Showing results for 
Search instead for 
Did you mean: 

getting user name from sopa header

Former Member
0 Kudos

How should get user name from soap header in my udf...?i searched in sdn,but not get exact solution...

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member200962
Active Contributor
0 Kudos
How should get user name from soap header in my udf...?

SRemoteUser will contain the user name.

In the SOAP Sender Channel check the Adapter Specific Message Attributes and Variable Transport Binding checkboxes.

Then inside your mapping include a Dynamic Configuration UDF which will get the details from the SRemoteUser

Regards,

Abhishek.

Former Member
0 Kudos

I din't get this with SRemoteUser

1. i've enabled " Do Not Use SOAP Envolope"

2.Enabled ASMA

3.Variable Transport Binding .

used the following code as well:

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

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

conf.get(user);

But not value in it.. Correct me if iam wrong..

former_member200962
Active Contributor
0 Kudos

Try with the below UDF:

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

DynamicConfigurationKey user = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "SRemoteUser");
String UserName = conf.get(user);

return UserName;

Input to the above UDF can be any source node....output can be mapped to the desired target field (not root node)

Regards,

Abhishek.

Former Member
0 Kudos

There is no difference beetween the code.

Did u try this any time...?

Former Member
0 Kudos

do you have any ideas?

former_member200962
Active Contributor
0 Kudos
There is no difference beetween the code.
Did u try this any time...?

asked for the complete UDF....return statement was missing in your UDF and hence provided the newer one!

Found this blog where Michal tries to get the SRemoteUser in the header and then pulls it using Dynamic Configuration (second part is not mentioned completely): /people/michal.krawczyk2/blog/2009/05/26/pixi-pseudo-principal-propagation

Have you checked other parameters also in your SOAP channel?

Regards,

Abhishek.

Former Member
0 Kudos

HI Abhishek,

Thanks for the blog, But its not working for me.

i checked the two (ASMA and Variable Transport Binding), i cant see Dynamic configuration in SXMB moni.

After that i tried adding &nosoap=true in the sending url as well..but no clue why iam not getting ..

Please guide..

Thanks

Prabhakar

Former Member
0 Kudos

Hi,

If you use the Axis adapter, you can extract an arbitrary header field into the dynamic configuration header (ASMA) which you can access from anywhere. You can find some configuration samples in the Axis Adapter FAQ Note 1039369.

The "Do not use SOAP Envelope" option of the SOAP adapter really means "Do not talk SOAP".

It is not suitable if you want to call some SOAP based web service.

Regards, Yza

Former Member
0 Kudos

In your sender SOAP channel, select - Do Not Use SOAP Envelope ... now both SOAP header and body will be available to you in the mapping. You may write XSLT or Java mapping to access the header.

Never tried it with a message mapping, but I feel you can achieve the same results.

Regards,

Neetesh