Posts

good diff tool , file compare https://www.site24x7.com/tools/diff-checker.html

 https://www.site24x7.com/tools/diff-checker.html

testing java script online example , including payload slitly modify ,

java script as below.  https://www.programiz.com/javascript/online-compiler/ payload as constant. as shown below. --- note:   // context.setVariable("validRequest2", false); or /vice versa.  console.log("validRequest2:", isValid); ---- catch (e) { // Handle JSON parsing errors or other unexpected errors console.log("Error:", e.message); help extract error. ---- try {   // Retrieve the incoming request content as a string   var requestContent = `   {     "despatchStock": {       "companyCode": "",       "idKey": "3PLWMSSTABLEID",       "sourceType": "PLANT",       "source": {         "location": "RSE",         "name1": " ",         "name2": " ",         "houseNumber": " ",         "street1": " ",         "street2": " ",         "postalCode": ...

java script for validating unknow fileds coming from source. throw error.

 java script : validate incoming payload fields. ------------------- worked: try {     // Retrieve the incoming request content as a string     var requestContent = context.getVariable("request.content");          // Parse the JSON payload into a JavaScript object     var request = JSON.parse(requestContent);          // Define allowed fields for the main object     var allowedFields = [         "actualGrossWeight", "actualVolumeUom", "actualVolumeWeight", "actualWeightUom",         "billOfLading", "carrierId", "companyCode", "containerID", "containerSealNumber1",         "containerSealNumber2", "despatchDeliveryId", "destination", "destinationType",         "documentText", "externalUniqueReference", "idKey", "items", "postingDate",         "referenceDocumentNumber", "source", ...

eos : sample generated xslt logic by vertex

----- remove all prefix of xml file. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">   <xsl:output method="xml" indent="yes" />   <xsl:template match="/">     <xsl:copy>       <xsl:apply-templates select="*" />     </xsl:copy>   </xsl:template>   <xsl:template match="*">     <xsl:element name="{local-name()}">       <xsl:apply-templates select="node()|@*"/>      </xsl:element>   </xsl:template>   <xsl:template match="@*">     <xsl:attribute name="{local-name()}">       <xsl:value-of select="." />     </xsl:attribute>   </xsl:template>   <xsl:template match="text()">     <xsl:value-of select="." />   </xsl:template> </xsl:stylesheet> ----- dummay 3pl iflow grovvy import ...