Perfect, the server log analysis confirmed the issue - your custom attributes aren’t registered in the REST resource schema. Let me walk through all three critical areas: REST resource mapping, API schema updates, and proper server log analysis for troubleshooting.
First, understand REST resource mapping. ENOVIA’s REST API doesn’t automatically expose all object attributes. It uses explicit resource mapping files that define which attributes are accessible through the API and how they’re serialized. These mapping files are located in <install>/Windchill/codebase/rest/config/resources/. For supplier objects, you’ll need to modify or extend the supplier resource definition.
Second, update the API schema for your custom attributes. Create or modify the supplier resource mapping XML file (supplier-resource.xml):
<Resource type="Supplier">
<Attribute name="certificationLevel" type="string"/>
<Attribute name="performanceScore" type="double"/>
</Resource>
This registers your custom attributes with the REST API framework. However, you also need to ensure the attributes are included in the update operation’s allowed fields. In the same resource file, locate or add the update operation definition:
<Operation name="update" method="PUT">
<AllowedAttributes>
<Attribute name="certificationLevel"/>
<Attribute name="performanceScore"/>
</AllowedAttributes>
</Operation>
Without this explicit declaration, the REST endpoint won’t accept these attributes in PUT requests even though they exist in the object model.
Third, proper server log analysis is crucial for diagnosing REST API issues. The generic 500 error masks the real problem. Enable detailed REST API logging by adding this to your log4j configuration:
log4j.logger.com.ptc.windchill.rest=DEBUG
This provides detailed traces of REST request processing, including attribute mapping failures, validation errors, and serialization issues. When analyzing logs, look for these patterns:
- “Attribute X not found in resource schema” - Missing resource mapping
- “Validation failed for attribute Y” - Constraint violation
- “Permission denied for operation Z” - Authorization issue
- “Serialization error for type T” - Data type mismatch
For your specific case, the complete solution involves several steps:
-
Update resource mapping: Modify supplier-resource.xml to include certificationLevel and performanceScore attributes with correct data types
-
Register custom serializers: If your custom attributes use complex data types (not simple strings/numbers), you may need custom serializers:
public class SupplierAttributeSerializer {
public String serialize(Object value) {
// Convert custom type to JSON-compatible format
}
}
-
Update API schema documentation: Regenerate the REST API schema to include your custom attributes. Run the schema generator utility: `windchill com.ptc.windchill.rest.util.SchemaGenerator
-
Clear API cache: ENOVIA caches resource definitions, so after updating the mapping files, clear the REST API cache through the admin console or by restarting the application server
-
Test with detailed logging: Make a test PUT request with logging enabled and verify that your custom attributes are now recognized and processed
The reason UI updates work while REST updates fail is that the UI uses ENOVIA’s internal object APIs that have full access to all attributes regardless of resource mapping. The REST API layer adds an abstraction that requires explicit attribute registration for security and schema validation purposes.
Additional considerations for your nightly automation:
- Implement proper error handling to catch 500 errors and log the full response body
- Use the REST API’s batch update endpoint if updating multiple suppliers to improve performance
- Consider implementing retry logic with exponential backoff for transient failures
- Monitor the application server’s memory and thread pool during bulk updates to avoid resource exhaustion
After implementing these changes, your supplier portal integration should successfully update certification tracking and performance metrics through the REST API. The key is ensuring that every custom attribute you want to update via REST is explicitly declared in the resource mapping files and included in the update operation’s allowed attributes list.
This draft is based on general ENOVIA knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.