cancel
Showing results for 
Search instead for 
Did you mean: 

Generated Service consumer proxy does not pass value 0

0 Kudos

Hello Experts,

I created a Service Consumer proxy from a WSDL file, which defined an element as optional (minOccurs="0").

Unless I send value "0", I can call the webservice using the generated proxy-method without any problem, But when I call the proxy-method with value "0", then it skips the element completely from the generated XML. If I remove the optional attribute (minoccurs="0") from the WSDL, then I can pass the value "0" to the XML.

Do you have any suggestion, how could I pass the value "0" to an optional integer (type="xsd:int")?

Best regards,

Peter

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member396042
Discoverer
0 Kudos

Hi murkesz,

Have you found a solution for the issue? I am facing the same problem...

/edit/

Solution found at https://www.sapalles.com/2017/12/29/call-abap-consumer-service-without-removing-empty-tags-which-has...

Check sample code below:

DATA lr_service TYPE REF TO zcl_outbound_service.
DATA ls_in TYPE zcl_outbound_service_input.
DATA ls_out TYPE zcl_outbound_service_output.
DATA lr_payload_protocol TYPE REF TO if_wsprotocol_payload.
DATA lt_controller TYPE PRXCTRLTAB.
DATA ls_controller TYPE PRXCTRL.
 
lr_payload_protocol ?= lr_sms->get_protocol( if_wsprotocol=>payload ).
CALL METHOD lr_payload_protocol->set_extended_xml_handling( abap_true ).
 
ls_controller-field = 'PHONE'.
ls_controller-value = sai_ctrl_initial. " This will send initial value
append ls_controller to ls_in-controller.
   
ls_controller-field = 'EMAIL'.
ls_controller-value = sai_ctrl_initial. " This will send initial value
append ls_controller to ls_in-controller.
 
TRY.
	CALL METHOD lr_sms->search_log_operation
		EXPORTING
        search_log_operation_request  = ls_in
        IMPORTING
        search_log_operation_response = ls_out.
CATCH cx_root INTO lr_excep.
	MESSAGE lr_excep->get_text( ) TYPE 'E'.
ENDTRY.