on 02-21-2007 5:15 PM
Hi,
I have created a Webservice via EJB - I have tested it via Web Services Navigator.
This is a simple Webservice only with one method ->
testmethod -> input as strin and output as string
Now i'd like to use this webservice in my Web Dynpro App. Therefor I imported the Webservice as model: I get this structure:
MyModel
- Model Classes
- input
- inputResponse
- Request_input
- input
- Response
- Response_Checkuser
- inputResponse
No I use Applay Template in the CustomControllers - therefore I choose Request_input and there I choose all childnodes.
After that following code is the result:
wdoinit---
MyModel model = new MyModel();
wdContext.nodeRequest_Inout().bind(new Request_Input(model));
execute---
wdContext.currentRequest_InputElement().modelObject().execute();
wdContext.nodeResponse().invalidate();
wdContext.nodeInputResponse().invalidate();
->>>> but method execute is undefined for the type Request_input
I don't know, where is the mistake - can anyone help me.
Thanks Stefan
Hi Stefan,
In controller wdoinit() you have to write the following code:
<b>wdoinit</b>---
//Bind the Webservice model to the corresponding context node.
MyModel model = new MyModel();
wdContext.nodeMyModel().bind(input);
<b>execute</b>
wdContext.currentMyModelElement().modelObject().execute();
now invalidate the node in which you are getting the result.
Regards,
Jhansi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks, but I think it cann't solve the problem because my Model Classes have already an error after generating by NWDS. I think the error is not in the Custom controler.
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
folowing errors in the model:
---
MyModel extends com.sap.tc.webdynpro.model.webservice.gci.WSTypedModel
-> com.sap.tc.webdynpro.model cannot be resolved or it is not a valid superclass
Request_Input extends com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClassExecutable
-> com.sap.tc.webdynpro.model cannot be resolved or it is not a valid superclass
Can anyone help me?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
Try this
//wdoinit---
Request_MyModel_inputMethod req=new Request_MyModel_Input();
wdContext.nodeRequestMyModel().bind(req);
//execute
wdContext.currentMyModelElement().setInput(inputStr);
wdContext.currentMyModelElement().modelObject().execute();
wdContext.nodeResponseMyModel.invalidate();
Regards,
Are there any generation errors in your modelClasses ??
Goto Request_Input model class and check.This class should extends com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClassExecutable which has execute() method.
Regards,Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.