cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming WSDL

pranav_nagpal2
Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

rainer_liebisch
Contributor
0 Kudos

Hello Pranav,

everything about Web Services can be found here:

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

Regards,

Rainer

pranav_nagpal2
Contributor
0 Kudos

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

Former Member
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is nothing really Web Dynpro ABAP specific about creating a web service consumer. This question really belongs in one of the other ABAP forums. From Web Dynpro ABAP you only need to interact with the generated proxy class like any other ABAP class. There is a service wizard for calling proxy classes, but in my experience most proxies generate interface parameters that are too deeply nested to be processed by the wizard. Better to just code the calling logic and matching context manually.

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

Please note that as of NetWeaver 7.0 SP14 or SP15 (can't remember exactly) LPCONFIG is obsolete. You know use transaction SOAMANAGER for this setp.

pranav_nagpal2
Contributor
0 Kudos

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