cancel
Showing results for 
Search instead for 
Did you mean: 

UsernameToken: UDF generation in message mapping

former_member440449
Participant
0 Kudos

Gurus,

I am sending a request to a Web Service from SAP where the WS is expecting header details with UsernameToken where Password_Digest = Base64 ( SHA-1 ( nonce + created + password ) )


I am using SOAP receiver adapter HTTP protocol (not Axis) so I am sending this request in a SOAP Lookup UDF.

I got an example to send and worked fine from an end to end perspective, but if I send the same request twice in a short period of time it is rejected.

What I need is to know if it is possible to create an UDF for this effort and if so, if there's any code that I can reuse for this piece:

<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">PDPLNQT8AHzQ30fkW/ROZA==</wsse:Nonce>

So what I just need is to generate the "PDPLNQT8AHzQ30fkW/ROZA==" with the UDF as I am concatenating strings.

Can anyone please help me on that?

Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

former_member440449
Participant
0 Kudos

Actually I just add a random value with an UDF and then encode it to base64 and now everything is working as expected.

Thanks!

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Claudio,

Could you share the exception?, it's a little weird that it works once and it doesnt work a second time. May be could be a problem in the endpoint and it doesnt let two messages in a short period of time from the same user/connection/etc.

Regards.

former_member440449
Participant
0 Kudos

Hi Iñaki,

I had a call with the technical contact from the WS and he told me that it detect the same header sent twice so it blocks it assuming that it may be a flood attack.

Seems that I need any random value for the "nounce" tag, so I will work on that and see if the problem persist.