Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invoke a axis2 web service project added as jar dependency to another Maven project?

I created Axis2 web service as a maven project ProjectB and packaged it as jar.I added this ProjectB jar as dependency to the another maven project which is ProjectA in pom.xml.

jar file of my ProjectB added as dependency to ProjectA pom.xml.

<dependency>
    <groupId>axis2</groupId>
    <artifactId>Axis2WebService</artifactId>
    <version>0.1</version>
</dependency>

In web services jar which I added to another project doesn't contain Webcontent folder. So, my concern would be

  1. How to invoke my webservice which is inside jar in the ProjectA?

  2. Do I need to add anything in my web.xml of ProjectA in order to find my webservice?

  3. How can I access my webservice in the browser(i.e. http://localserver:port/ProjectA/Myservice). Is this the right way to access my webservice?

  4. Do I need to again specify all axis2 dependent jars in projectApom.xml or Axis 2 servlets mappings in ProjectA web.xml?

I am struck on this for a day.Can someone please help me?

like image 900
SRy Avatar asked Dec 07 '12 22:12

SRy


1 Answers

I'm assuming you're calling your Web Service projectB, and your Web Service Client projectA. If that's the case, then you have a little confusion there. You need to deploy your Web Service (projectB) in an application server (i.e as a war in a tomcat server or ear in jboss or weblogic, etc). Then, you need to generate your client stubs with "Maven2 WSDL2Code Plug-in" and use that client as dependency in your projectA. This proyectA will use the stubs in the generated dependency to access your Web Service. Sorry that I can't format this answer, I'm begind a proxy that blocks all java script (I can't even post comments)...

like image 161
Pablo Lascano Avatar answered Sep 27 '22 21:09

Pablo Lascano