Thursday 24 October 2019

SOA Java Snippet to Decode and Encode


Decode: 

XMLElement EncodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");         
String EncodedReportData=EncodedData.getTextContent();                         
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                         
  try                                         
   {                                         
      String DecodedReportData = B64Decoder.decode(EncodedReportData);         
      setVariableData("DecodedString",DecodedReportData);                                           
   }                           
  catch(Exception e)                                             
   {                                         
      addAuditTrailEntry("Exception During Decode "+e.getMessage());       
      e.printStackTrace();                                         
   }


Encode: 

XMLElement DecodedData = (XMLElement)getVariableData("VariableName","VariablePart","PathOfTheElementHoldingData");          
String DecodedReportData=DecodedData.getTextContent();                          
oracle.soa.common.util.Base64Decoder B64Decoder = new oracle.soa.common.util.Base64Decoder();                                          
  try                                          
   {                                          
      String EncodedReportData = B64Encoder.encode(DecodedReportData);          
      setVariableData("EncodedString",EncodedReportData);                                            
   }                            
  catch(Exception e)                                              
   {                                          
      addAuditTrailEntry("Exception During Encode "+e.getMessage());        
      e.printStackTrace();                                          
   }

No comments:

Post a Comment

IDCS - Identity Federation with Azure and Google (SAML IDP & Social IDP)

The setup involves Identity Cloud Service (IDCS) acting as the central identity provider, facilitating seamless authentication and authoriza...