Skip to Content

Calling a webservice from webdynpro ABAP.

Hi,

Anybody have doc/material with screenshots on calling a webservice from webdynpro ABAP (In WAS 7.0 version using service calls ) with clear steps ?

Thanks in advance. Ponts will not be a constraint for right answers

Praveen

Edited by: Praveen kumar Kadi on Feb 23, 2009 11:19 AM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 23, 2009 at 10:25 AM

    Hi Praveen,

    Please refer to this online help: http://help.sap.com/saphelp_nw70/helpdata/EN/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm

    and have a look at this [thread|Consuming WSDL; as well.

    I hope it helps.

    Regards

    Arjun

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 23, 2009 at 11:39 AM

    Hi Praveen,

    1st Step : configure Logical Port

    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm

    2nd Step : Generate Proxy Object

    http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm

    3rd Step : Instantiating the proxy object & calling the methods exposed by webservice

    data: sys_exception type ref to cx_ai_system_fault,
          sys_exception2 type ref to cx_ai_application_fault,
          client_proxy type ref to zco_myesa, "MY PROXY CLASS
          lv_ret_code type int4,
          lv_input type zsend_email_input,
          lv_response type zsend_email_response.
    
    data: lv_from type string,
          lv_from_address type string,
          lv_to type string,
          lv_to_address type string,
          lv_subject type string,
          lv_msg type string.
    
    
    
    
    lv_input-from = 'MYSAPTEST'.
    lv_input-from_address = '<someAddress>'.
    lv_input-to = 'Prashant'.
    lv_input-to_address = '<someAddress>'.
    lv_input-subject = ' TEST'.
    lv_input-msg_body = ' Hi this is wonderfull to see it work'.
    
    
     try.
     create object client_proxy
     exporting
     logical_port_name = 'BASIC'. " Basic is a TYPE G RFC Destination
    
     call method client_proxy->send_email
       exporting
         input  = lv_input
       importing
         output = lv_response    .
      catch cx_ai_system_fault  into sys_exception .
        data lv_err type string.
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
    
      catch cx_ai_application_fault into sys_exception2  .
         lv_err = sys_exception->if_message~get_text( ).
         write: / lv_err.
    
     endtry.
    
     if lv_response is initial.
       write: /'Not Executed'.
     else.
       write: /'Did Execute'.
     endif.

    Greetings

    Prashant

    Add comment
    10|10000 characters needed characters exceeded