chris.noonan Posted October 5, 2012 Share Posted October 5, 2012 Hi all,I'm using iReport and JasperServer Pro 4.7, and am wanting to call the runReport method on WSClient in a Java servlet.The problem I'm having, is locating the required JARs/Libaries to run the following piece of code: JServer js = new JServer(); js.setUrl(serverUrl); js.setUsername(serverUser); js.setPassword(serverPassword); ResourceDescriptor rd = new ResourceDescriptor(); rd.setWsType(ResourceDescriptor.TYPE_JRXML); rd.setUriString("/Projects/Report1"); Map params = new HashMap(); params.put("param1", "1234"); WSClient client = new WSClient(js); JasperPrint jasperPrint = client.runReport(rd, params); I've attached the following libraries to my Java application:com-jaspersoft-ireport-jasperserver.jar js_activation-1.1.jar js_axis-1.4patched.jar js_commons-codec-1.3.jar js_commons-discovery-0.2.jar js_commons-httpclient-3.1.jar js_jasperserver-common-ws-3.5.0.jar js_jaxrpc.jar js_mail-1.4.jar js_saaj-api-1.3.jar js_wsdl4j-1.5.1.jar What library do I need to use the JasperPrint object? I've tried using jasperreports-4.7.jar, however at runtime, I'm getting dependency exceptions for "java.lang.NoClassDefFoundError: com/jaspersoft/ireport/designer/IReportManager"The Web Services documentation is very thin on details. Any help would be great.Cheers, Chris Link to comment Share on other sites More sharing options...
marianol Posted October 10, 2012 Share Posted October 10, 2012 Chris,There is a sample with the JasperServer Distribution on using the API you will find it in <js-install-path>/samples/java-webapp-sample/ you will find a working sample there and also the WSClient.java class is there. Remember that you will be using the Server API (either SOAP or REST) so you will not need the Jasper Library in your application.The also the Jersey library is really good if you are using the REST API http://www.mkyong.com/webservices/jax-rs/restful-java-client-with-jersey-client/This link may be able to help you also, it looks a bit old but it should give you some guidance: http://www.jaspersoft.com/sites/default/files/downloads/Jaspersoft-api-wp.pdf and of course the Web Services Guide http://community.jaspersoft.com/sites/default/files/docs/jasperreports-server-web-services-guide.pdf Mariano Link to comment Share on other sites More sharing options...
chris.noonan Posted October 18, 2012 Author Share Posted October 18, 2012 Hi Mariano, Thanks for the assistance. The WSClient.java class references the following imports: import net.sf.jasperreports.engine.JasperPrint; import com.jaspersoft.jasperserver.irplugin.JServer; import com.jaspersoft.jasperserver.api.metadata.xml.domain.impl.*; Which libraries/jars do I need to complete these imports? Regards, Chris Link to comment Share on other sites More sharing options...
chris.noonan Posted October 18, 2012 Author Share Posted October 18, 2012 I can get it working using the Jersey library, however the performance is quite terrible. I can build the report faster using the JasperReport Library engine. Hence the reason for wanting to use the SOAP api's. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now