【问题标题】:OData post using odata4j missing "category" element使用 odata4j 的 OData 帖子缺少“类别”元素
【发布时间】:2011-09-15 20:34:55
【问题描述】:

我正在尝试使用 odata4j 发布 Odata 帖子。转储发布的 xml 数据后,我使用 curl 将其复制到 php 脚本中,以进行测试。我发现 xml 帖子缺少帖子所需的“类别”元素。

我似乎无法找出合适的方法,查看 odata4j javadocs,以便能够在实体结构中创建此元素。

对此有什么想法吗?我已经发布了我的代码的稍微简化的版本。

// 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();

【问题讨论】:

    标签: java android odata odata4j


    【解决方案1】:

    0.4 版本中没有用于此的 api。

    一种可能的解决方法是创建自定义 OClientBehavior 并在请求条目消息发出时对其进行破解。见http://code.google.com/p/odata4j/wiki/Extensibility

    我们将在下一个版本中简化此操作。通过http://code.google.com/p/odata4j/issues/detail?id=48跟踪

    希望对您有所帮助,
    - 约翰

    【讨论】:

      猜你喜欢
      • 2013-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      • 2011-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多