Skip to Content
avatar image
Former Member

How to set input parameter for Web Service...

Hi

Scenario is:-

- I have 2 Input Fields (first name & last name) in a view and one button. When i click on button, it will show full name.

- i have a method in my Adaptive Web Service like: String Method1(fname String, lname String)

- Now i don't know how to set the input parameters of my WebService from my view. I need to write the following code in my view's button Action.

-


WS1Model m = new WS1Model();

Request_Method1 re = new Request_Method1(m);

wdContext.nodeRequest_Method1().bind(re);

try {

re.execute();

} catch (CMIException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

???? Setting Input is missing........

wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentMethod1ResponseElement().getResponse());

-


Pls. Let me know how can i solve this issue.

Thanks....

Edited by: Harpal Singh on Sep 10, 2009 11:46 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 11, 2009 at 02:26 AM

    Hi Harpal,

    You can set the parameters like:

    Request_Method1 re = new Request_Method1(m);
    // set the parameters in request 
    re.setFirstname(fname);
    re.setLastname(lname);
    wdContext.nodeRequest_Method1().bind(re);
    try {
    re.execute();
    wdContext.nodeResponse().invalidate();
    } catch (CMIException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    Let me know if you get any issues in implementing it.

    Regards,

    Siva

    Add comment
    10|10000 characters needed characters exceeded