But I'm rather unlucky getting it to work. Each time I press the ‘Test Connection' it fires a GET method at the URI, which results in the infamous ‘The requested resource does not support http method 'GET'’ message.
RSD file:
==================================
<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- See Column Definitions to specify column behavior and use XPaths to extract column values from JSON. --> <api:info title="Table1" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1"> <!-- You can modify the name, type, and column size here. --> <attr name="_RowNumber" xs:type="string" readonly="false" other:xPath="/json/_RowNumber"/> <attr name="Assignee" xs:type="string" readonly="false" other:xPath="/json/Assignee"/> <attr name="Date" xs:type="date" readonly="false" other:xPath="/json/Date"/> <attr name="Row_ID" xs:type="string" readonly="false" other:xPath="/json/Row ID"/> <attr name="Status" xs:type="string" readonly="false" other:xPath="/json/Status"/> <attr name="Title" xs:type="string" readonly="false" other:xPath="/json/Title"/> </api:info>
<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. --> <api:script method="GET"> <api:set attr="method" value="POST"/> <api:set attr="contenttype" value="application/json"/> <api:set attr="data">{"Action": "Find","Properties": {"Locale": "nl-NL"}}</api:set> <api:call op="jsonproviderGet"> <api:push/> </api:call> </api:script> </api:script> ================================
<!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. --> <api:script method="GET"> <api:set attr="method" value="POST"/> <api:set attr="contenttype" value="application/json"/> <api:set attr="data">{"Action": "Find","Properties": {"Locale": "en-US"}}</api:set> <api:call op="jsonproviderGet"> <api:push/> </api:call> </api:script>
</api:script>
It works for me. The only difference is that I have the ApplicationAccessKey set as an URL parameter instead of an header.
UPDATE
It works for me no matter if I have set up the header in my data source or added it. I think it is something else, but it is not about it not being able to do post calls.
Hi Thomas,
Then I must surely have set something wrong in the Datasource settings.
I've replaced my RSD with yours and made a new ODX-Datasource
Schema locatie = <directory which contains RSD file>
Table = Name of RSD-file
ATTEMPT 1
→ TEST CONNECTION = Failed - Method not allowed
ATTEMPT 2
Authenticatie → Basic + username/pwd
→ TEST CONNECTION = Failed - Method not allowed
What does your datasource settings look like?
This is my log
My setup is very basic, I only use the Location field and the Custom Headers one.
Once I generated my RSD file, I reset the URI and Generate Schema File fields.
The way I always do it with POST issues, is that I start by getting it to work in Postman, then I save the result as a response.json file which I use to generate the RSD file with.
I did exactly the same. Postman works like a charm,
postman Results → TX → generated new RSD → Edit URI
I try to always use the newest available version the newest one currently is 23.0.8565.0
I tried both the REST one and the JSON one and they both behaved the same way.
If you connect with the Response.json file it works with no issues right?
I will try yours.
Yeah, no problem importing your response.json and generating a RSD-file out of that.
Hi @mnoordam
I have made a file where the header is directly applied in the setup. This works for me.
Let me know if it works for you as well.
You can’t upload RSD files to this, so I have added an extra .txt to the file, remember to remove this before it can be used.
What does your logfile look like?
….
Either it's time for new glasses or a new career. I can’t find anything that would explain why it;s working on your site but not on mine.
You can reset the fields like shown in this gif.
That is the only differences between our setups that I can see.
I did that.+ Created a new DataSource, both cases the same ‘GET-method’- error I'm running ODX version 20.10.41, you probably on the latest (20.10.43)? Though I read nothing about REST-API/connection changes in the releasenotes, should I upgrade my environment?
HOLDUP. It works! I did a reset + supplied the URI again.
But you meant deleting the whole URI. That was it. So simple. :-|
Thx for yoru assistance!!
@mnoordam
I did not think of it as an issue before now, but yeah, I that explains it.
Essentially it will not work when an URI is applied because it will then expect it to be a GET call, whereas we control this in the file.