REST API - using Cellsets return Error 505 HTTP Version Not Supported
Posted: Fri Apr 12, 2019 1:24 pm
I'm investigating features of REST API and found a problem with using Cellsets.
I'm using the article
https://www.ibm.com/support/knowledgece ... lsets.html
Next 2 examples (Java code):
1) Attempt of updating the cell
1 step
URL u = new URL("https://servername:port/api/v1/Cubes('CubeName')/Views('ViewName')/tm1.Execute?$expand=Cells($select=Ordinal,FormattedValue,Consolidated)");
HttpURLConnection c = (HttpURLConnection) u.openConnection();
...
c.setRequestMethod("POST");
c.connect();
return
{"@odata.context":"../../$metadata#Cellsets(Cells(Ordinal,FormattedValue,Consolidated))/$entity","ID":"syDu-jM9AIByAAAg","Cells":
[{"Ordinal":0,"FormattedValue":"Jan 2019","Consolidated":false},
{"Ordinal":1,"FormattedValue":"Jan 2018","Consolidated":false},
....
{"Ordinal":6,"FormattedValue":"12","Consolidated":false},
...
{"Ordinal":17,"FormattedValue":"Commited","Consolidated":false}]}
Step 2
Using ID "syDu-jM9AIByAAAg" I'm trying to update
https://servername:port/api/v1/Cellsets('syDu-jM9AIByAAAg')/Cells[{ "Ordinal": 6, "Value": 11} ]
String st1="https://servername:port/api/v1/Cellsets('" + ID + "')/Cells[{ \"Ordinal\": 6, \"Value\": 11} ]";
URL u1 = new URL(st1);
HttpURLConnection c1 = (HttpURLConnection) u1.openConnection();
c1.setRequestProperty("X-HTTP-Method-Override", "PATCH");
c1.setRequestMethod("POST");
c1.connect();
I receive message
[HTTP/1.1 505 HTTP Version Not Supported]
2) Attempt of GetPartion
Step1 is the same as in 1st Attempt
Step 2
String st1="http://servername:port/api/v1/Cellsets('" + ID + "')/tm1.GetPartition(Begin=0, End=1)?$expand=Members";
URL u1 = new URL(st1);
HttpURLConnection c1 = (HttpURLConnection) u1.openConnection();
c1.setRequestMethod("GET");
c1.connect();
The response is the same
[HTTP/1.1 505 HTTP Version Not Supported][
I'm using the article
https://www.ibm.com/support/knowledgece ... lsets.html
Next 2 examples (Java code):
1) Attempt of updating the cell
1 step
URL u = new URL("https://servername:port/api/v1/Cubes('CubeName')/Views('ViewName')/tm1.Execute?$expand=Cells($select=Ordinal,FormattedValue,Consolidated)");
HttpURLConnection c = (HttpURLConnection) u.openConnection();
...
c.setRequestMethod("POST");
c.connect();
return
{"@odata.context":"../../$metadata#Cellsets(Cells(Ordinal,FormattedValue,Consolidated))/$entity","ID":"syDu-jM9AIByAAAg","Cells":
[{"Ordinal":0,"FormattedValue":"Jan 2019","Consolidated":false},
{"Ordinal":1,"FormattedValue":"Jan 2018","Consolidated":false},
....
{"Ordinal":6,"FormattedValue":"12","Consolidated":false},
...
{"Ordinal":17,"FormattedValue":"Commited","Consolidated":false}]}
Step 2
Using ID "syDu-jM9AIByAAAg" I'm trying to update
https://servername:port/api/v1/Cellsets('syDu-jM9AIByAAAg')/Cells[{ "Ordinal": 6, "Value": 11} ]
String st1="https://servername:port/api/v1/Cellsets('" + ID + "')/Cells[{ \"Ordinal\": 6, \"Value\": 11} ]";
URL u1 = new URL(st1);
HttpURLConnection c1 = (HttpURLConnection) u1.openConnection();
c1.setRequestProperty("X-HTTP-Method-Override", "PATCH");
c1.setRequestMethod("POST");
c1.connect();
I receive message
[HTTP/1.1 505 HTTP Version Not Supported]
2) Attempt of GetPartion
Step1 is the same as in 1st Attempt
Step 2
String st1="http://servername:port/api/v1/Cellsets('" + ID + "')/tm1.GetPartition(Begin=0, End=1)?$expand=Members";
URL u1 = new URL(st1);
HttpURLConnection c1 = (HttpURLConnection) u1.openConnection();
c1.setRequestMethod("GET");
c1.connect();
The response is the same
[HTTP/1.1 505 HTTP Version Not Supported][