Skip to Content
avatar image
Former Member

Consuming WSDL

Hi Experts,

I have a WSDL file and i want to consume it in my WD Component. This service is basically for updation purpose. Please tell how can i achieve it in WD ABAP.

Regards

Pranav Nagpal

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 12, 2008 at 08:43 AM

    Hi Pranav,

    As explained by Thomas Jung LPCONFIG is obsolete from SP14 onwards. If you are on a lower SP then you can execute the transaction. Screens are self explanatory.

    For more information, please refer to the following link.

    [LPCONFIG|http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/content.htm]

    Regards

    Rohit Chowdhary

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 12, 2008 at 09:56 AM

    Hello Pranav,

    everything about Web Services can be found here:

    http://help.sap.com/saphelp_nw70/helpdata/EN/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm

    Regards,

    Rainer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 11, 2008 at 12:28 PM

    Hi Pranav,

    To consume a WSDL in ABAP, you will need to create proxy using edit object function of object navigator (Se80). Select enterprise service tab from the list of tabs. Select client proxy radio button, enter a name in customer name and then click on the create option.

    To create a proxy you can either use a URL with ?wsdl or a file from local machine. Once object is imported save it and activate it. On activation SAP generate ABAP proxy class and required structures for import and export parameters.

    Next step would be to define logical port using LPconfig trcode.

    Once you have done the settings then you can call the object as per the code given below:

    create object lo_clientproxy

    exporting

    logical_port_name = im_lp_name. ( this will be the Logical port which you have configured)

    try.

    call method lo_clientproxy->xxxxxxxx ( Method of your service call )

    exporting

    input = ls_request

    importing

    output = ls_response.

    catch cx_ai_system_fault into lo_sys_exception.

    endtry.

    ls_request and Ls_response will are the variables referring import and export structures created during import of WSDL file.

    Regards

    Rohit Chowdhary

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rohit,

      Thanks a lot for suggestion i think i have missed a step i.e. creating a logical port...... do i need to to search in ABAP general for the steps for creating a logical port???

      Regards

      Pranav

  • avatar image
    Former Member
    Dec 12, 2008 at 04:14 AM

    Hi Rohit and Thomas,

    Thanks for valuable suggestions, I got a proxy class for the same and i m using it via code wizard and able to pass parameters correctly to the method... but still i m not able to update any thing in database.... i m not sure if my procedure of passing parameter has some problem or if there is some problem with proxy class...

    i m posting my code below as well if you can have a look at it.............

    method execute_send_freeze .
    
    
    data it_freeze type zpi_dt_hcm045_freeze_flag__tab.
    data wa_freeze type zpi_dt_hcm045_freeze_flag_deta.
    
    data output type zpi_mt_hcm045_freeze_flag_deta.
    
    data wa_controller type prxctrltab.
    data wa_hcm045 type
    zpi_dt_hcm045_freeze_flag_det1.
    
    *******************************************************
    *I will be passing these values in function*
    
    wa_freeze-pernr = wd_this->pernr.
    wa_freeze-functionality = 'UXEDSWEx'.
    wa_freeze-aedtm = sy-datum.
    wa_freeze-uname = sy-uname.
    wa_freeze-sprps = 'X'.
    
    *******************************************************
    
    append wa_freeze to it_freeze.
    
    output-mt_hcm045_freeze_flag_details-freeze = it_freeze.
    
      if not wd_this->m_zpi_co_si_hcm045_fre is bound.
        try.
            create object wd_this->m_zpi_co_si_hcm045_fre
    *  EXPORTING
    *    logical_port_name  =
                .
          catch cx_ai_system_fault .
        endtry.
      endif.
    
    * declarations for context navigation
      data lo_send_freeze_flag_det type ref to if_wd_context_node.
      data lo_importing type ref to if_wd_context_node.
      data lo_output type ref to if_wd_context_node.
      data lo_element type ref to if_wd_context_element.
    
    * declarations for parameters
      data ls_c_output type if_componentcontroller=>element_output.
    
    
    * get all involved child nodes
      lo_send_freeze_flag_det = wd_context->get_child_node(
    wd_this->wdctx_send_freeze_flag_det ).
      lo_importing = lo_send_freeze_flag_det->get_child_node(
    wd_this->wdctx_importing ).
      lo_output = lo_importing->get_child_node( wd_this->wdctx_output ).
    
    * get input from context
      lo_element = lo_output->get_element( ).
      lo_element->get_static_attributes(
        importing static_attributes = ls_c_output ).
    
    ls_c_output = output.
    
    * the invocation - errors are always fatal !!!
      data lx_exception  type ref to cx_root.
      try.
          wd_this->m_zpi_co_si_hcm045_fre->send_freeze_flag_details(
            exporting
               output =                          ls_c_output
          ).
        catch cx_ai_system_fault into lx_exception.
          raise exception type cx_wd_no_handler
            exporting previous = lx_exception.
      endtry.
    
    
    * store output to context
    
    endmethod.

    regards

    Pranav

    Edited by: Pranav Nagpal on Dec 12, 2008 5:15 AM

    Add comment
    10|10000 characters needed characters exceeded