I have created a java web service consumer in domino designer 8.5.3 that calls a WS operation with a string parameter and gets a string response.
Now i want to create an XPage with 1 edit box, 1 computed field and 1 button. On button click i want to run server side javascript that uses my WS consumer (gets input from box and shows response in computed field).
At first, is it possible to call WS via XPages? Is there any tested solution?
I ve tried :
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/reuse_web_services_xpage.htm i got:-> Cannot find class org.apache.commons.discovery.tools.DiscoverSingleton in NSF
i copied java source of consumer into Java code folder. then i created my own class that does the call, and from SSJS i called my class' method. i got:-> lotus.domino.axis.ConfigurationException: No engine configuration file - aborting!
http://openntf.org/XSnippets.nsf/snippet.xsp?id=call-webservice-from-java-ssjs-xpages i got:-> printed null output variable in console
P.S: i was able to call and get result using Java agent, i was also able to create a Notes form and populate a computed field using lotusscript consumer.
What i want now is: Use a java consumer from XPage to set field value from WS.
Solution found!!!
(open package explorer view and applications view) 1: create a java consumer 2: create packages in code/java folder and name them as generated by the consumer 3: export or copy java files to code/Java folder (into the correct packages)
so far it doesnt work and u ll get an error of axis configuration but do the following to make it work:
4: go to package explorer, open the consumer(.javalib) compile it, while still open right-click it and open with system editor. A window will pop up containing some jar files. Open this one "webserviceresource.jar" with (i used winrar) 5: copy .wsdd file (or all of the files if u want...), paste them into code/java (no new packages new folders etc, just paste them)
6: in javascript editor use importPackage to import these java packages and then write your code
the ws client is now ready. You can use it with your xpage.