cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a webservice from webdynpro ABAP.

praveenkumar_kadi
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

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|; as well.

I hope it helps.

Regards

Arjun

Answers (1)

Answers (1)

Former Member
0 Kudos

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

praveenkumar_kadi
Active Contributor
0 Kudos

Hi Prashant,

Thanks for the steps. but I have road blocks to test your findings.

I don't have access to LPCONFIG transaction.

1)What are the transactions do I need to have access before I able to create a webservice succesfully in webdynpro ABAP. ?

2)Authorizations needed to sucessfully create the webservice

(If possible please send your function module which you used to create a proxy object.)

(ID: praveen.be.cseATgmail.com)

Thanks

Praveen

Former Member
0 Kudos

Hi Praveen,

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.

i Guess your original query was on how to consume a webservice, not how to create a webservice in ABAP..

....calling a webservice from webdynpro ABAP

well to create a webservice you need to call webservice WIZARD on the ABAP object who's functionality you intend to publish as web service check the below link

[https://www.sdn.sap.com/irj/sdn/webservices?rid=/webcontent/uuid/83b7ec4d-0a01-0010-03a9-e5a3b42522b8] [original link is broken];

Greetings

Prashant