on 08-19-2009 1:31 PM
Hi There,
I am searching for a way to perform a Soap call with attachment. Is there anyone out there who has done that without using PI?
Iu2019ve transferred a WSDL into an ABAP proxy and I ran into a problem.
SAP system 700 SAP Basis Component SAPKB70014
Iu2019ve tried to get it working but when the attachment is added the request gets an error.
Error code: SOAP:1.007
Error text : SRT: Unsupported xstream found: ("HTTP Code 500 : Internal Server Error")
Iu2019ve no idea if it is possible to to that without PI on the other handu2026. Why not?
So if anyone has done such a thing please respond to this thread.
Kind regards
Michiel Veenemans.
This is the code I use to do the call .
&----
*& Report /HIQ/CALL_PROXY
*&
&----
*&
*&
&----
REPORT /hiq/call_proxy_dataimprover.
DATA: ls_request TYPE /hiq/s6diimprove_data_request,
ls_response TYPE /hiq/s6diimprove_data_response.
DATA: lo_clientproxy TYPE REF TO /hiq/co_s6didata_improver_port,
lo_fault TYPE REF TO cx_ai_system_fault,
tp_lp TYPE prx_logical_port_name.
DATA: ld_code TYPE string,
ld_text TYPE string.
DATA: attachment_protocol TYPE REF TO if_wsprotocol_attachments,
attachment TYPE REF TO if_ai_attachment,
attachments TYPE prx_attach,
attach_xstring TYPE xstring,
attach_string TYPE string.
constants: co_type_octet type string value 'application/octet-stream'.
DATA: BEGIN OF wa_itab,
raw(255) TYPE x,
line type string,
END OF wa_itab,
itab LIKE TABLE OF wa_itab,
tp_filename TYPE string.
PARAMETERS: pa_lp TYPE text100 OBLIGATORY DEFAULT '/HIQ/LP_SUITE6_DI',
pa_cont TYPE text100 DEFAULT '1',
pa_enc TYPE text100 DEFAULT 'UTF-8',
pa_name TYPE text100 DEFAULT 'C:\Customers_NL.csv',
pa_bds TYPE text100 DEFAULT 'auto3'.
START-OF-SELECTION.
tp_lp = pa_lp.
tp_filename = pa_name.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filetype = 'BIN'
filename = tp_filename
TABLES
data_tab = itab.
LOOP AT itab INTO wa_itab.
CONCATENATE attach_xstring wa_itab-raw INTO attach_xstring
IN BYTE MODE.
ENDLOOP.
*ls_request
**SOURCE_PROPS_LIST
DATA: wa_source_props_list LIKE LINE OF ls_request-source_props_list.
wa_source_props_list-content_id = pa_cont.
wa_source_props_list-encoding = pa_enc.
wa_source_props_list-name = pa_name.
APPEND wa_source_props_list TO ls_request-source_props_list.
**BDS_NAME
ls_request-bds_name = pa_bds.
**OPTIONS
DATA: wa_options LIKE LINE OF ls_request-options.
wa_options-key = 'skipIdentifyCreate'.
wa_options-value = 'true'.
APPEND wa_options TO ls_request-options.
wa_options-key = 'skipIdentifyBuild'.
wa_options-value = 'true'.
APPEND wa_options TO ls_request-options.
wa_options-key = 'skipDedup'.
wa_options-value = 'true'.
APPEND wa_options TO ls_request-options.
CREATE OBJECT lo_clientproxy
EXPORTING
logical_port_name = tp_lp.
BREAK-POINT.
TRY.
*get attachment protocol
attachment_protocol ?= lo_clientproxy->get_protocol(
if_wsprotocol=>attachments ).
attachment = attachment_protocol->get_attachment_from_binary(
data = attach_xstring
type = co_type_octet
name = '1' ).
APPEND attachment TO attachments.
attachment_protocol->set_attachments( attachments ).
CALL METHOD lo_clientproxy->improve_data
EXPORTING
input = ls_request
IMPORTING
output = ls_response.
**report**
***
CATCH cx_ai_system_fault INTO lo_fault.
ld_code = lo_fault->code.
ld_text = lo_fault->errortext.
ENDTRY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I always used PI for SOAP+attachment and not sure if it works without PI as many extensions are not supported by SAP and other webservices.
See this from IBM: http://www.ibm.com/developerworks/webservices/library/ws-soapatt/
Post how you are trying to do it then may be we can explore.
Regards,
Gourav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.