How to invoke web service in web Dynpro for java in CE environment.

Hi all,
Currently, I would like to invoke web service to retrieve data and display to the web dynpro. Do you have any sample code which I can reference?
I am currently using CE7.1 SP3.
Thank you.

Hi,
You need to use Adaptive Web Service Model for that.
Check the tuorial in the link for accessing web services.
https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#16
Regards
Pankaj

Similar Messages

  • How to invoke Workflow and UWL through Webdynpro for Java

    Hi,
    In my Development Component there are three applications .The requirement is that the data will flow between one application to another only through workflow in
    UWL.
    Can anybody help me out as to how to invoke workflow programatically from Webdynpro for Java .
    After data goes from one application to workflow UWL, how the second application will work on it . If possible please send me the links of some tutorials .
    I searched in Webdynpro Tutorials site but there are no tutorials available there .
    Thanks a lot .

    Hi,
    Check the following Threads,U will get lot of details......
    WebDynpro application that can work with SAP workflow work items?
    /thread/142477 [original link is broken]
    Configuring UWL with WebDynpro
    /people/niharika.jeena/blog/2006/06/06/launching-webdynpro-from-universal-worklist
    Sample Application,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/how%20to%20configure%20the%20universal%20worklist.pdf

  • How to call web services in WEB DYNPRO ABAP

    Hi ABAPER'S,
    Please let me know how to call web services in web dynpro.
    Thanks,
    Sandy.

    Hi Sandy,
    Please check this blog..
    /people/riyaz.sayyad/blog/2006/05/08/consuming-xi-web-services-using-web-dynpro-150-part-ii
    also cehck this...
    call the webservices in webdynpro ABAP.
    calling webservice in webdynpro component
    Re: Web Services in WDA.
    Cheers,
    Kris.
    Edited by: kissnas on May 24, 2011 11:37 AM

  • Error while calling a web service in web dynpro through XI

    Hello,
    I was following a blog for Invoking Webservices using SAP XI
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    I have done all the steps specified but when I import the wsdl file in web dynpro application and deploy the project I get the following error:
    <b>"Exception on execution of web service with WSDL URL 'bankws_OUT_MI.wsdl' with operation 'bankws_OUT_MI' in interface 'bankws_OUT_MI'"</b>
    where:
    bankws_OUT_MI -
    is the message interface name.
    I have defined a web service in the integration reopsitory as follows:
    <b>http://PEP:50000/XISOAPAdapter/MessageServlet?channel=:bankws:s_comm</b>
    where 
    bankws --- service name
    s_comm -
    sender communication channel
    selected 'bankws_OUT_MI' message interface from the given choices
    'bankws_IN_MI'  or 'bankws_OUT_MI'.
    interface name: bankws_OUT_MI -
    mesage interface name
    Can anyone guide me how to proceed further. Also if possible can anyone send me some helpful documentation regarding how to call a web service in web dynpro through XI.
    Thanks in advance.
    Regards,
    Imtool

    hello everyone,
    I made the whole scenario again and it is running succusfully in Xml spy. Now when i call the webservice in web dynpro...  I get the following error:
    <b>com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 200 while accessing URL: http://PEP:50000/XISOAPAdapter/MessageServlet?channel=:OOMS_WS_OUT:CC_OOMS_WS_OUT. Response Message: OK. Content Type: text/html; charset=utf8. Body Content: <html> <head><title>MessageServlet</title></head> <body> <h3>Message Servlet is in Status OK</h3> <h3>Status information:</h3> Servlet com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id: //tc/xi/645_VAL_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#7 $) bound to /MessageServlet <br/>Classname ModuleProcessor: null <br/>Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean <br/>Lookupname for remoteModuleProcessorLookupName: null <br/>ModuleProcessorClass not instantiated <br/>ModuleProcessorLocal is Instance of com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0 <br/>ModuleProcessorRemote not instantiated </body></html></b>
    I have also made the entry in the visual administrator for metadata_dest and execution_dest.
    Does anybody have an idea what mistake i am doing.
    Thanks,
    Imtool

  • Unable to consume secured Web service from a Dynpro application

    Hello,
    I have followed <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/bac36a469e4c75aba646077e71516d/frameset.htm">this tutorial</a>
    in order to protect and consume a secured Web service from a Dynpro application using SAP logon ticket.
    The problem is that after implementing everything needed I  receive 401 Unauthorized when I am trying to consume it from the web dynpro side.
    If I manually transfer the request the credentials, before the execute i.e:
    modObj._setUser
    modObj._setPassword
    modObj.execute();
    I am able to call it, meaning the dynpro application doesn't transfer these credentials to the Webservice even though it's authentication property is set to true.
    Any idea how to solve it?
    Roy
    Message was edited by:
            Roy Cohen

    Try below steps
    • Add jars
    o security.class
    o tc/sec/destinations/interface
    • Setting WebDynpro project property
    o Project>Properties>Web Dynpro References-->Interface references
    &#61607; Name=tcsecdestinations~interface
    o Project>Properties>Web Dynpro References-->Service reference
    &#61607; Name=webservices
    &#61607; Name=tcsecdestinations~service
    • Dynamically Set httpdestination and Call web service
    final InitialContext ctx = new InitialContext();
    final DestinationService dstService = (DestinationService)ctx.lookup(DestinationService.JNDI_KEY);
    if (dstService== null)
    throw new NamingException ("Destination service not available");
    final Destination destination = dstService.getDestination("HTTP"," DestinationName");
    // getting user name
    Properties destprop = destination.getDestinationProperties();
    String username = destprop.getProperty("USERNAME");
    String password = destprop.getProperty("PASSWORD");
    final HTTPDestination httpDestination = (HTTPDestination) destination;
    HttpURLConnection httpConnection = httpDestination.getURLConnection();
    String httpURL = String.valueOf(httpConnection.getURL());
    Request_AdvLocationVer1ViDocument_getLocation obj=wdContext.currentRequest_AdvLocationVer1ViDocument_getLocationElement().modelObject();
    obj._setUser( user );
    obj._setPassword(pass);
    obj._setEndPoint(httpURL);
    obj.execute();
    Rahul

  • Consuming External Web Services in Web Dynpro Java

    Hi All,
    I an trying to consume external web service in Web dynpro java using Adaptive Web Service Model.
    But getting below mentioned error while executing the web service
    Exception on execution of web service with WSDL URL 'D:\Web Service Project\CurrencyConvertor.asmx.xml' with operation 'ConversionRate' in interface 'CurrencyConvertorSoap'
    Steps i followed are as below:
    1. Created  Adaptive Web Service Model for this i select WSDL source as "Local File System or URL"
    In next step i select No logical destination radio button and click on next
    In next step, browse the WSDL file and successfully import the WSDL file.
    2. After successfully importing the WSDL file i wrote below code in Init method:
    WebModel modelweb = new WebModel();               
    Request_ConversionRate reqConversion = new Request_ConversionRate(modelweb);
    ConversionRate conversion= new ConversionRate(modelweb);
    reqConversion.setConversionRate(conversion);
    wdContext.nodeRequest_ConversionRate().bind(reqConversion);
    3.After that execute the model - code is given below :
        IWDMessageManager manager = wdComponentAPI.getMessageManager();
        try
          wdContext.currentRequest_ConversionRateElement().modelObject().execute();
          wdContext.nodeResponse().invalidate();
          wdContext.nodeConversionRateResponse().invalidate();
        catch(Exception e)
          manager.reportException(e.getMessage(), false);
    Please let me know how to resolve this.
    Thanks
    Sandy

    Hi,
    You need to use destinations for metadata and modeldata.
    Configure those destination in Visula admin.
    you can refer to following link.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
    Regards,
    Shruti.

  • Notification Service in Web Dynpro for Java?

    Hello Experts,
    I'm new on the topic "web dynpro for java" and have a question about a real-time-notification of web dynpro clients.
    In web dynpro for abap ther is apparently a new solution called "Notification Service" (since NW 7.0 Ehp2).
    Details: http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/f0802995-3433-2c10-2787-d7db51352891&overridelayout=true
    But I found no hints how to solve the problem of a real-time notification in web dynpro for java.
    Requirements for short: The server can trigger a refresh in one or more web dynpro clients.
    Requirements a liitle more extended:
    1. A web dynpro is running in a browser and shows data it gets from a DataBase table1
    2. Now a function module1 is started by an event and changes the data in table1 on the server side, the web dynpro does not know about this event or the changes made by external components.
    3. These changed data should be visible immediately in the running web dynpro after the event occurd --> trigger a refresh of the web dynpro from the function module1?
    All I actually know is that: The web dynpro can update its context with the new data from table1 after a refresh of the gui (wddomodifiyview). Using a timed trigger I can get new data after x seconds (same way --> context update and gui refresh). Is there another way to refresh the web dynpro (that noticed requirements of #3) ?
    Regards,
    Anja Hormann

    I recommend that you create another Web Dynpro application with this Timer to execute an RFC. This application would be in a Web Dynpro iView hidden from your SAP EP and shoot an event that would be captured by another application.
    However I would take great care with this type of application.
    And to answer your question at the moment, to my knowledge, there is no solution for this kind of integration between the ABAP and JAVA.
    regards,
    Angelo

  • Consume Web Service in Web Dynpro

    Hi Experts,
    I´m currently trying to learn web dynpro development.
    Scenario: I have one component which embed two views. One view is for enter customer number and in the other view I will see the name of the customer. The name of this customer is provided in a sap erp2005. I have develop a function modul and wich gave me the appropriate data(customer name). Then I create a web service base on this function module.
    When I test this web serviec in WSNavigator, I get the customer name, so the web service is working well.
    My Problem is: I can´t invoke this Web Service in Web Dynpro. My steps to invoke web service were: create a model with the web service wsdl and then I add this model in the component (in "Used Models").
    I have create a application and assign it to the component. When I "Deploy new archive and Run" the application I be come the error: "Configuration not found for application: demo.sap.com/test_wd3,serviceRefId:7fecf23b-0895-48f3-9902-0e7015a705c3. Please check the configuration details from the NWA. You may have not assigned the Service Group to a Provider System, or the generation of the configuration has failed."
    What do I have to consider or to set up?
    It is right to assign the input field to the context parameter?
    PS: I have followed the steps in this tutorial, but I don´t use XI or PI
    http://www.riyaz.net/blog/xipi-consuming-xi-web-services-using-web-dynpro-part-ii/technology/sap/7/
    best regards
    Anna von Landsberg
    Edited by: Anna_von_Landsberg on Dec 8, 2010 4:48 PM

    Hi,
    I have the following message error:
    Exception on execution of web service with WSDL URL
    'http://j2eeserver:port/xxxx/Config1?wsdl'
    with operation 'RequestNode' in interface
    'urn:xxxxx'
    When i debugged it, I found the following error:
    Cannot find the required parameter [unTipoProducto] in request message content.
    What is wrong?, I pasted the code of my method, that call to web service in the component controller.
      public void Alta_Entrega( )
        //@@begin Alta_Entrega()
         String tipoProducto = wdContext.currentAlta_EntregaElement().getUnTipoProducto();
         Request_Alta_Entrega entregaMO = wdContext.currentRequest_Alta_EntregaElement().modelObject();
         if (!wdContext.currentAlta_EntregaElement().getUnTipoProducto().equalsIgnoreCase("")){
              IWDMessageManager manager = wdComponentAPI.getMessageManager();
              if (logger.beDebug()) {
                entregaMO.wdSetInvocationLogEnabled(true); //switch on logging for this model object
              try{
                   entregaMO.setInvokerProperty(Stub.USERNAME_PROPERTY,"xxx");
                   entregaMO.setInvokerProperty(Stub.PASSWORD_PROPERTY,"xxx");
                   entregaMO.execute();
                   wdContext.nodeResponse().invalidate();
                   wdContext.nodeAlta_Entrega().invalidate();
              }catch (Exception e){
                   manager.reportException(e.getMessage(),false);
              logger.debugT(entregaMO.wdGetRequestLog()); //request log (HTTP header + SOAP request)
              logger.debugT(entregaMO.wdGetResponseLog()); //response log (HTTP header + SOAP response)
              logger.debugT(entregaMO.associatedModelClassInfo().getModelInfo().toString()); //model metadata in XML format
              logger.debugT(entregaMO.toString()); //model object tree in XML format (= model context node content)
    I hope you can understand me, because my english is very bad!!.
    Thank you.

  • Invoke Workflow from Web Dynpro for Java Application

    I am working on a custom web dynpro for java application and when the user clicks the submit button the SAP standard workflow (WS50000041) should be invoked. Does anyone have experience they can share with me on how to achieve this functionality? It should also be able to attach an adobe form or read data from the form and submit the data as xml.
    Thanks,
    Ashley

    Hi Ashley,
    Use following code in RFC to invoke your workflow -
    DATA : w_subrc TYPE sy-subrc,
                w_wi_id LIKE swwwihead-wi_id.
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
            EXPORTING
              task                      = ' WORKFLOW - WSxxxxxx '
              language                  = sy-langu
              do_commit                 = 'X'
            IMPORTING
              return_code               = w_subrc
              workitem_id               = w_wi_id
            TABLES
              input_container           = it_container
              message_lines             = lv_swr_messag
          COMMIT WORK.
    With this code your workflow will get start. But u have to use workflow id in next application also in which your request is getting navigated. In that application you have to take this workflow ID and have to pass again in workflow using - PortalNavigation statements.
    After that this workflow will get start to publish in your TaskList (My Task) in Portal. Remeber that your all task should be maintained in workflow table by using SWFVISU  transaction.
    After that go to Portal and Re-Register your UWL so that your new Workflow ID will get usable in portal.
    With this way you would be able to use workflow with Web Dynpro Java using UWL and Workflow.
    Regards,
    Roshan Gupta

  • (261680070) Q SYNCH-11 How do my web service methods accees EJBs and java classes?

    A<SYNCH-11> How do my web service methods accees EJBs and java classes?
    A<SYNCH-11> It is simple to use java classes, just do it as you would ordinarily.
    The .jws file really contains a simple class so you can program with it in the same
    way that you would use a regular Java class.
    To use an EJB you can go and access it directly as you would with any EJB remote
    client (lookup home stub, create, etc) or if the EJB is deployed to WLS you can use
    a control to provide a very simple wrapper to the EJB. We will see this in detail
    on Thursday in the ADVC module.

    Futher information about the possibility of callback:
    It may be possible for a synchronous only web service (i.e. MS .net) to even paticipant
    in the callback functionality of asynchronous web services. If the client implements
    the appropriate methods for the callback but listens for them on a different port
    or binding than the SOAP request, then web service may be able to build a response
    if the client's "callback URL" is submitted as the beginning part of a conversation.
    Watch the BEA developer forum (http://dev2dev.bea.com) for more information about
    this approach and other tips and techniques for building web services.
    "Adam FitzGerald" <[email protected]> wrote:
    >
    Q<SYNCH-03> I heard that MS .net only implements synchrnonus method? If
    this is true.
    Does it means my async methods will only work with J2EE clients?
    A<SYNCH-03> I do not know the limitations of .net but let me point out that
    is very
    difficult to provide asynchronous web service method invocation (this is
    different
    from an asynchronous web service). HTTP as a general communication protocol
    is based
    on a request and response paradigm so your client libraries will mostly
    likely be
    expecting a response even if it is empty (check the asynchronous example
    from today
    to see that the start method still returns an empty response). You must
    distinguish
    this from the notion of an asynchronous web service which is a business
    operation
    that occurs on the server whose return value/result is not directly associated
    with
    building response to the client. An asynchronous web service can (and generally
    will)
    be started and stopped with web service operations that are invoked synchronously.
    Thus MS .net clients can still be client to WLS hosted web services.

  • Consume XI web service in web dynpro application

    HI All,
    I have scenario access web service in web dynpro java, which is created by XI ..Now I have WSDL file. Using that WSDL file I have imported web service model(Adaptive web service method)  in my web dynpro java.
    By following  the PDF document  = https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7 
    I have created a Model as mentioned in the PDF.
    Once model is created I have done the mapping from model to component controller, after that  I need to execute the Web service model .For the execution I need to write a code in component controller :- 
    model class name = XIModel
    XIModel obj = new XIModel();
    Once I am done with the above coding , and when I try to run the application I get the following error :-
    com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 200 while accessing URL:http://atind037:50000/WSDL/GetPOPDF.wsdl. Response Message: OK. Content Type: content/unknown
    Could you please help me with this at the earliest , as it is a urgent issue.
    Regards,
    Boopathi M.

    Hi boopathi,
    It seems your wsdl url is not correct. Put the http://atind037:50000/WSDL/GetPOPDF.wsdl
    in your browser and check whether you are getting the WSDLDefinitions in xml format or not ?
    In wsdl url put ? instead of .
    URL : http://atind037:50000/WSDL/GetPOPDF?wsdl
    call adaptive web services mit Parameter
    Regards,
    Mithu

  • How to read a comma separated file in web dynpro for java?

    Hi,
    I am new to web dynpro for java, i am trying to develop an application where i am uploading file which is a comma separated file i need to read the content of it and then call an rfc  pass those values to it. i have created the ui for the afforesaid.
    How do i read the content and call the RFC please help
    Thanks

    Hi Anumeha,
    Perhaps your question can be answered in the Web Dynpro Java .
    Thank you.
    Regards,
       Jan

  • How do we scan for viruses of uploaded excel file in Web Dynpro for JAVA

    Hi All,
    Please let me know "How do we scan for viruses of uploaded excel file in Web Dynpro for JAVA"
    Regards,
    Ganga.

    Hi ,
    pl go through this note "Integrating a virus scan into SAP applications 817623 "
    SAP Virus Scan Interface
    http://help.sap.com/saphelp_nw2004s/helpdata/en/30/42c13a38b44d5e8d1b140794e8e850/frameset.htm
    Sample Application
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6e1c4221-0901-0010-63ba-b1f9459d6e74
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2681486-0a01-0010-8497-c778eac80da5
    Regards
    Ayyappparaj

  • Why Web services are used to send data not HTTP in Web dynpro for Java?

    Is Web Dynpro for Java supports Web service , RFC as communication to other systems why http cannot be used in Wweb dynpro for java.........
    Thanks and Regards,
    CSP

    Hi Pradeep,
    Yes, Web Dynpro java supports web service, you can expose your web service as RFC Model to
    communicate with others system. As per as HTTP is concern we don't have any
    supportive method in web Dynpro. Insted of HTTP we use context in web dynpro to communicate.
    Thanks
    Anup

  • How to import an image icon into Web Dynpro for Java project

    Dear Experts,
    I would like to have a "select all" button which has an image of a standard "Select ALL" icon in SAP R/3. Where do I store the icon in my Web Dynpro for Java Project? 
    Any help would be very appreciated.
    regards,
    Shoira

    Hi Shoira!<br>
    <br>
    You have to use the following path:<br>
    <your workspace>\LocalDevelopment\DCs\demo.sap.com\<your UI component>\_comp\src\mimes\Components\<your component><br>
    <br>
    Best regards,<br>
    <br>
    Christoph

Maybe you are looking for

  • Software Change Management best practices

    Hi All, I am curious how most people here are managing the changes that they make to their SAP code that is running on the IBM i. For example, how do you perform version control? Multiple release management? Task management? How do you manage approva

  • Getting back to 6.0?

    Someone mentioned recently a way to get around using 7.02 by going back to using 6.0? Can anyone tell me how you can do that? Everything was fine until I downloaded 7.02 and now i can't synch. I'd like to go back to the way things were. Any help woul

  • License Exception

    We're running Weblogic 7.0 for a client and suddenly getting this information when starting WLI: $$$$$$$$$$$$$$$$$$$ License Exception $$$$$$$$$$$$$$$$$$$ Unable to start WebLogic Server!! Missling license file for: WebLogic Platform 7.0 $$$$$$$$$$$$

  • What does importing achive do exactly? A few questions...

    Last year I imported (using "import all") all the videos from my HD camcorder into iMovie. The total size is over 130 gb. I recently bought a huge external HDD so I can transfer it there since I don't know what I'll be doing with the original video.

  • Create New Message number in Validation

    Hi, I have to create a new step in the validation, for which i want new message. please advice how to create new Message number? transaction code for it? thank you in advance, Vidya