on 10-19-2014 5:47 PM
Hello Arshad,
The URL you are using is wrong. It should point to the EntitySet. In this case it should be /<YOURSERVICENAME>/EmpPhotoSet.
You need to send a HTTP header called 'SLUG' with the key information. This value you will receive in the CREATE_STREAM method under IV_SLUG parameter. This will be needed to put the image to the correct employee in the backend database tables as there is no other direct mechanism to pass the key information along with the media.
Something like this....
And finally, checking the media flag in service builder and redefining CREATE_STREAM is not sufficient to make it work !!! You need to code 3 lines to enable gateway runtime to handle it. This can be found in blog by Rashmi BR . That means you need to redefine the DEFINE method of your DPC_EXT and do some code similar to the code available for DEFINE under link
If everything is ok so far, you are good to go.
Hope this helps.
Atanu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This means you are on track now... This is a different error related to virus scan profile setting.
This is for you http://help.sap.com/saphelp_nw74/helpdata/en/b5/5d22518bc72214e10000000a44176d/content.htm
Hello Arshad,
Here your issue resolved i guess...
Now I'm also facing same issue when create file.
I have written code in create_tream method, but I'm getting 'Method not allowed' error(not triggering method).
And where do i pass slug value.
here is my create_stream method.
Kindly, could you please provide me you did that service step by step procedure.
Regards,
Siva R.
Hi Shiva..
You go through with below link for simple operations with media n all..
For SLUG Click on Add Header in HTTP Request.. and add slug Parameter..
CREATE MEDIA
-------------------------------ZEMP_PRO_SRV/EmpPhotoSet
method DEFINE.
super->DEFINE( ).
DATA:
lo_entity type REF TO /IWBEP/IF_MGW_ODATA_ENTITY_TYP,
lo_property type REF TO /IWBEP/IF_MGW_ODATA_PROPERTY.
lo_entity = model->GET_ENTITY_TYPE( IV_ENTITY_NAME = 'EmpPhoto' ).
IF lo_entity is BOUND.
lo_property = lo_entity->GET_PROPERTY( IV_PROPERTY_NAME = 'MIMETYPE' ).
lo_property->SET_AS_CONTENT_TYPE( ).
ENDIF.
endmethod.
method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_STREAM.
DATA: ls_key_tab TYPE /iwbep/s_mgw_name_value_pair,
lt_key_tab TYPE /iwbep/t_mgw_name_value_pair,
ls_photo TYPE zsemp_photo,
lv_email TYPE char100.
CASE iv_entity_name.
WHEN 'EmpPhoto'.
READ TABLE it_key_tab WITH KEY name = 'EMP_ID' INTO ls_key_tab.
ls_photo-emp_id = iv_slug.
ls_photo-mimetype = is_media_resource-mime_type.
ls_photo-filename = 'Test_img'.
ls_photo-content = is_media_resource-value.
DELETE FROM zemp_photos WHERE emp_id = ls_photo-emp_id.
INSERT INTO zemp_photos VALUES ls_photo.
empphotoset_get_entity(
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
it_key_tab = it_key_tab
it_navigation_path = it_navigation_path
IMPORTING
er_entity = ls_photo ).
copy_data_to_ref( EXPORTING is_data = ls_photo
CHANGING cr_data = er_entity ).
ENDCASE.
endmethod.
Regards,
Arshad Shaikh..
Thanks for your response Arshad..
I followed every step as you said that.
I have been passed slug value. When execute service triggering create_streem method.
But here slug values's tab "it_key_tab" is shows empty. Why it is not filling.
and finally I am getting this error.
This is my define method.
Regards,
Siva R.
Hi all,
I'm struggling with photo upload in SAP gateway service.
Could you please provide me step by step procedure of photo upload in SAP gateway service.
Regards,
Siva R.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arshad,
Check this blog by
Problem seems to be with your URI.
As Prabhaharan pointed out, make it a practice to search the forums before posting, that would help to keep the forum clutter free.
Regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi arshad,
Please do a quick search in this forum on this topic. You will step by step guides. This will address your issues.
Regards
Prabaharan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.