You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by mattmadhavan <ma...@yahoo.com> on 2007/09/04 21:53:48 UTC

CXF and other Spring bean configurations

Hello,
I am doing a Java first development for a webservice. My imle class looks
like,

public class AddProductInfo implements IAddProductInfo {
	
	public AddProductInfo () {
		
	}
	
	/* (non-Javadoc)
	 * @see
com.vibes.content.ws.IAddProductInfo#addProductInfo(com.vibes.content.ws.BaseProduct)
	 */
	public Integer addProductInfo (BaseProduct product) {
		_log.info("addProductInfo called.......");
		_log.info("Product Name = " + product.getName());
		_log.info("Product Description = " + product.getDescription());
		return new Integer(10000);
	}

	/* (non-Javadoc)
	 * @see
com.vibes.content.ws.IAddProductInfo#addContentProviderInfo(java.lang.Integer,
java.lang.Integer, java.lang.Integer, java.lang.String, boolean)
	 */
	public Integer addContentProviderInfo (Integer productID, Integer
carrierID, Integer contentProvierID, String contentURL, boolean
isProductDesc) {
		_log.info("Product ID  = " + productID);
		_log.info("Carrier ID  = " + carrierID);
		_log.info("contentProvierID ID  = " + contentProvierID);
		return new Integer(10001);
	}
}

I would like to make sure this bean (The W.S impl class) is singleton and
also I would like to dependency inject DAO classes created via other spring
configurations files. Can some one poin t me to right documentations?

Thanks
Matt

-- 
View this message in context: http://www.nabble.com/CXF-and-other-Spring-bean-configurations-tf4379949.html#a12485392
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF and other Spring bean configurations

Posted by Julio Arias <ju...@rbxglobal.com>.
Your missing some annotations on your implementing class

@WebService(serviceName = "AddProductInfo", endpointInterface =  
"com.vibes.content.ws.IAddProductInfo",
		targetNamespace = "http://your.service/namespace")
public class AddProductInfo implements IAddProductInfo {
.
.
.
.
}

Also make sure your SEI is well annotated too.

As for the spring config it might look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xsi:schemaLocation="
http://www.springframework.org/schema/beans http:// 
www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

     <!--************************* CXF WebServices  
*************************-->
     <import resource="classpath:META-INF/cxf/cxf.xml"/>
     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
     <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

     <bean id="addProductInfo"  
class="com.vibes.content.ws.AddProductInfo">
         <property name="anyProp" ref="otherBean"/>
     </bean>

     <jaxws:endpoint id="addProductInfoService" address="/ 
YourAddress" implementor="#addProductInfo">
     </jaxws:endpoint>
</beans>

You could add more info to your endpoint config but this is a basic  
example.

On Sep 4, 2007, at 1:53 PM, mattmadhavan wrote:

>
> Hello,
> I am doing a Java first development for a webservice. My imle class  
> looks
> like,
>
> public class AddProductInfo implements IAddProductInfo {
> 	
> 	public AddProductInfo () {
> 		
> 	}
> 	
> 	/* (non-Javadoc)
> 	 * @see
> com.vibes.content.ws.IAddProductInfo#addProductInfo 
> (com.vibes.content.ws.BaseProduct)
> 	 */
> 	public Integer addProductInfo (BaseProduct product) {
> 		_log.info("addProductInfo called.......");
> 		_log.info("Product Name = " + product.getName());
> 		_log.info("Product Description = " + product.getDescription());
> 		return new Integer(10000);
> 	}
>
> 	/* (non-Javadoc)
> 	 * @see
> com.vibes.content.ws.IAddProductInfo#addContentProviderInfo 
> (java.lang.Integer,
> java.lang.Integer, java.lang.Integer, java.lang.String, boolean)
> 	 */
> 	public Integer addContentProviderInfo (Integer productID, Integer
> carrierID, Integer contentProvierID, String contentURL, boolean
> isProductDesc) {
> 		_log.info("Product ID  = " + productID);
> 		_log.info("Carrier ID  = " + carrierID);
> 		_log.info("contentProvierID ID  = " + contentProvierID);
> 		return new Integer(10001);
> 	}
> }
>
> I would like to make sure this bean (The W.S impl class) is  
> singleton and
> also I would like to dependency inject DAO classes created via  
> other spring
> configurations files. Can some one poin t me to right documentations?
>
> Thanks
> Matt
>
> -- 
> View this message in context: http://www.nabble.com/CXF-and-other- 
> Spring-bean-configurations-tf4379949.html#a12485392
> Sent from the cxf-user mailing list archive at Nabble.com.
>




Julio Arias
Java Developer
Roundbox Global : enterprise : technology : genius
---------------------------------------------------------------------
Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica
tel: 404.567.5000 ext. 2001 | cell: 011) 506.849.5981
email: julio.arias@rbxglobal.com | www.rbxglobal.com
---------------------------------------------------------------------