on 2019 Mar 13 11:08 AM
I am configuring an INBOUND Web Service to expose an ItemType derived from VariantProduct with the Integration UI Tool / Integration API based on OData in SAP Commerce 18.11 (odata2webservices). I configured the attribute "baseProduct" to be exposed / delivered by the service, e.g.:
INSERT_UPDATE IntegrationObjectItemAttribute; integrationObjectItem(integrationObject(code), code)[unique = true]; attributeName[unique = true]; attributeDescriptor(enclosingType(code), qualifier); returnIntegrationObjectItem(integrationObject(code), code); unique[default = false]; autoCreate[default = false]
...
; MYService:MYItemType ; baseProduct ; MYItemType:baseProduct ; MYService:Product ; ;
I expected that I can retrieve Items of this type in a GET request. Actually I get the following error as response:
<?xml version='1.0' encoding='UTF-8'?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>runtime_error</code>
<message xml:lang="en">There was a problem with the retrieval of the requested [MYItemType].</message>
</error>
In the log the following exception is written:
ERROR [hybrisHTTP9] [DefaultODataProcessor] No attribute with qualifier baseProduct found.
de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException: No attribute with qualifier baseProduct found.
at de.hybris.platform.servicelayer.type.impl.DefaultTypeService.getAttributeDescriptor(DefaultTypeService.java:201) ~[coreserver.jar:?]
at de.hybris.platform.odata2services.odata.persistence.populator.processor.AbstractPropertyProcessor.getAttributeDescriptor(AbstractPropertyProcessor.java:120) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.populator.processor.AbstractPropertyProcessor.readPropertyValue(AbstractPropertyProcessor.java:92) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.populator.processor.AbstractPropertyProcessor.processEntity(AbstractPropertyProcessor.java:79) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.populator.DefaultEntityModelPopulator.populateEntity(DefaultEntityModelPopulator.java:54) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService.getODataEntry(DefaultModelEntityService.java:95) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.impl.DefaultPersistenceService.toODataEntry(DefaultPersistenceService.java:121) ~[classes/:?]
at de.hybris.platform.odata2services.odata.persistence.impl.DefaultPersistenceService.lambda$0(DefaultPersistenceService.java:107) ~[classes/:?]
I also get this error if I expose the ItemType VariantProduct directly to a Web Service and add the attribute baseProduct:

Request clarification before answering.
It must a be bug in the IO modeling UI. The generated impex is not valid. The problem is in attributeDescriptor column. It contains value MYItemType:baseProduct but it should be VariantProduct:baseProduct.
attritributeDescriptor refers to an attribute descriptor in the type system and first half of the value is a type in the type system. Of course, MYItemType does not exist in the type system - it's a name (code) of the integration object item; the type system type is called VariantProduct
As possible workaround you could either modify the impex generated in the UI and then import it manually, skipping the UI. Or don't customize the type name for the integration object item and leave it called VariantProduct instead of MYItemType
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.