Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Former Member replied

Hi Harpal,

set the model attributes as shown below:

Request_Method1 -> Method1 -> Fname & Lname

Model model = new Model ();

Request_Method1 req = new Request_Method1(model);

Method1 method = new Method1(model);

method.setFname(fname);

method.setLname(lname);

req.setMethod1(method);

wdContext.nodeRequest_Method1().bind(req);

/// execute the model

try {

wdContext.nodeRequest_Method1().currentRequest_Method1Element().modelObject().execute();

wdContext.nodeResponse_Method1().invalidate();

}catch (WDWSModelException wdwsmee){

}

hope it helps,

Thanks and Regards

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question