-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Greg reported the following:
On Jul 1, 2014, at 5:41 PM, Greg Sharek greg.sharek@RACKSPACE.COM wrote:
Hey all,
Unfortunately, I think Jorge is the only one who can answer this issue. It's half a question about Cloud Feeds wadls & half a question about api validator.
I'm attempting to add a check to our wadls which are run by our api-validator. It's a long painful story, so I'll give you the short version, we can discuss in detail if required.
Within product.wadl, I'm adding a second rax:preprocess step after <rax:preprocess href="atom_hopper_pre.xsl"/> to perform a particular check and when I run this check, get the following error in the response (not an exception):
<error xmlns="http://abdera.apache.org" xmlns:db="http://docbook.org/ns/docbook" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:event="http://docs.rackspace.com/core/event" xmlns:dbaas="http://docs.rackspace.com/usage/dbaas" xmlns:maas="http://docs.rackspace.com/usage/maas" xmlns:lbaas="http://docs.rackspace.com/usage/lbaas" xmlns:lbaas-account="http://docs.rackspace.com/usage/lbaas/account" xmlns:cbs="http://docs.rackspace.com/usage/cbs" xmlns:cbs-snap="http://docs.rackspace.com/usage/cbs/snapshot" xmlns:cf-b="http://docs.rackspace.com/usage/cloudfiles/bandwidth" xmlns:cf-cdn="http://docs.rackspace.com/usage/cloudfiles/cdnbandwidth" xmlns:cf-str="http://docs.rackspace.com/usage/cloudfiles/storage" xmlns:rax="http://docs.rackspace.com/api" xmlns:atom="http://www.w3.org/2005/Atom">
400
Bad Content: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
When I have my preprocess step before the atom_hopper_pre.xsl step, it works fine (but the check is too early and reports incorrect information).
Why does this happen? I'm stumped.
What's my check?
Our atom_hopper_pre.xsl step adds a category called "tid:[tenantid]" to the request. I want to ensure that the user does not submit a request with a category with "tid:[other value]". After our validator adds the tid-category, I want only one to exist. (We can't do this check before the tid-category is added because we currently have 2 validators and if the second validator is executed it will fail because the first validator already added the tid-category).
Here's the check (I commented out the logic to demonstrate the error condition.
<rax:preprocess href="atom_hopper_pre.xsl"/> <rax:preprocess> <xsl:transform chk:mergable="true" version="2.0"
exclude-result-prefixes="rax util xs chk w_ns1 w_ns2 w_ns3 w_ns4 w_ns5 w_ns6 w_ns7 w_ns8 w_ns9 w_ns10 w_ns11 w_ns12 w_ns13 w_ns14 w_ns15 w_ns16 w_ns17 w_ns18 w_ns19 w_ns20 w_ns21 w_ns22 w_ns23 w_ns24 w_ns25 w_ns26 w_ns27 w_ns28 w_ns29 w_ns30 w_ns31 w_ns32 w_ns33 w_ns34 w_ns35 w_ns36 w_ns37 w_ns38 w_ns39 w_ns40 w_ns41 w_ns42 w_ns43 w_ns44 w_ns45 w_ns46 w_ns47 w_ns48 w_ns49 w_ns50 w_ns51 w_ns52 w_ns53 w_ns54 w_ns55 w_ns56 w_ns57 w_ns58 w_ns59 w_ns60">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<!-- <xsl:choose>
<xsl:when test="count( atom:entry/atom:category/@term[matches( ., '^tid:.*' )] ) = 1"/>
<xsl:otherwise>
<xsl:message terminate="yes">Bad Tid</xsl:message>
</xsl:otherwise>
</xsl:choose>
--> <xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:transform>
</rax:preprocess>
The product.wadl is attached. I modified the the addCloudBackupEntry method with my >preprocess step.
Any ideas?
Greg