cancel
Showing results for 
Search instead for 
Did you mean: 

Consume External Web Service from ABAP

Former Member
0 Kudos

Hello All,

I have a Web Service existing on a Non R/3 system.

I want to access this Web Service from my Development system (SAP 6.40).

I created a Client Proxy pointing to this WSDL named "ZUSER_ARS_EXCHANGECO_UPDATE".

I have created an FM to call this Web Service and update the data to it with the following code ->

DATA: lv_proxy TYPE REF TO zuser_ars_exchangeco_update,
        ws_header TYPE REF TO if_wsprotocol_ws_header,
        sys_fault TYPE REF TO cx_ai_system_fault,
        appl_fault TYPE REF TO cx_ai_application_fault,
        lv_request TYPE zuser_ars_exchangecreate_soap1,
        lv_response TYPE zuser_ars_exchangecreate_soap.

  TRY.
      CREATE OBJECT lv_proxy
      EXPORTING
        logical_port_name = 'TO_ARS'
          .
    CATCH cx_ai_system_fault .
  ENDTRY.

  MOVE-CORRESPONDING ip_userdata TO lv_request-parameters.

  TRY.
      CALL METHOD lv_proxy->create
        EXPORTING
          input  = lv_request
        IMPORTING
          output = lv_response.
    CATCH cx_ai_system_fault INTO sys_fault.
      IF sys_fault IS NOT INITIAL.
        RAISE proxy_create_system_fault.
      ENDIF.
    CATCH cx_ai_application_fault INTO appl_fault.
      IF appl_fault IS NOT INITIAL.
        RAISE proxy_create_appl_fault.
      ENDIF.
  ENDTRY.

But when I am trying to execute, I am getting the error "cx_ai_system_fault " with the following Error Text -> "ARERR [149] Im Steuerungsdatensatz muss ein Benutzername angegeben werden." When translated to English, using Google, it is "ARERR [149] The control record must be a user name."

The WSDL has a line as follows -> soap:header message="s0:ARAuthenticate"

How do I pass the username and password to this "ARAuthenticate" parameter?

Can someone please help me in getting this fixed?

Thanks and Regards

Gladson Jacob

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188032
Participant
0 Kudos

Jacob,

I need to do something very similar, call a web service from ABAP code. Did you ever get your problem solved? I have never dealt with webservices before so this is all new. Can you provide the steps for creating a proxy?

Thanks for any information you can provide.

Former Member
0 Kudos

I created an HTTP RFC Destination to the WSDL URL and provided the username and password in the RFC Connection. And called the RFC Destination in the Proxy, instead of calling the URL directly in the proxy. But after that, I am getting some new errors, for which I have not received a solution yet. So, still stuck!!!

For steps on creating a Proxy, I need to know the ABAP version your are using.