I have this MuleSoft Configuration Flow and I am getting the following error, I think maybe I am missing an include or something.
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.8.1:process-classes (default-process-classes) on project account-collateral-api: Execution default-process-classes of goal org.mule.tools.maven:mule-maven-plugin:3.8.1:process-classes failed: There was '1' error while parsing the given file 'account-collateral-api-acctcollaterals-acctcollateralrelkeys-acctcollateralrelid-get.xml'.
[ERROR] Full list:
[ERROR] org.xml.sax.SAXParseException; lineNumber: 31; columnNumber: 21; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.mulesoft.org/schema/mule/http":uri-params}'. One of '{"http://www.mulesoft.org/schema/mule/http":response-validator}' is expected.
This is the configuration flow.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:apikit="http://www.mulesoft.org/schema/mule/mule-apikit"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/mule-apikit http://www.mulesoft.org/schema/mule/mule-apikit/current/mule-apikit.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<flow
name="get:\acctCollaterals\acctCollateralRelKeys\(acctCollateralRelId):application\json:account-collateral-api-config">
<logger level="INFO" message="Request: #[payload]" />
<logger level="INFO" message="Service Request: #[payload]" />
<http:request
config-ref="http-account-collateral-api-request" method="GET"
path="acctCollaterals\acctCollateralRelKeys\(acctCollateralRelId)">
<http:headers><![CDATA[#[output application/java
---
{
"content-type" : "application/json"
}]]]></http:headers>
<http:query-params><![CDATA[#[output application/java
---
{
"limit" : attributes.queryParams.'limit',
"cursor" : attributes.queryParams.'cursor'
}]]]></http:query-params>
<http:uri-params><![CDATA[#[output application/java
---
{
"acctCollateralRelId" : attributes.uriParams.'acctCollateralRelId'
}]]]></http:uri-params>
</http:request>
<logger level="INFO" message="Service Response: #[payload]" />
<ee:transform doc:name="Transform Message">
<ee:message>
<ee:set-payload
resource="mappings/responses/acctcollaterals-acctcollateralrelkeys-acctcollateralrelid-responses-mapping.dwl" />
</ee:message>
</ee:transform>
<logger level="INFO" message="Response: #[payload]" />
<error-handler ref="private-errorhandler" />
</flow>
</mule>
It has the following dependencies included in the maven pom.
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.2.3</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-tracing-module</artifactId>
<version>1.0.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-apikit-module</artifactId>
<version>1.9.1</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.8.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.modules</groupId>
<artifactId>mule-secure-configuration-property-module</artifactId>
<version>1.2.5</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-runner</artifactId>
<version>2.3.13</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.munit</groupId>
<artifactId>munit-tools</artifactId>
<version>2.3.13</version>
<classifier>mule-plugin</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mule.weave</groupId>
<artifactId>assertions</artifactId>
<version>1.0.2</version>
<scope>test</scope>
</dependency>
</dependencies>
I can't seem to see the error, I am sure I am just looking at it too long! Thanks in advance.
Solved. So apparently the XML for the HTTP Request has a order. First headers, then uri params, then query params. If they are out of order the app fails to compile.