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

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

Similar Messages

  • How to call a webService from WebDynPro ABAP ?

    We are trying to call a webService from WebDynPro-ABAP application. It is not working, While if we are calling the WebService from a Report, it is working.
    How exactly do we call a WebService from a WebDynPro-ABAP application?
    What are the main steps involved ?

    Hi Phani,
    You will need to create a service call as follows.
    Right click on your WD component name and select Create->Service Call
    The wizard will guide you through a series of steps to make a Web Service Call. On the 3rd screen, it will give you options such as Function Module, Web Service, etc
    Before making a service call, you will need to create a proxy for the Web service in the ABAP Workbench using a WSDL document as a basis. To create or consume Web services, you will need the authorizations associated with the role SAP_BC_WEBSERVICE_ADMIN.

  • Calling Java code from Webdynpro Abap UI

    Hi All,
    Can anybody tell me, How to make calls to java code on a button click from webdynpro ABAP UI ?
    Thanks in Advance.
    Jenish .V. Joy

    Hi Jenish,
    As I am new to WebDynpro for ABAP I could not help you out exactly.But See this link which will help you to create applications in WebDynpro by using ABAP language.
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?
    rid=/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943
    If you get any answer for your question let me know.
    Regards,
    Karthick K Eswaran

  • Call the webservices in webdynpro ABAP.

    Hi,
      I have WSDL file. please tell me the procedure how to call webservices in webdynpro -ABAP.
    Thank you
    neelima

    Hi neelima,
    Refer This,
    <b>Consuming XI Web Services using Web Dynpro</b>
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3593. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    <b>Web service related scenario with XI</b>
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295aeaa9.
          (Reward Points If helpful)
    Regards
    Nandha.

  • Problem in calling Webservice from Webdynpro ABAP

    I want to call a BAPI FM which is available in SAP ECC server when user is clicking on a button in a web dynpro application which is available in SAP Portal server.
    For example,
    Portal server name is DVP-EPP &
    ECC server name is DVP-ECC
    I have the done the following steps to achieve it,
    In Server DVP ECC:
    1) Created Web service from the standard BAPI FM (SE37-->Utilities-->More Utilities-->Create WebService --> From the the Func.Module)
    2) Downloaded the WebService as WSDL file from SOAMANAGER
    3) Tested the Web service through SE80, it is correctly calling the BAPI & creating necessary data.
    In Server DVP EPP:
    4) Created a Proxy class as follows,
    a) SE80 --> Package --> Create --> Enterprise service
    b) Selected Object type "Service Consumer"
    c) Selected Service Consumer "Local File"
    d) Browsed and selected WSDL file downloaded from DVP ECC
    e) Selected the Package, Prefix, Request, Completed the process & Activated it.
    5) Configured the Logical port as follows,
    a) Selected my Proxy class through F4
    b) Wrote a name for Logical port, Selected 'Default port' checkbox and selected 'Create'
    c) In the next screen, in 'Call parameters' tab, selected the 'URL' radio button & mentioned the URL of the WSDL-Document created in DVP-ECC system
    d) Saved the data & activated it
    5) Now, tested the service through (SE80-->Package-->Enterprise Services-->Client Proxy) option.
    6) When I test it, system prompts a dialog box for User-Name & Password (as available in DVP-ECC system).
    After the details are given, system throws the Information message as "SOAP:14 Unexpected element -el=definitions ns=http://schemas.xmlsoap.org/wsdl/" - Exception of class CX_AI_SYSTEM_FAULT
    No record is created in DVP-ECC through the WebService BAPI.
    Please tell me whether the steps that I followed are correct as per my requirement and a solution for the above interruption.
    Thanks in advance

    Good day guys,
    Somehow I managed to resolve the above error.
    Now in DVP-EPP system, I am able to Test the Web service Client Proxy (through SE80) and a record is successfully created in destination system (DVP-ECC).
    Now, in Webdynpro I am unable to call this webservice proxy class.
    System throws the error,
    Error (id=SoapFaultCode:5): Web service processing error; more details in the
    web service error log on provider side (UTC timestamp 20141006045544;
    Transaction ID 9A144DE49C12F1B5A6B9E41F137BE3CC)
    I just created a sample WDA application and on click of a button I am calling the Webservice Proxy class as follows,
    Method on_submit_click().
    TRY.
          CREATE OBJECT wd_assist
            EXPORTING
              logical_port_name = 'ZLOG_PORT'. "Logic port creatd for Proxy class (in SOAMANAGER)
          CALL METHOD wd_assist->bus1240create     "Method available in generated Proxy Class
            EXPORTING
              input  = ls_inp                                        
            IMPORTING
              output = ls_outp.
        CATCH cx_ai_system_fault.
      ENDTRY.
    ENDMETHOD.
    Do I have to do any thing additionally in order to call the WebService in WDA?? Because, in the same system, if I test it in SE80, record is perfectly created in destination server.
    Also please suggest if I have to do any other configuration changes related to this.
    Keenly awaiting your reply.
    Have a nice day .
    Thank you.

  • How to call BSP page from Webdynpro ABAP ?

    Hi All,
         I have a BSP page which has a page attibute . I need to pass a parameter from Webdynpro ALV table to the BSP page attibute and also need to display that BSP Page . Can any one help me out , how to proceed in this ?
    Regards,
    Kalpana A .

    hi kalpana,
    Use Exit Plug and pass data as URL Parameter.
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm
    for how to pass url please check this
    http://help.sap.com/saphelp_nw70/helpdata/EN/7b/fb57412df8091de10000000a155106/frameset.htm
    Yogesh N

  • Calling adobe form from webdynpro abap view

    Hi,
    I need some help. The situation is: I have created a Adobe form interface as well as a form using the SFP transaction. Now, I have a webdynpro screen with a button, which upon pressed must give the output of the PDF form.
    I tried the following steps:
    1. Call function 'FP_FUNCTION_MODULE_NAME'
    2. Call 'FP_JOB_OPEN'
    3. Call the generated function module name
    4. Call FP_JOB_CLOSE.
    The procedure works fine when I use the same code in a report program. It opens a dialog box where there is a option for Print preview and it displays the PDF.
    But when I try to replicate the same, it does not work in Webdynpro for ABAP. Any suggestions as to how to go about this problem?
    regards,
    Praveen Kumar

    Hi Praveen
    there is documentation on the Web Dynpro for ABAP integration of Interactive Forms in the SAP Help Portal at http://help.sap.com/saphelp_nw2004s/helpdata/en/aa/940ee5331b4b8fa0a6cb6714dc5db4/frameset.htm which should answer most of your questions.
    You specify the form to be used during the design of your Web Dynpro application (you are prompted to determine it when you insert the UI element).
    You can save the form from the Reader toolbar, the question would be why would you want to do this and not use a proper download screen.
    A proper tutorial is planned to be available in June. Until then, check the ABAP page in SDN for some e-learning / webinar recording), or directly here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3
    Cheers,
    Markus

  • Calling a local Webservice from ECC ABAP - Am I on the right track?

    Hi all
    In my NW2004s landscape I have an ECC system (ABAP 6.40, Java not configured/linked) and an XI system (6.40).  My requirement is to call a Webservice (WS) from the ECC system.
    I've converted an existing Java class (that contains 3 methods) to a webservice (WS) using NWDS.  This WS has then been deployed to the XI system as it is the only one with a JAVA system.  I'm able to view and test the WS methods using the Web Service Navigator on the XI system.  The wsdl for the WS that was generated has the following format "http://<server>:<port>/<webservice name>/<configuration name>?wsdl  (No .asmx extension as per most of the examples on SDN...not sure if this matters).
    My understanding is that I should be able to create a client proxy in my ECC system (via Enterprise Services in SE80) using this wsdl and I can also configure a logical port throught txn LPCONFIG.  I should then be able to utilise ABAP to call this webservice? 
    I've found the blog "/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap detailing this (for a 6.40 system)... but when I attempt the program I get a soap 111 error code Unallowed RFC-XML Tag(SOAP_EINVALDOC).  
    Am I on the right track? Is it possible to call the Webservice from ECC ABAP? 
    There are no dumps for me to analyse and I've also tried putting on RFC trace with no success.
    Could it be that the WS is not correctly formed even though it works fine when tested from the WS Navigator on the XI system?
    Thanking you in advance.
    Malick

    Clive Pennington wrote:
    Thank you Eugene, your answer is most helpful.  I supose I just wanted to do everything myself really.  If when I have made my little movies, my animations and collated all my words and pictures I have problems assembling the documents then I can always get a professional to haul it together for me but I want to put in the donkey work first.  I know it is a lot of money for the software but now the pain is giving way a little I'm really quite enjoying myself.
    The planning which you have mentioned in your reply is of imense value I will start to do that immidiately, also the constant testing through Digital editions.
    All this is really helpful and I thank you for you reply.  I have made a brave attempt at some elementary annimation and posted them on youtube for testing, the urls are here if there is any interest.  Basic and time consuming but I can do this much faster now.
    http://tinyurl.com/348wjxg
    http://tinyurl.com/2wzuhql
    http://tinyurl.com/3yzjunk
    Thanks again............ Clive
    What comes through to me from your videos is that you know your material (of course, no pun intended) and that you have a clear sense of how to present it for clear communication to, and understanding by, your audience. Without this core, no amount of professional-level visual effects will achieve your goal, a great training program.
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Calling custom Infotype method from Webdynpro Abap

    Hi Experts,
    I am working on an application where i need to call a method of a custom defined infotype.
    I have done this -->
    1. Create a custom infotype 9111
    2. SAP creates a class of that infotype ZCL_HRPA_INFOTYPE_9111
    3. Inside this method there are few inherited method which provide me functionality of insert , update , delete
    i want to call methods IF_HRPA_INFTY_BL~MODIFY,
    IF_HRPA_INFTY_BL~INSERT
    However when i call these method from webdynpro abap this method does not work.
    where as when i try to insert an entry using PA30 transaction it works.
    Does anyone know why does this happen and what is the solution?
    Regards,
    Ashish Shah

    Hi Ashish,
    You need to create method inside your assistance class, the class your webdynpro component talks to.
    Within the methods of Assistance class you will have to create instance of ZCL_HRPA_INFOTYPE_9111 and call its  method IF_HRPA_INFTY_BL~INSERT  passing the data.
    Cheers
    Prashant

  • Error when Interative Adobe Form is called from Webdynpro ABAP.

    Hi Experts,
    I trying to call a Interactive adobe form from ABAP Webdynpro application but I am facing the below error.
    Line: -
    The following error text was processed in the system GJD : User session (HTTP/SMTP/..) closed after timeout
    The error occurred on the application server az18u021_GJD_01 and in the work process 0 .
    The termination type was: ERROR_MESSAGE_STATE
    The ABAP call stack was:
    Method: PREPROCESS_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    Line: -
    When I uncheck the enabled property of the Interactive From in the Page of the WebDynpro I am able to execute the application successfully.But the Adobe form behaves as a Static Form when I uncheck the enabled property.
    So kindly provide your valuable suggestions to avoid the above error when I am calling a Interactive adobe form from Webdynpro ABAP.
    Thanks in Advance.
    Regards,
    Arun.

    Hello,
    Hello, are you sure you have your ADS credentials configured correctly and valid? I guess you know that is the only difference between clicking enabled on true or false. If you are not sure, you can use SE38, search for FP_* and pick some reports to check the licencing. The names of the reports are good enough to recognize the right one.
    Or maybe that is a security problem? Have you checked the ADS_ERROR string? Did you use the ADS trace?
    check: http://help.sap.com/saphelp_nw70/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/content.htm
    and especially note 999998
    Regards, Otto

  • Calling Webdynpro Java Application from Webdynpro ABAP Application.

    Hi,
    We have developed one Application using Webdynpro Java and I m in need to call the Webdynpro Java application from Webdynpro ABAP.
    Require Suggestions to acheive this.
    Thanks In advance.
    Reg,
    Ajay.

    Dear Ajay,
    Assuming that both your applications WDA & WDJ are in the portal & you don't have to pass any parameters to the WDJ application.
    Write the following code on the action  where you would call the WDJ application.
      DATA:
            lr_compcontroller TYPE REF TO ig_componentcontroller,
            l_component TYPE REF TO if_wd_component ,
            lr_port_manager TYPE REF TO if_wd_portal_integration ,
            wa_navigation TYPE navigation.
      lr_compcontroller =   wd_this->get_componentcontroller_ctr( ).
      l_component = lr_compcontroller->wd_get_api( ).
      lr_port_manager = l_component->get_portal_manager( ) .
    * The value inserted into the navigation-target field can be found in the Portal
    * content administration tab of your portal. It is the ID or PCD Location field
      wa_navigation-target = pcd. " Please provide the PCD Location of the WDJ Application here.
      wa_navigation-mode   = '0'.  "0 = INTERNAL(same page) and 1 = EXTERNAL(new page).
      CALL METHOD lr_port_manager->navigate_absolute
        EXPORTING
          navigation_target = wa_navigation-target
          navigation_mode   = wa_navigation-mode.
    You can get the PCD from the Page properties of the WDJ application page in the Portal.
    Hope it helps!
    Warm regards,
    Upendra Agrawal

  • Calling GuidedProcess from WebDynpro ABAP

    Hi all
    can anybody tell me that how to call GP from webdynpro ABAP.
    and what are the advantages and disadvantages in this scenario??
    if anyone reply then it would be the great help to me
    Regards
    Suresh babu

    Hey,
    You can call a GP from WD ABAP through by implementing a service call from a method that is embedded in your WD. You can refer this link for the same.
    http://help.sap.com/saphelp_nwce10/helpdata/en/44/58f9cc0d95311ce10000000a155369/frameset.htm
    But you should note here that Data exchange between ABAP WD and GP is not two way but its only one way.
    Cheers,
    Mandrake

  • Consuming PI Webservice from Webdynpro Java Not working

    Hello SAP,
    Environment: CE 7.2.
    Resolution expected immediately, Helpful answer is highly appreciated.
    Is the namespace should not exceed 60char for PI Webservice, for executing the webservice from Webdynpro Java.
    I tried with all the options in executing the PI Service from Webdynpro Java, None of the options worked. I am facing the below error while I was calling the PI Webservice.
    I don't see any problem from Webdynpro Java, what ever the procedure I have followed is the standard procedure.
    Fortunately when I execute the service from Webservice Navigator, it is working as expected. The same webservice when I consume it from Webdynpro Java it is not working
    Options tried so far:
    1) Published the Services to Service Registry and there by consuming the PI Service from Service Registry - Not worked
    2) Tweaked the URL with few options - Not worked (Tweaking the URL, ex: portType, Binding)
    3) Changing the Business Systems in PI and there after calling the service - Not worked
    4) Initializing the code, instead of creating Service Controller and calling the PI Service - Not worked.
    5) Created a Provider System and tried to call the PI Webservice from Provider System - Not Worked
    For all the Options, I am facing the same error which is provided in the screenshot.
    Below procedure which I have followed for calling the PI Webservice:
    1) Created Adaptive Webservice Model
    2) Provided PI Webservice URL (It prompts for PI System UserId and Password)
    3) Selected Option - No Service Group Configuration
    4) Provided Logical Destination
    6) Completed creation of Model
    7) Added the model as a UsedModel
    8) Right Click on Comp Contr. and selected Apply Template and Created a ServiceController for the model (Entire mapping to comp contr, Initializing the nodes is taken care by Service Contr.)
    9) Created an Template Action button and there by calling execute method which is auto rendered from CompContr..
    10) Build the project.
    11) Activated the code and Run the Application.
    12) Getting the below error which is showed in the message.
    ERROR MESSAGE:
    Exception on execution of web service on destination 'GetPIHRPeopleData' for operation 'SI_CreateHRPeopleData_OS' in interface 'SI_CreatePeopleCompany_OS'

    Hi Sankar,
    If the webservice is working fine in the Wsnavigator then there is some problem with importing the webservice in webdynpro for Java. Please check the required parameter for creating the Adaptive Webservice Model. After adding in the used model and compoent controller binding, you need to write code for to execute the webservice model.
    Please check the code for initialization and execution for the webservice and then test it.
    Best Regards,
    Arun Jaiswal

  • Reg calling Transaction code in Webdynpro ABAP

    Hi All,
    Can I call Transaction code in Webdynpro ABAP Portal Application. If so, how can this be possible? Can anybody give me a lead?
    Thanks.
    Kumar Saurav.

    Hi,
    The most easy Way is here:
    1) Test any Webdynpro Application from SE80 when the webdynpro Browser opens to display output
    Copy its HTTP link, Suppose we get the below link
    http://r3d01web1.Siemens.dk:8001/sap/bc/webdynpro/sap/z_dynamic_view?sap-client=002&sap-language=EN
    2) Now replace some part of the above link ( webdynpro/sap/z_dynamic_view?sap-client=002&sap-language=EN )  with the new link part ( gui/sap/its/webgui?~transaction=PA30 )
    So that the newly generated link is such that the below one:
    http://r3d01web1.Siemens.dk:8001/sap/bc/gui/sap/its/webgui?~transaction=PA30
    Note in place of PA30 you can put any of your desired tcode.
    3) Now Just Make a webdynpro component and in its View layout put a LINK TO URL ui element
    and in its property REFERENCE just past the http link ( http://r3d01web1.Siemens.dk:8001/sap/bc/gui/sap/its/webgui?~transaction=PA30 )
    4) Activate and test your webdynpro Application.

  • Consuming Webservices in webdynpro ABAP

    Hello,
    I want to work with consuming Webservices in Webdynpro ABAP. Can anybody give an example for the same.
    Any help would be highly appreciated.
    Thanks.

    Hello
    Here is a link.
    It has many links for the webservice consumption in abap and web dynpro
    Consuming webservice in a webdynpro component
    actaully process on a high level is like this.
    1. first you need to create an client proxy., For creating this go to SE80
    and follow this link
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
    2. then you can consume this service using the service call option of the web dynpro
    here go to the web dynpro comp and right click on it and create-> service call
    and use  the proxy created in the first step here.
    it will create one custom controller which you can use.
    thanks
    sarbjeet singh

Maybe you are looking for

  • How can I re-download certain applications that did not download properly?

    I downloaded the creative suite but some apps such as photoshop and dreamweaver did not download properly. When I go to open the application I get the error message saying it may be damaged or incomplete. Is there a way to go back and download just t

  • 1.2.1 Firmware Causing Lockups

    I had the crash during podcasts issue with 1.2, and I haven't tested if 1.2.1 fixed it... Because now it can't make it through 1 song without the screen and scroll wheel locking up completely! It continues playing whatever song it is on, then stops p

  • Properties Panel (desperately needed)

    can anyone build a panel for photoshop like the fireworks property panel, or that makes the live shape properties in photoshop permanent and apply to any element. Being able to have a panel to control the size of an element or object, as well as its

  • My macbook pro shuts down unexpectedly

    I've had my Mcabook Pro for 4 years now, and its shuts down unexpectedly, like at times when im working on GarageBand and on other programs, when i leave it for 10 to 20 minents i come back and click on app it just shuts down without warning. I gave

  • Problems downloading folio to iPad

    I made a folio with the Folio Builder and InDesign CS5 (7.0.4 works also..:). When I check my folio in Acrobat.com I see everything I made. But: I can't publish this folio, althougt I should publish 1 folio for free and when i sign in  in the Adobe C