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

1

6

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?

Gibbie answered 7/12, 2012 at 22:37 Comment(0)
L
1

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)...

Lubricate answered 12/12, 2012 at 14:58 Comment(2)
@donsenior.....ProjectA is the not he webservice client.It's our main webapp project which consists all the functionality of our Project.ProjectB is Webservice which entirely independent of ProjectA.I just want to deploy ProjectB as a Jar file inside the ProjectA library.So, I got a question what should mention in web.xm in order to invoke webservice as the service resides in the jar file.Gibbie
Why would you do that? If the WS is independent why don't you just deploy it in the same app server where your webapp is?Lubricate

© 2022 - 2024 — McMap. All rights reserved.