我正在尝试使用odata4j创建Odata post。在转储发布的xml数据之后,我使用curl将其复制到一个php脚本中进行测试。我发现xml post缺少post所需的"category“元素。
看着odata4j javadoc,我似乎找不出合适的方法来在实体结构中创建这个元素。
对此有什么想法吗?我已经发布了我的代码的一个稍微简化的版本。
// create the new request object
OCreateRequest<OEntity> createRequest = consumer.createEntity( "ESvcOrderTrans" )
.properties( OProperties.int32( cursorWrapper.getColumnName(0), cursorWrapper.getInt(0))
.properties( OProperties.string( cursor.getColumnName(1), cursor.getString(1) ));
// Execute the OData post
OEntity newMaterial = createRequest.execute();发布于 2011-06-20 07:08:26
0.4版本中没有用于此功能的api。
一种可能的解决方法是创建自定义OClientBehavior,并在请求条目消息发出时对其进行处理。请参阅http://code.google.com/p/odata4j/wiki/Extensibility
我们将在下一个版本中使这一点变得更容易。通过http://code.google.com/p/odata4j/issues/detail?id=48跟踪
希望这能有所帮助,
https://stackoverflow.com/questions/6363625
复制相似问题