axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hickman, Craig" <Craig_Hick...@ADP.com>
Subject RE: Service path
Date Fri, 27 Apr 2007 15:11:59 GMT
I think the easiest path is to use Spring to expose you Service and include
Axis2 within your application rather than your app within Axis2.

Add the proper axix2 libs to your applications lib directory. Add the
current version of spring.jar from the Spring Framework Site:
http://www.springframework.org/

1.) Add the following to your web.xml

	<listener>
		<listener-class>
	
org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/applicationContext.xml</param-value>
	</context-param>

 ------------ plus the Axis2 servlets you use -------------


2.) Add the following to your applicationContext.xml

<beans>
	<bean id="applicationContext"
	
class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder
" />

	<!-- Axis2 web service, but to Spring, its just another bean that
has dependencies   -->
	<bean id="<name of your service>" class="<the skeleton class path to
Skeleton>">
		<property name="service" ref="<setter prop as in example:
serviceManager to be reference below>" />
	</bean>
	<!-- just another bean/interface with a wired implementation, which
is injected by Spring into the web service -->
	<bean id="serviceManager"
		class="< path to your POJO
com.webservices.impl.ServiceManagerImpl">
	</bean>

 3). Add the following to your Skeleton for injection of service by Spring:

	/**
	 * Setter value for Spring to injection of SSO service
	 * 
	 * @param service
	 */
	public void setService(ServiceManager service) {
		this.service = service;
	}

  4) Define you <your own name>.wsdl and services.xml with your target
namespaces as you wish and add to classpath. I use a build file and add both
to my /classes directory. The user guide specifies META-INF... But it seems
to work better, depending on your container in the /classes or /web-inf
direcory (I use oc4j)
  5. The biggest thing about the namespace attributes is to make sure they
exist in classpath. The definitions and the types have to exist, and if you
used and IDE that checks the .wsdl with a parser then you'll be able to
verify this. 

I've found this to work in every project without a hitch....

    Hope this helps....


   
	

-----Original Message-----
From: Dennis Thrys√łe [mailto:dth@conscius.com] 
Sent: Friday, April 27, 2007 3:17 AM
To: axis-user@ws.apache.org
Subject: Service path

Hi,

Is it possible to configure axis2 to place services on multiple different
paths (URLs)?

It seems like a lot goes on under the hood that requires the services
path/contextpath to be used. But I would like to webservices to be placed
all over the namespace...

I'm interested in deploying POJOs as webservices, so the input parameteres
would be a class name and a deployment path. Servlet mapping takes care of
invoking the proper servlet.

The result should be:

- POJO webservice based on given class
- Name based on class (I assume this is not configurable behaviour?)
- Accessible on URL defined by me

Let me know if I'm way off base here...

Thanks,

-dennis

---------------------------------------------------------------------------
The information in this email is confidential and may be legally protected.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message