cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Gateway Media Resource Upload Problem

metagross
Explorer
0 Kudos
417

Dear colleagues,

I am facing a problem with an attachment upload via OData service which I would kindly ask you to have a look upon and problably help with solving it.

Gateway-Service:

Entity Type:

Properties:

Entity Set:

Service Implementation:

CLASS zcl_zp_iinventar_attac_mpc_ext DEFINITION
  PUBLIC
  INHERITING FROM zcl_zp_iinventar_attac_mpc
  CREATE PUBLIC .
  PUBLIC SECTION.
    METHODS define REDEFINITION.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.
CLASS zcl_zp_iinventar_attac_mpc_ext IMPLEMENTATION.
  METHOD define.
    DATA: lo_entity_type     TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
          lo_entity_property TYPE REF TO /iwbep/if_mgw_odata_property,
          lo_annotation      TYPE REF TO /iwbep/if_mgw_odata_annotation.

    BREAK-POINT ID zp_inventory_itmcrea_chkgrp.
    super->define( ).
    lo_entity_type = model->get_entity_type( me->gc_attachment ).
    lo_entity_type->set_is_media( ).
    lo_entity_property = lo_entity_type->get_property(         zcl_zp_iinventar_infra_attach=>co_property_attachm_content ).
    lo_entity_property->set_as_content_source( ).
    lo_entity_property = lo_entity_type->get_property(         zcl_zp_iinventar_infra_attach=>co_property_attachm_type ).
    lo_entity_type->get_property(         zcl_zp_iinventar_infra_attach=>co_property_attachm_type )->set_as_content_type( ).
  ENDMETHOD.
ENDCLASS.

Gateway Client:

Request:

Debugging showing the problem:

The problem seems to be found in Method /iwcor/if_ds_svc_proc~get_supported_formats where according to variable iv_processor_type = 11 the above listed formats are collected:

I think that this is the reason for the now following problem in Method /iwcor/cl_ds_proc_dispatcher→validate_content_type which doesn't find actual content type 'application/pdf' in the allowed ones.

This results in the following error response in the Gateway client:

Any hint or help is more than appreciated!

Thank you all very much for your time and kind efforts!

Best Regards,

Thomas

Accepted Solutions (0)

Answers (0)