Skip to Content
avatar image
Former Member

Need Code to call webservice method from View/Component....

Hi All

- I created a Web service using "Adaptive WebService Model" for a Method say method1() which return String.

- I create Java Web Dynpro Project/Application & created model and embed this model into our component. And then did context mapping between model-component, component-view for request node.

I didn't write full steps, but everything is ok above....

What i need is coding to call Web Service Method from my View or Component.

Pls help me.

Thanks in Advance...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 10, 2009 at 05:47 AM


    Write the code as follows

    1) in init method

    YourModel model = new YourModel();

    wdContext.nodeRequest().bind(new Request(model));

    2) create method called executeRequest() and writhe the code in the method as follows

    wdContext.currentRequestElement() .modelObject().execute();


    For more details go through the below link



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 09, 2009 at 10:23 PM


    Expalination of modelObject()

    In the above link currentMainElement() is the element of your webservice model node. get_details() is the method you need to call in webservice. Pl dont call directly from view.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Srini

      Actually i have a button in my view, what i want is when i click on button, it should call webservice(MEthod) to display string returned by webservice.

      How to handle this.