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?

SRy
  • 2,901
  • 8
  • 36
  • 57

1 Answers1

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

Pablo Lascano
  • 662
  • 6
  • 14
  • @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. – SRy Dec 14 '12 at 01:20
  • 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? – Pablo Lascano Dec 14 '12 at 22:19