cancel
Showing results for 
Search instead for 
Did you mean: 

TokenUser and password in SOAP header

former_member217029
Participant
0 Kudos

Hello,

I need to pass Token user & password in soap header for receiver SOAP. This is Idoc to SOAP interface.

Requirement is I need to convert whole IDOC XML to binary base 64 and mapp to single field in the receiver structure also need to send Token user/password in soap header.

I am planning to use below UDF in graphical mapping to convert IDOC XML to binary base 64 and mapp to single field then use xslt mapping to pass token user/password in soap header.

So in operation mapping it would first call xslt mapping and then graphical mapping. Will this design work in my case ? Please suggest.

UDF:

public String base64Encode(String str, Container container) throws StreamTransformationException

{

try{

  byte[]   bytesEncoded = Base64.encode(str.getBytes("utf-8"));

  return new String(bytesEncoded );

} catch ( UnsupportedEncodingException e ) {

  return "Error";

}

}

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Bhavana,

for adding the soap header user id and password, you can the AddSOAPHeaderBean. Please check the below blog

for base 64 conversion check the below links

Java Code for Base 64 Encoding | SCN

regards,

Harish

former_member217029
Participant
0 Kudos

Hello Harish,

Thank you for your reply on this.

Adding Token user and password in soap header with "AddSOAPHeaderBean" looks promising to achieve my requirement. Thanks for that.

And regarding converting whole Idoc xml into binary base64 and put it in one field can't be achieved by simple UDF that i mentioned above? I am just exploring options only.

My receiver SOAP structure is as below. I have to convert whole idoc xml into binary base64 and put it in "argBytConteudo" field.

Thanks

former_member217029
Participant
0 Kudos

Hello,

I was referring to below thread and Eng Swee mentioned in his reply that piece of UDF code can do this conversion of binary base 64.

Regards

Harish
Active Contributor
0 Kudos

Hi Bhavana,

Yes the code should able to convert to base64.

regards,

Harish

Answers (0)