Validating a part of request in DataPower

user3734575

I have WSDL which can be used to validate complete XML and part of XMLs

MY XML :

<Request>
     <Part> .. </part>
     <Part> .. </part>
     <Part> .. </part>
     <Part> .. </part>
     <Part> .. </part>
     <Part> .. </part>
     <Part> .. </part>
</Request>

I have configured validation action which is validating complete and throwing as one or more part is having invalid data.

Requirement is : I have to validate only the part in the above request and remove invalid part before sending to backend.

Any help??

Isaac G Sivaa

This can be done by using extension element / function in the XSLT.

Skeleton:

<xsl:template match=Request>
<xsl:copy>
<xsl:for-each select="Part">
 <xsl:if test="dp:schema-validate($schema,.) !=''">
   <xsl:copy-of select="."/> 
 </xsl:if>
</xsl:for-each>

schema-validate() : Performs a schema validation.
Namespace declaration : xmlns:dp="http://www.datapower.com/extensions"

Syntax :dp:schema-validate(schema, nodeset)

Parameters : schema : (xs:string) Identifies the XSD schema to perform the validation. nodeset:(xs:node-set) Identifies the node set that contains the XML content to validate. All arguments are passed as XPath expressions.

Results :the validated node set.

Please refer to this link for more info on Extension elements and Functions.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Validating a part of request in DataPower

From Dev

Validating array request in Laravel

From Dev

Validating Request Content-Type

From Dev

Validating request parameter before controller

From Dev

validating SOAP-Request with a SOAPHandler

From Dev

Validating request parameter before controller

From Dev

Validating Request Schema With Fastify and AJV

From Dev

Nested IF statement validating part 1 but not part 2 of conditional

From Dev

Spring REST - validating primitive GET request parameters

From Dev

NodeJS : Validating request type (checking for JSON or HTML)

From Dev

Validating request in node.js and quiting if error

From Dev

Twilio - Validating Incoming Callback Request - Java

From Dev

Trouble validating form on POST request (Springboot)

From Dev

Alexa Skill Certification - Validating amazon request

From Dev

Probleme validating a symfony form to submit POST request

From Dev

First cURL request validating GCM api key

From Dev

Multi-Part Request

From Dev

Copy part request to model

From Dev

Multi-Part HTML Form Validating Only Some Inputs

From Dev

Django-REST-Framework: Validating GET request parameters?

From Dev

How to use Mule schema-validation-filter for validating SOAP Request

From Dev

How to use Mule schema-validation-filter for validating SOAP Request

From Dev

Rails: Validating JSON request format before API controller methods

From Dev

Subdomain as part of REQUEST_URI

From Dev

AAA authentication error in DataPower

From Dev

AAA authentication error in DataPower

From Dev

dp:serialize function in datapower

From Dev

Datapower timeout is in what unit?

From Dev

Error Integrating Mobilefirst with DataPower

Related Related

HotTag

Archive