kartverket / NGIS-OpenAPI

Tjenestebasert grensesnitt mot NGIS, basert på OpenAPI og REST.
3 stars 9 forks source link

updateDatasetFeatureAttributes with UTF-8 (utf-8) return Status Code: 500 #83

Closed larsop closed 3 years ago

larsop commented 3 years ago

Seems like the API does not support UTF-8, changing to "ISO-8859-1" like this new String(objectMapper.writeValueAsBytes(node), "ISO-8859-1") then the system does not return 500.


Jan 19, 2021 7:21:15 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logRequest
INFO: HTTP Headers: Accept=[application/vnd.kartverket.ngis.attributes+json],Content-Type=[application/vnd.kartverket.ngis.attributes+json],Authorization=[Basic bmliaW86bmliaW8=],User-Agent=[Java-SDK],Content-Length=[2863],Accept-Charset=[big5, big5-hkscs, cesu-8, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai, ibm00858, ibm01140, ibm01141, ibm01142, ibm01143, ibm01144, ibm01145, ibm01146, ibm01147, ibm01148, ibm01149, ibm037, ibm1026, ibm1047, ibm273, ibm277, ibm278, ibm280, ibm284, ibm285, ibm290, ibm297, ibm420, ibm424, ibm437, ibm500, ibm775, ibm850, ibm852, ibm855, ibm857, ibm860, ibm861, ibm862, ibm863, ibm864, ibm865, ibm866, ibm868, ibm869, ibm870, ibm871, ibm918, iso-2022-cn, iso-2022-jp, iso-2022-jp-2, iso-2022-kr, iso-8859-1, iso-8859-13, iso-8859-15, iso-8859-16, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, jis_x0201, jis_x0212-1990, koi8-r, koi8-u, shift_jis, tis-620, us-ascii, utf-16, utf-16be, utf-16le, utf-32, utf-32be, utf-32le, utf-8, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, windows-1258, windows-31j, x-big5-hkscs-2001, x-big5-solaris, x-euc-jp-linux, x-euc-tw, x-eucjp-open, x-ibm1006, x-ibm1025, x-ibm1046, x-ibm1097, x-ibm1098, x-ibm1112, x-ibm1122, x-ibm1123, x-ibm1124, x-ibm1129, x-ibm1166, x-ibm1364, x-ibm1381, x-ibm1383, x-ibm300, x-ibm33722, x-ibm737, x-ibm833, x-ibm834, x-ibm856, x-ibm874, x-ibm875, x-ibm921, x-ibm922, x-ibm930, x-ibm933, x-ibm935, x-ibm937, x-ibm939, x-ibm942, x-ibm942c, x-ibm943, x-ibm943c, x-ibm948, x-ibm949, x-ibm949c, x-ibm950, x-ibm964, x-ibm970, x-iscii91, x-iso-2022-cn-cns, x-iso-2022-cn-gb, x-iso-8859-11, x-jis0208, x-jisautodetect, x-johab, x-macarabic, x-maccentraleurope, x-maccroatian, x-maccyrillic, x-macdingbat, x-macgreek, x-machebrew, x-maciceland, x-macroman, x-macromania, x-macsymbol, x-macthai, x-macturkish, x-macukraine, x-ms932_0213, x-ms950-hkscs, x-ms950-hkscs-xp, x-mswin-936, x-pck, x-sjis_0213, x-utf-16le-bom, x-utf-32be-bom, x-utf-32le-bom, x-windows-50220, x-windows-50221, x-windows-874, x-windows-949, x-windows-950, x-windows-iso2022jp]
Jan 19, 2021 7:21:15 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logRequest
INFO: Request Body: {"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"EPSG:4258"}},"features":[{"type":"Feature","geometry":{"type":"LineString","coordinates":[[65.16192253885816,12.140220106969867],[65.1619363265414,12.140232072734605],[65.16194457439238,12.140245489762707],[65.16195159942106,12.140274839374376],[65.16195644502434,12.1403076267815],[65.16195800836354,12.140323686083182],[65.16196000490535,12.140390730902928],[65.16195535592834,12.140415360200816],[65.16194796164967,12.140437296061128],[65.16192083623508,12.140455807015112],[65.1619000462266,12.140448652835481],[65.16188367648795,12.140428424352995],[65.16187664742714,12.140398861689315],[65.16187040506439,12.140358751608547],[65.16186989011845,12.140312899631391],[65.16187322736496,12.140290119972393],[65.16188096431031,12.140257898077769],[65.16190433092325,12.140221215579803],[65.16192253885816,12.140220106969867]]},"properties":{"featuretype":"ArealressursGrense","datafangstdato":"1965-07-22","verifiseringsdato":"1965-07-22","avgrensingType":"3000","opphav":"FKB-Vann","kvalitet":{"m�lemetode":"53","n�yaktighet":200,"synbarhet":"0"},"registreringsversjon":{"produkt":"FKB-AR5","versjon":"4.5 20140301"},"identifikasjon":{"navnerom":"AR5_test23","lokalId":"092688bb-c6ef-43c9-b6f7-41b2f065537c","versjonId":"2019-11-11 11:57:47.371000"},"oppdateringsdato":"2019-11-12T14:02:26"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[65.16192253885816,12.140220106969867],[65.16190433092325,12.140221215579803],[65.16188096431031,12.140257898077769],[65.16187322736496,12.140290119972393],[65.16186989011845,12.140312899631391],[65.16187040506439,12.140358751608547],[65.16187664742714,12.140398861689315],[65.16188367648795,12.140428424352995],[65.1619000462266,12.140448652835481],[65.16192083623508,12.140455807015112],[65.16194796164967,12.140437296061128],[65.16195535592834,12.140415360200816],[65.16196000490535,12.140390730902928],[65.16195800836354,12.140323686083182],[65.16195644502434,12.1403076267815],[65.16195159942106,12.140274839374376],[65.16194457439238,12.140245489762707],[65.1619363265414,12.140232072734605],[65.16192253885816,12.140220106969867]]]},"properties":{"featuretype":"ArealressursFlate","arealtype":"82","treslag":"98","skogbonitet":"98","grunnforhold":"98","kartstandard":"AR5","datafangstdato":"1965-07-22","verifiseringsdato":"1965-07-22","opphav":"FKB-Vann","kvalitet":{"m�lemetode":"82","n�yaktighet":1,"synbarhet":"0"},"registreringsversjon":{"produkt":"FKB-AR5","versjon":"4.5 20140301"},"identifikasjon":{"navnerom":"AR5_test23","lokalId":"0008e6eb-1332-4145-9943-591020916480","versjonId":"2019-11-11 11:57:47.371000"},"oppdateringsdato":"2019-11-12T14:02:26"},"geometry_properties":{"position":[1.0949830530113682E-4,10.51183990117714],"exterior":["-092688bb-c6ef-43c9-b6f7-41b2f065537c"]},"update":{"action":"Replace"}}]}
Jan 19, 2021 7:21:15 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logResponse
meastp commented 3 years ago

The API should (implicitly) support UTF-8 only.

Could you attach the produced body as UTF-8 that fails (along with full url and headers), please?

larsop commented 3 years ago

The API should (implicitly) support UTF-8 only.

Could you attach the produced body as UTF-8 that fails (along with full url and headers), please?

Here are the files both with utf8 and iso.

UTF8.txt iso8859.txt

Here is the logs using utf-8 and url and stack trace using utf-8


INFO: URI: https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logRequest
INFO: HTTP Method: PUT
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logRequest
INFO: HTTP Headers: Accept=[application/vnd.kartverket.ngis.attributes+json],Content-Type=[application/vnd.kartverket.ngis.attributes+json],User-Agent=[Java-SDK],Content-Length=[2863],Accept-Charset=[big5, big5-hkscs, cesu-8, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai, ibm00858, ibm01140, ibm01141, ibm01142, ibm01143, ibm01144, ibm01145, ibm01146, ibm01147, ibm01148, ibm01149, ibm037, ibm1026, ibm1047, ibm273, ibm277, ibm278, ibm280, ibm284, ibm285, ibm290, ibm297, ibm420, ibm424, ibm437, ibm500, ibm775, ibm850, ibm852, ibm855, ibm857, ibm860, ibm861, ibm862, ibm863, ibm864, ibm865, ibm866, ibm868, ibm869, ibm870, ibm871, ibm918, iso-2022-cn, iso-2022-jp, iso-2022-jp-2, iso-2022-kr, iso-8859-1, iso-8859-13, iso-8859-15, iso-8859-16, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, jis_x0201, jis_x0212-1990, koi8-r, koi8-u, shift_jis, tis-620, us-ascii, utf-16, utf-16be, utf-16le, utf-32, utf-32be, utf-32le, utf-8, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, windows-1258, windows-31j, x-big5-hkscs-2001, x-big5-solaris, x-euc-jp-linux, x-euc-tw, x-eucjp-open, x-ibm1006, x-ibm1025, x-ibm1046, x-ibm1097, x-ibm1098, x-ibm1112, x-ibm1122, x-ibm1123, x-ibm1124, x-ibm1129, x-ibm1166, x-ibm1364, x-ibm1381, x-ibm1383, x-ibm300, x-ibm33722, x-ibm737, x-ibm833, x-ibm834, x-ibm856, x-ibm874, x-ibm875, x-ibm921, x-ibm922, x-ibm930, x-ibm933, x-ibm935, x-ibm937, x-ibm939, x-ibm942, x-ibm942c, x-ibm943, x-ibm943c, x-ibm948, x-ibm949, x-ibm949c, x-ibm950, x-ibm964, x-ibm970, x-iscii91, x-iso-2022-cn-cns, x-iso-2022-cn-gb, x-iso-8859-11, x-jis0208, x-jisautodetect, x-johab, x-macarabic, x-maccentraleurope, x-maccroatian, x-maccyrillic, x-macdingbat, x-macgreek, x-machebrew, x-maciceland, x-macroman, x-macromania, x-macsymbol, x-macthai, x-macturkish, x-macukraine, x-ms932_0213, x-ms950-hkscs, x-ms950-hkscs-xp, x-mswin-936, x-pck, x-sjis_0213, x-utf-16le-bom, x-utf-32be-bom, x-utf-32le-bom, x-windows-50220, x-windows-50221, x-windows-874, x-windows-949, x-windows-950, x-windows-iso2022jp]
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logRequest
INFO: Request Body: {"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"EPSG:4258"}},"features":[{"type":"Feature","geometry":{"type":"LineString","coordinates":[[65.16192253885816,12.140220106969867],[65.1619363265414,12.140232072734605],[65.16194457439238,12.140245489762707],[65.16195159942106,12.140274839374376],[65.16195644502434,12.1403076267815],[65.16195800836354,12.140323686083182],[65.16196000490535,12.140390730902928],[65.16195535592834,12.140415360200816],[65.16194796164967,12.140437296061128],[65.16192083623508,12.140455807015112],[65.1619000462266,12.140448652835481],[65.16188367648795,12.140428424352995],[65.16187664742714,12.140398861689315],[65.16187040506439,12.140358751608547],[65.16186989011845,12.140312899631391],[65.16187322736496,12.140290119972393],[65.16188096431031,12.140257898077769],[65.16190433092325,12.140221215579803],[65.16192253885816,12.140220106969867]]},"properties":{"featuretype":"ArealressursGrense","datafangstdato":"1965-07-22","verifiseringsdato":"1965-07-22","avgrensingType":"3000","opphav":"FKB-Vann","kvalitet":{"m�lemetode":"53","n�yaktighet":200,"synbarhet":"0"},"registreringsversjon":{"produkt":"FKB-AR5","versjon":"4.5 20140301"},"identifikasjon":{"navnerom":"AR5_test23","lokalId":"092688bb-c6ef-43c9-b6f7-41b2f065537c","versjonId":"2019-11-11 11:57:47.371000"},"oppdateringsdato":"2019-11-12T14:02:26"}},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[65.16192253885816,12.140220106969867],[65.16190433092325,12.140221215579803],[65.16188096431031,12.140257898077769],[65.16187322736496,12.140290119972393],[65.16186989011845,12.140312899631391],[65.16187040506439,12.140358751608547],[65.16187664742714,12.140398861689315],[65.16188367648795,12.140428424352995],[65.1619000462266,12.140448652835481],[65.16192083623508,12.140455807015112],[65.16194796164967,12.140437296061128],[65.16195535592834,12.140415360200816],[65.16196000490535,12.140390730902928],[65.16195800836354,12.140323686083182],[65.16195644502434,12.1403076267815],[65.16195159942106,12.140274839374376],[65.16194457439238,12.140245489762707],[65.1619363265414,12.140232072734605],[65.16192253885816,12.140220106969867]]]},"properties":{"featuretype":"ArealressursFlate","arealtype":"82","treslag":"98","skogbonitet":"98","grunnforhold":"98","kartstandard":"AR5","datafangstdato":"1965-07-22","verifiseringsdato":"1965-07-22","opphav":"FKB-Vann","kvalitet":{"m�lemetode":"82","n�yaktighet":1,"synbarhet":"0"},"registreringsversjon":{"produkt":"FKB-AR5","versjon":"4.5 20140301"},"identifikasjon":{"navnerom":"AR5_test23","lokalId":"0008e6eb-1332-4145-9943-591020916480","versjonId":"2019-11-11 11:57:47.371000"},"oppdateringsdato":"2019-11-12T14:02:26"},"geometry_properties":{"position":[1.0949830530113682E-4,10.51183990117714],"exterior":["-092688bb-c6ef-43c9-b6f7-41b2f065537c"]},"update":{"action":"Replace"}}]}
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logResponse
INFO: HTTP Status Code: 500
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logResponse
INFO: Status Text: Internal Error
Jan 21, 2021 8:58:25 AM ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor logResponse
INFO: HTTP Headers: Server=[Microsoft-HTTPAPI/2.0],Access-Control-Expose-Headers=[Content-Range,Link,X-Client-Product-Version],Date=[Thu, 21 Jan 2021 07:58:24 GMT],Content-Length=[0]
org.springframework.web.client.ResourceAccessException: I/O error on PUT request for "https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes": Server returned HTTP response code: 500 for URL: https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes; nested exception is java.io.IOException: Server returned HTTP response code: 500 for URL: https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes  at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628)   at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)  at ngis.openapi.client.client.invoker.ApiClient.invokeAPI(ApiClient.java:527)   at ngis.openapi.client.client.api.FeaturesApi.updateDatasetFeatureAttributes(FeaturesApi.java:288)  at nibio.ngis.openapi.client.TestNgisAr5.getDatasetUpdate_arealtype(TestNgisAr5.java:251)   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567)   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)    at org.apache.maven.surefire.junitcore.ClassDemarcatingRunner.run(ClassDemarcatingRunner.java:58)   at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27)  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363)    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)   at org.junit.runner.JUnitCore.run(JUnitCore.java:115)   at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:62)   at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:139) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567)   at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)   at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)  at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)    at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1963)    at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1958)    at java.base/java.security.AccessController.doPrivileged(AccessController.java:551) at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1957)   at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1525)   at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)    at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:246)  at org.springframework.http.client.SimpleClientHttpResponse.getBody(SimpleClientHttpResponse.java:85)   at org.springframework.http.client.BufferingClientHttpResponseWrapper.getBody(BufferingClientHttpResponseWrapper.java:69)   at ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor.logResponse(ApiClient.java:621) at ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor.intercept(ApiClient.java:606)   at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:86)    at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:70) at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)   at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:652) ... 45 moreCaused by: java.io.IOException: Server returned HTTP response code: 500 for URL: https://qmsrest.westeurope.cloudapp.azure.com:8080/v1/datasets/1b3174b9-98bc-44ec-a8c0-a7c949d5a683/features/0008e6eb-1332-4145-9943-591020916480/attributes    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1913)   at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)    at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:330) at org.springframework.http.client.SimpleClientHttpResponse.getRawStatusCode(SimpleClientHttpResponse.java:52)  at org.springframework.http.client.BufferingClientHttpResponseWrapper.getRawStatusCode(BufferingClientHttpResponseWrapper.java:53)  at ngis.openapi.client.client.invoker.ApiClient$ApiClientHttpRequestInterceptor.logResponse(ApiClient.java:618) ... 51 moreTests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.699 sec
meastp commented 3 years ago

hi - I think the issue is the contents of the body (not the encoding).

When PUTing the .../attributes endpoint, you should only pass the attributes as the body (i.e. the contents of doc["features"]]0]["properties"] in your example.

Try this, and see if that works.

larsop commented 3 years ago

Thanks yes this works.

Whats happens if the lokalId used when calling featuresApi.updateDatasetFeatureAttributes(bbody , datasetId, lokalId); and the body are different

{"arealtype":"81","datafangstdato":"1965-07-22","featuretype":"ArealressursFlate","grunnforhold":"98","identifikasjon":{"lokalId":"0008e6eb-1332-4145-9943-591020916480","navnerom":"AR5_test23","versjonId":"2019-11-11 11:57:47.371000"},"kartstandard":"AR5","kvalitet":{"målemetode":"82","nøyaktighet":1,"synbarhet":"0"},"oppdateringsdato":"2019-11-12T14:02:26","opphav":"FKB-Vann","registreringsversjon":{"produkt":"FKB-AR5","versjon":"4.5 20140301"},"skogbonitet":"98","treslag":"98","verifiseringsdato":"1965-07-22"}