I need to use webservice client in xPages.
I found a simple ws to test, called CurrencyConverter. WSDL is here: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL
- First of all, I created a java classes using wsimport tool in JDK6.
- I made sure that my project uses Java 1.6
- Then I created a new java project in my Eclipse Juno and imported those files into src folder
- Then I created a simple class to test it:
CurrencyConvertor service = new CurrencyConvertor();
CurrencyConvertorSoap msg = service.getCurrencyConvertorSoap();
double rate = msg.conversionRate(Currency.USD, Currency.CZK);
System.out.println("USD to CZK rate = " + rate);
It worked perfectly.
Then I wanted to use the same approach in xPages.
- First of all, I created a new Domino Application
- Then I made sure that it uses Java 1.6
- Then in Package Explorer I created a new folder called src and added it to Build Path
- Then I imported those java files, made by wsimport tool into this folder
- Then I created a new class called TestBean and in it I created a new method getCurrency() with the same code as above
- Then I registered this TestBean in faces-config.xml as 'service' using a view scope
- Then I created a new xPage called home
- Then I put a new ComputedField into this xpage:
value="#{service.currency}"
And you know what? It doesn't work. It throws a WebServiceException with a message: class net.webservicex.ConversionRate do not have a property of the name {http://www.webserviceX.NET/}FromCurrency
So, am I doing anything wrong, or is it just typical IBM Notes/Domino issue?
EDIT: I created a typical project on Domino 9 server. Can someone check and try it, please? Maybe I'm just doing something wrong. Here is the test application.