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

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

The jar file of my ProjectB added as a dependency on ProjectA pom.xml .

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

The web services bank that I added to another project does not contain the Webcontent folder. So my concern will be

  • How to call my web service which is inside jar in ProjectA ?

  • Do I need to add something to my web.xml from ProjectA to find my web service?

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

  • Do I need to re-specify all dependent bans on axis 2 in ProjectA pom.xml or Axis 2 servlet mappings in ProjectA web.xml?

I am amazed at this for a day. Can someone please help me?

+6
source share
1 answer

I assume that you are invoking a Web service projectB and a web service client project. If so, then you have a little confusion. You need to deploy the web service (projectB) on the application server (for example, war on the tomcat server or ear in jboss or weblogic, etc.). Then you need to generate your client stubs using the "Maven2 WSDL2Code Plug-in" and use this client as a dependency in your project. This proyectA will use the stubs in the generated dependency to access your web service. Sorry that I can not format this answer, I ask for a proxy server that blocks all java script (I can’t even send comments) ...

+1
source

All Articles