I just found the POST syntax working : WORKING : {"_post_inscriptions": {"id":"00112233441","my_ref":"00-aa-25678-00112233446", "beginDate": null, "endDate":null }}
instead of NOT WORKING (but documented): {"_postinscriptions": {"id":"00112233441","my_ref":"00-aa-25678-00112233446", "beginDate": null, "endDate":null }} This is not what can be read at https://docs.wso2.com/display/EI650/Exposing+a+Datasource+as+a+Data+Service <https://docs.wso2.com/display/EI650/Exposing+a+Datasource+as+a+Data+Service> : <_postemployee> <EmployeeNumber>3</EmployeeNumber> <FirstName>Will</FirstName> <LastName>Smith</LastName> <Email>w...@google.com</Email> <Salary>15500.0</Salary> </_postemployee> Issue in software or in documentation ? Bernard > Le 3 juil. 2019 à 09:47, Bernard Paris <bernard.pa...@uclouvain.be> a écrit : > > Hi, > > Sorry I have already posted this problem but since I'm spending hours to not > find a solution, here I come again to get some help : > > Using EI-6.4.0 > > In DSS: > > <query id="create_inscription_query" useConfig="default"> > <sql>INSERT INTO inscriptions(id, my_ref, beginDate, endDate) values > (:id , :my_ref, :beginDate, :endDate )</sql> > <param name="id" sqlType="STRING" ordinal="1"/> > <param name="my_ref" sqlType="STRING" ordinal="2"/> > <param name="beginDate" sqlType="DATE" ordinal="3"/> > <param name="endDate" sqlType="DATE" ordinal="4"/> > </query> > <resource method="POST" path="/inscriptions"> > <call-query href="create_inscription_query"> > <with-param name="id" query-param="id"/> > <with-param name="my_ref" query-param="my_ref"/> > <with-param name="beginDate" query-param="beginDate"/> > <with-param name="endDate" query-param="endDate"/> > </call-query> > </resource> > >> curl -X POST -H 'Accept: application/json' -H 'Content-Type: >> application/json' >> "http://localhost:8280/services/inscriptions-my/inscriptions" -d >> '{"_postinscriptions": >> {"id":"00112233441","my_ref":"00-aa-25678-00112233446", "beginDate": null, >> "endDate":null }}' > > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "POST /services/inscriptions-my/inscriptions HTTP/1.1[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "Host: localhost:8280[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "User-Agent: curl/7.54.0[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "Accept: application/json[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "Content-Type: application/json[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "Content-Length: 118[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "[\r][\n]" > [2019-07-03 09:27:17,095] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 >> "{"_postinscriptions": > {"id":"00112233441","my_ref":"00-aa-25678-00112233446", "beginDate": null, > "endDate":null }}" > [2019-07-03 09:27:17,096] [EI-Core] DEBUG - GsonXMLStreamReader Updating > message schema. > [Current:org.apache.ws.commons.schema.XmlSchema@64ce7320[http://ws.wso2.org/dataservice], > > New:org.apache.ws.commons.schema.XmlSchema@1b6ac6cd[http://ws.wso2.org/dataservice]] > [2019-07-03 09:27:17,097] [EI-Core] ERROR - GsonXMLStreamReader Value type > miss match, Expected value type - 'null', but found - 'STRING' > [2019-07-03 09:27:17,097] [EI-Core] ERROR - ServerWorker Error processing > POST request for : /services/inscriptions-my/inscriptions. Error detail: > Value type miss match, Expected value type - 'null', but found - 'STRING'. > java.lang.IllegalArgumentException: Value type miss match, Expected value > type - 'null', but found - 'STRING' > at > org.apache.axis2.json.gson.GsonXMLStreamReader.nextValue(GsonXMLStreamReader.java:739) > at > org.apache.axis2.json.gson.GsonXMLStreamReader.readValue(GsonXMLStreamReader.java:626) > at > org.apache.axis2.json.gson.GsonXMLStreamReader.stateTransition(GsonXMLStreamReader.java:532) > at > org.apache.axis2.json.gson.GsonXMLStreamReader.next(GsonXMLStreamReader.java:178) > at > org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681) > at > org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) > at > org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78) > at > org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722) > at > org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:700) > at > org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:105) > at > org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:296) > at > org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:212) > at > org.apache.axiom.soap.impl.llom.SOAPBodyImpl.addChild(SOAPBodyImpl.java:231) > at > org.apache.axis2.json.gson.JSONMessageHandler.invoke(JSONMessageHandler.java:84) > at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340) > at org.apache.axis2.engine.Phase.invoke(Phase.java:313) > at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:167) > at > org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337) > at > org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:383) > at > org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151) > at > org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748) > [2019-07-03 09:27:17,098] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 << "HTTP/1.1 500 Internal Server Error[\r][\n]" > > > > Also tested but fail too: > > <query id="create_inscription_query" useConfig="default"> > <sql>INSERT INTO inscriptions(id, my_ref, beginDate, endDate) values > (:id , :my_ref, null, null )</sql> > <param name="id" sqlType="STRING" /> > <param name="my_ref" sqlType="STRING" /> > </query> > <resource method="POST" path="/inscriptions"> > <call-query href="create_inscription_query"> > <with-param name="id" query-param="id"/> > <with-param name="my_ref" query-param="my_ref"/> > </call-query> > </resource> > > >> curl -X POST -H 'Accept: application/json' -H 'Content-Type: >> application/json' >> "http://localhost:8280/services/inscriptions-my/inscriptions" -d >> '{"_postinscriptions": >> {"id":"00112233441","my_ref":"00-aa-25678-00112233446" }}' > > > Thanks, > Bernard > > > > > > > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev