JSON parse error: Can not set com.google.api.services.androidmanagement.v1.model.KioskCustomization field - android-management-api

Issue while creating Policy In Android Management API,Iam Using Spring Boot as BackEnd.
this is my request:
{
"name": "testpolicy",
"applications": [
{
"packageName": "com.adobe.reader",
"installType": "REQUIRED_FOR_SETUP",
"defaultPermissionPolicy": "GRANT"
}
],
"kioskCustomization":{
"powerButtonActions": "POWER_BUTTON_ACTIONS_UNSPECIFIED",
"systemErrorWarnings": "SYSTEM_ERROR_WARNINGS_UNSPECIFIED",
"systemNavigation": "SYSTEM_NAVIGATION_UNSPECIFIED",
"statusBar": "STATUS_BAR_UNSPECIFIED",
"deviceSettings": "DEVICE_SETTINGS_UNSPECIFIED"
},
"kioskCustomLauncherEnabled": true
}
This is my response:
JSON parse error: Can not set com.google.api.services.androidmanagement.v1.model.KioskCustomization field com.google.api.services.androidmanagement.v1.model.Policy.kioskCustomization to java.util.LinkedHashMap; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not set com.google.api.services.androidmanagement.v1.model.KioskCustomization field com.google.api.services.androidmanagement.v1.model.Policy.kioskCustomization to java.util.LinkedHashMap (through reference chain: com.google.api.services.androidmanagement.v1.model.Policy["kioskCustomization"])
code written in the controller:
#PostMapping("/policies")
public ResponseEntity<com.google.api.services.androidmanagement.v1.model.Policy> savePolicy(
#RequestBody Policy policy, #RequestParam String enterpriseId) throws Exception {
}
control is not even coming inside the controller

I tried your request in Quickstart and did not encounter any error, the cause of your error may come from your implementation (Parser being used, or the format when typed) , I suggest that you try your request in quickstart to confirm that there is nothing wrong with your request.
Also you can check this documentation for a sample app that demonstrates how to provision a corporate-owned, single-use (COSU) device, and send it a reboot command. The app uses the Android Management API Java client library.

Related

PCEP-SR draft version 6, SR Explicit Route Object/Record Route Object subobjects

I am setting up Segment routing via Pathman-SR with ODL Nitrogen Controller and vMX Juniper routers. To allow this, I have to change IANA subojbects code points, but I am unable to do it...
Followed this documenntations, but still no result:
https://docs.opendaylight.org/en/stable-carbon/user-guide/pcep-user-guide.html#segment-routing
https://test-odl-docs.readthedocs.io/en/latest/user-guide/pcep-user-guide.html
I tried to update configuration via REST API, but when I send PUT request:
/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-app-config
with the body:
<pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
<iana-sr-subobjects-type>true</iana-sr-subobjects-type>
</pcep-segment-routing-config>
I get the following error:
{
"errors": {
"error": [
{
"error-type": "protocol",
"error-tag": "invalid-value",
"error-message": "URI has bad format. Possible reasons:\n 1. \"pcep-segment-routing-app-config:pcep-segment-routing-app-config\" was not found in parent data node.\n 2. \"pcep-segment-routing-app-config:pcep-segment-routing-app-config\" is behind mount point. Then it should be in format \"/yang-ext:mount/pcep-segment-routing-app-config:pcep-segment-routing-app-config\"."
}
]
}
}
I think there is a typo in the URL in the doc, you have to use /restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-config
You can check this guide for reference:
https://docs.opendaylight.org/projects/bgpcep/en/stable-neon/pcep/pcep-user-guide-active-stateful-pce.html#iana-code-points

Consuming SalesOrderItem API using S/4HANA SDK

I am trying to get all SalesOrderItems using the
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultSalesOrderService
class provided by S/4HANA SDK but the response is always an empty list and in logs I see this error:
c.s.c.s.odatav2.connectivity.ODataQuery : Failed to convert response into ODataFeed: Illegal argument for method call with message 'to_ValueAddedService'.
Mention: The latest version of the SDK is used - 2.9.1 - and the version of the S/4HANA system is 1902.
This is a response example:
{
"d":{
"results":[
{
"__metadata":{
"id":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')",
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')",
"type":"API_SALES_ORDER_SRV.A_SalesOrderItemType"
},
"SalesOrder":"1",
"SalesOrderItem":"10",
"HigherLevelItem":"0",
"SalesOrderItemCategory":"",
"SalesOrderItemText":"Trading Goods Testing",
"PurchaseOrderByCustomer":"test 1",
"Material":"HAWA1",
"MaterialByCustomer":"",
"PricingDate":"\/Date(1547769600000)\/",
"RequestedQuantity":"10",
"RequestedQuantityUnit":"PC",
"ItemGrossWeight":"1.000",
"ItemNetWeight":"1.000",
"ItemWeightUnit":"KG",
"ItemVolume":"0.000",
"ItemVolumeUnit":"",
"TransactionCurrency":"",
"NetAmount":"1000000",
"MaterialGroup":"A001",
"MaterialPricingGroup":"",
"Batch":"",
"ProductionPlant":"",
"StorageLocation":"",
"DeliveryGroup":"0",
"ShippingPoint":"",
"ShippingType":"",
"DeliveryPriority":"1",
"IncotermsClassification":"",
"IncotermsTransferLocation":"",
"IncotermsLocation1":"",
"IncotermsLocation2":"",
"CustomerPaymentTerms":"",
"SalesDocumentRjcnReason":"",
"ItemBillingBlockReason":"",
"WBSElement":"",
"ProfitCenter":"",
"ReferenceSDDocument":"",
"ReferenceSDDocumentItem":"0",
"SDProcessStatus":"A",
"DeliveryStatus":"A",
"OrderRelatedBillingStatus":"",
"YY1_DownPaymentReferen_SDI":"1400000013",
"to_Partner":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_Partner"
}
},
"to_PricingElement":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_PricingElement"
}
},
"to_SalesOrder":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_SalesOrder"
}
},
"to_ScheduleLine":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_ScheduleLine"
}
},
"to_Text":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_Text"
}
},
"to_ValueAddedService":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_ValueAddedService"
}
}
}
]
}
}
It is an issue with the Sales Order API on SAP S/4HANA Cloud side. The to_ValueAddedService navigational property is not declared in the $metadata, however it appears on the A_SalesOrderItem OData EDM Entity and is not working. SAP S/4HANA Cloud colleagues are already looking into the incident.
Using .select() before executing the request bypasses this issue but this is not a long term solution. This needs to be fixed internally in the SDK.

How to set a base url in a springboot graphql app

How can we set a base url in springboot graphql-server app .
By default the graphiql api-console opens on http://localhost:8080/graphiql
Trying to access http://localhost:8080 through postman with a post -query as below :
{
bookings {
name
}
}
gives an error saying :
{
"timestamp": 1549913598497,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/"
}
Q1 what should be the path to the server i should be using to invoke it.
Q2 is there a way to provide a custom base path something loke http://localhost:8080/service/api/query
Usually the server path for graphql endpoints is at http://localhost:8080/graphql. If not just inspect the network tab on your browser when you run a query on your GraphiQL interface, it will run the query on the api endpoint.
In order to change the base path you would need to change application.properties into something like:
graphql.servlet.mapping: /service/api/query
graphiql.mapping: /graphiql
graphiql.endpoint: /service/api/query
If you are using Spring Boot Property file you can change the base url like below:
spring.graphql.path=/service/api/query
Example:
When I changed the base url like below.:
spring.graphql.path=/api/projects/graphql
It reflected like below in console:
2022-11-05 08:58:14.964 INFO 17336 --- [ main] s.b.a.g.s.GraphQlWebMvcAutoConfiguration : GraphQL endpoint HTTP POST /api/projects/graphql
More can be found at below official document:
https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#appendix.application-properties.web

Failure connecting to S/4 Hana via Cloud SDK

I'm following the OData tutorial at https://blogs.sap.com/2017/05/21/step-4-with-sap-s4hana-cloud-sdk-calling-an-odata-service/comment-page-1/ and I'm getting an error when I try to retrieve business partners using DefaultBusinessPartnerService.
The relevant piece of code is:
DefaultBusinessPartnerService businessPartnerService = new DefaultBusinessPartnerService();
System.err.println("criated default business partner");
List<BusinessPartner> partners = businessPartnerService
.getAllBusinessPartner()
.select(BusinessPartner.BUSINESS_PARTNER,
BusinessPartner.LAST_NAME,
BusinessPartner.FIRST_NAME)
//.filter(BusinessPartner.BUSINESS_PARTNER_CATEGORY.eq(CATEGORY_VENDOR))
.orderBy(BusinessPartner.LAST_NAME, Order.ASC)
.execute(new ErpEndpoint(new ErpConfigContext()));
response.setContentType("application/json");
response.getWriter().write(new Gson().toJson(partners));
My ErpQueryEndpoint configuration is as follows:
#Mon May 14 15:27:09 BRT 2018
URL=https\://host\:port
Name=ErpQueryEndpoint
TrustAll=TRUE
Type=HTTP
Password=Password
Authentication=BasicAuthentication
User=Username
Where host, port, Username and Password have been replaced by the correct values.
When I query http://localhost:8080/s4integration-application/businesspartners I get the following error:
The endpoint responded with HTTP error code 403.
No service found for namespace , name API_BUSINESS_PARTNER, version 0001
Full error message:
{
"error": {
"code": "/IWFND/MED/170",
"message": {
"lang": "en",
"value": "No service found for namespace , name API_BUSINESS_PARTNER, version 0001"
},
"innererror": {
"application": {
"component_id": "",
"service_namespace": "/SAP/",
"service_id": "API_BUSINESS_PARTNER",
"service_version": "0001"
},
"transactionid": "C83CB3D2A1420000E005AF97B0836AD5",
"timestamp": "20180514182746.3576100",
"Error_Resolution": {
"SAP_Transaction": "Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (System Alias ) and search for entries with the timestamp above for more details",
"SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
},
"errordetails": []
}
}
}
It seems that the endpoint is not configured on the SAP system (it's an S/4 Hana system). I'm not sure if I have to add something else to the URL besides the host and port or if there is some other configuration that has to be done on the SAP system.
Instructions for activating OData APIs from the SAP S/4HANA backend can be found here: help.sap.com/viewer/cdc25c83b63e482586b31b8acd49cf2f/1610%20003/… Just ignore the notion of the Fiori app.

Kony service giving 1012 opstatus Request failed error and not giving response

I have a kony sample app where I am trying to do a build and the app has one web service in it for fetching categories of some product. I have the following code also that I wrote:
function GetCategories() {
var inputparam = {
"appID": "bbuy",
"serviceID": "GetCategories",
"catId": "cat00000",
"channel": "rc",
"httpheaders": {}
};
kony.net.invokeServiceAsync("http://192.168.42.134/middleware/MWservlet",inputparam, serv_GetCategoriesCallback);
}
I am getting no response for this. Getting 1012 opstatus and the message is saying "Request failed" error.
kony.net.invokeServiceAsync("http://192.168.42.134/middleware/MWservlet",inputparam, serv_GetCategoriesCallback);
In the above line, you have not given the port number in the MWservlet URL.(e.g. 8080) Give that and check.
Also, make sure all input params are being fed to the service and that they correspond to the exact naming convention followed in the service editor.
Visit :
Find the below link. i hope it gives you a solution
http://developer.kony.com/twiki/pub/Portal/Docs/API_Reference/Content/Network_APIs.htm#net.invo2
Check the mandatory and optional fields of Inputparam

Resources