WEB-Services / SOAP

Moderators: None (Apply to moderate this forum)
Number of threads: 108
Number of posts: 139

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dynamic Client from Axis 2 Posted by mbcooray on 7 Apr 2011 at 1:48 AM
Hi

I am experimenting a code to dynamically generate a client. I am Using Following Code :

try {
            
            ServiceClient dc = new ServiceClient(null, new URL("http://localhost:8080/axis2/services/HelloWorld?wsdl"), null, null);

            XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(new InputStreamReader(new URL("http://localhost:8080/axis2/services/HelloWorld?wsdl").openStream()));
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            OMElement payload = builder.getDocumentElement();            

        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (XMLStreamException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }


However, when I execute the code above I get the following error

org.apache.axis2.deployment.DeploymentException: org/apache/commons/httpclient/HttpException
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:552)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:112)
at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615)
at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146)
at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:215)
at dynamicclient.Main.main(Main.java:34)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0(Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.axis2.deployment.AxisConfigBuilder.processTransportSenders(AxisConfigBuilder.java:537)
... 8 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

===============

I downloaded the "HttpClient 4.1.1 (GA)" from http://hc.apache.org/downloads.cgi, and saved it in my [CATALINA_HOME\lib]

Once I saved, I restarted the Apache server, however I get the same error

Please Help Me...
Report
Re: Dynamic Client from Axis 2 Posted by Prad1 on 9 Apr 2011 at 3:15 AM
Ensure that all the required jar files of Axis2 are available to ur code.

Report
Re: Dynamic Client from Axis 2 Posted by mbcooray on 10 Apr 2011 at 5:00 PM
Thanks it works now



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.