Skip to Content
author's profile photo Former Member
Former Member

Consume External Web Service from ABAP

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 11, 2009 at 09:41 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.