on 09-10-2009 10:45 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siva
Actually the hierarchy of my View's Context is like as follows:
Context -> Request_Method1 -> Method1 -> Fname & Lname
Could u pls. tell me how will you change your previous mentioned code as per this context structure to set the input parameter fname, lname for the web service?
Thanks Boss....
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
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.