Hi Nuwandi,

The parameter type should be set as ARRAY instead of SCALAR if you want to
input an array. For example,

 <param name="employeeNumbers" ordinal="2" paramType="ARRAY"
sqlType="INTEGER" type="IN"/>

However the NPE should be fixed. Can you create an issue for that.
In the request you can send the payload as in [1]

[1]
https://docs.wso2.com/display/DSS351/Data+Types+of+Mappings#DataTypesofMappings-Arraydatatype

On Sat, Oct 20, 2018 at 1:58 AM Nuwandi Wickramasinghe <nuwan...@wso2.com>
wrote:

> Hi,
>
> I'm trying (With EI 6.4.0) to create an operation for a db query where the
> input param *SQLType* is defined as an *ARRAY*. Following are the query
> details.
>
> *SQL:* SELECT ORDER_ID FROM ROLE_ORDER WHERE ROLE IN (:Roles)
>
> Input Mappings
> *Mapping Name* *Parameter Type* *Type* *Action*
> Roles SCALAR ARRAY
>
> When I try to add a New Action for above query, following error is thrown.
>
> [2018-10-20 00:01:12,604] [EI-Core] ERROR - DBDeployer The
> OrderDetailService.dbs service, which is not valid, caused {1}
>
> java.lang.NullPointerException
>
> at
> org.wso2.carbon.dataservices.core.DBUtils.getSimpleSchemaTypeName(DBUtils.java:914)
>
> at
> org.wso2.carbon.dataservices.core.DataServiceDocLitWrappedSchemaGenerator.createInputEntryElement(DataServiceDocLitWrappedSchemaGenerator.java:292)
>
>
> In DBUtils class, I *cannot see any conversionType* mapped for "ARRAY"
> SqlType (In the map [1]). Would that be the reason for this?
>
> I have a requirement to run a query in the following format where I can
> pass ROLE1, ROLE2 etc (1 or more repetitions) as SOAP input parameters. Is
> there a way to achieve that?
>
> *SELECT ORDER_ID FROM ROLE_ORDER WHERE ROLE IN ('ROLE1', 'ROLE2')*
>
> [1]
> https://github.com/wso2/carbon-data/blob/v4.4.81/components/data-services/org.wso2.carbon.dataservices.core/src/main/java/org/wso2/carbon/dataservices/core/DBUtils.java#L135
>
> thanks
> Nuwandi
> --
>
> Best Regards,
>
> Nuwandi Wickramasinghe
>
> Senior Software Engineer
>
> WSO2 Inc.
>
> Web : http://wso2.com
>
> Mobile : 0719214873
>


-- 

*Chanika Geeganage* | Associate Technical Lead | WSO2 Inc.

(m) +94-77-3522586 | (e) chan...@wso2.com

<https://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to