on 08-05-2011 12:28 PM
Hello Gurus,
I have a local development webdynpro project . My requirement is that on click of a submit button, webservice is called and it returns a string which i need to display on the view. I searched a lot but couldnt find the exact step by step process.
While creating the web service model, which one dhould i choose n then after model creation
what code should i write to call webservice.
Regards
nishu
Hi Nishu,
I would suggest to use consume webservice through the AWSmodel exposed by webdynpro. Please follow the followng link
for further details.
http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService
Thanks
satyajeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello All,
Thanks for all your replies. I am able to create model and bind it to my component controller.
But when i write the code to call webservice , i am unable to instanciate the model....
I wrote the following code :
{
testmodel = new Soap(); - (1)
Request_ServiceSoap_insertTicket insert = new Request_ServiceSoap_insertTicket(testmodel); - (2)
insert.setUserId("CCM_RUS");
wdContext.nodeRequest_ServiceSoap_insertTicket().bind(insert);
}
private Soap testmodel;
In Above code , line (1) , 'Soap' is the name of my WebService model, which i made by importaing the wsdl file from my local system. And line (2), i amd getting error :
the constructor Request_ServiceSoap_insertTicket(testmodel) is undefined.
If i remove the 'testmodel' and just write Request_ServiceSoap_insertTicket() , the webservice is not called, since model instantiation is necessary for webservice Models. I am stuck
Please help
Thanks
Nishu
Edited by: nishu_rj on Aug 23, 2011 9:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nishu,
Try following code.
Soap testmodel = new Soap(); - (1)
Request_ServiceSoap_insertTicket insert = new Request_ServiceSoap_insertTicket(testmodel); - (2)
insert.setUserId("CCM_RUS");
wdContext.nodeRequest_ServiceSoap_insertTicket().bind(insert);
wdContext.nodeRequest_ServiceSoap_insertTicket().execute();
After adding this code, Organize Imports.
I hope it helps.
Hello all,
I made a new model and chose 'import Web Service Model' in my NWDS.
After selecting the service.wsdl file from my local system, when i click finish, i get all webservice java class files inside source -> packages -> <my model package>.
But the problem is i am not able to see anything under 'Models' so how should i connect it to my component controller.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please find following link on how to consume web service in Web Dynpro - http://www.sapgeek.net/2011/01/web-dynpro-java-how-to-consume-web-service/
Please find below link on more Web Dynpro toturials - http://www.sapgeek.net/sap-tutorial/web-dynpro-java-tutorial/
Regards,
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There are numerous examples on how to consume an adaptive web service through WDJ on SDN, have a look at [this article for instance|http://www.google.com/url?sa=t&source=web&cd=8&ved=0CE0QFjAH&url=http%3A%2F%2Fwww.sdn.sap.com%2Firj%2Fscn%2Findex%3Frid%3D%2Flibrary%2Fuuid%2F900bbf94-a7a8-2910-e298-a651b4706c1e%26overridelayout%3Dtrue&rct=j&q=site%3Asap.com%20adaptive%20web%20service%20example&ei=6N87To_3Ac2YOoqgsNMH&usg=AFQjCNFgvXiflkfYMc7DVe1h7zJLeJ3Z-g&cad=rja].
Best regards,
Robin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.