Search code examples
wso2wso2-data-services-serverwso2-esb

WSO2 Data Service Server error INCOMPATIBLE_PARAMETERS_ERROR


I'm using the WSO2 ESB and DSS, I have setup a DSS service and have tested this and it works using the following URL

http://10.248.40.85:9764/services/params/op/{Value goes here}

My problem is when calling this from the ESB it doesn't work and throws the incompatible parameters error. The way it is being called is as follows

<log level="custom">
    <property name="uri.var.ID" expression="$body/int:User/int:UserID/text()"/>
</log>
<send>
    <endpoint>
        <http method="get" uri-template="http://10.248.40.85:9764/services/params/op/{uri.var.ID}"/>
    </endpoint>
</send>

When logging the uri.var.ID it returns the expected number but when the service tries to call the endpoint it throws the error and says that the current parameters are empty.

The DSS service resource is

<resource method="GET" path="op/{ID}">
    <call-query href="query2">
        <with-param name="ID" query-param="ID"/>
    </call-query>
</resource>

Solution

  • Solved the problem by using the following

    <payloadFactory media-type="xml">
        <format>
            <p:operation2 xmlns:p="http://ws.wso2.org/dataservice">
                <xs:ID xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:ID>
            </p:operation2>
        </format>
        <args>
            <arg xmlns:xs="http://ws.wso2.org/dataservice" xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml" expression="get-property('uri.var.ID')"/>
        </args>
    </payloadFactory>
    <call>
        <endpoint>
            <address uri="http://10.248.40.85:9764/services/params/operation2"/>
        </endpoint>
    </call>