Archive

Posts Tagged ‘Spring Hibernate’

Hibernate Tutorial Video

July 5th, 2011
Comments Off


dd
This is Good Video for newbie to advance
More Hibernate Tutorial Video

Development

Spring Hibernate Solution

June 15th, 2011
Comments Off

Content about : Spring Hibernate Solution

Advertisements


My First Project to Guide Newbie for Create Simply J2ee Project With Spring Frame work
* Using Hibernate
* Create WebService
* Interceptor
* Working with DTO
* Master for Model and Controller

Download Source with Eclipse project (Coming soon)


Step by Step to Create Spring J2EE Web Application

Development, My Spring Hibernate Solution ,

Spring Webservice Example for Create Webservice with apache CXF and Spring Framework

June 15th, 2011
Comments Off

Content about : Spring Webservice with apache CXF
Advertisements


In the Last content for this project in my spring hibernate solution i need to provide WebService with Spring framework
You can create service simply with 2 step

First Step Create Service Class
**Interface
package com.en.ws;
import javax.jws.WebParam;
import javax.jws.WebService;
import com.en.dto.ExampleDto;
/**
* @author Somsuksri Kasemsuk
* @version 1.0 $Id: ExampleWSInf.java 2693 2009-07-03 $
*/
@WebService
public interface ExampleWSInf {
public ExampleDto getData(@WebParam(name=”codeId”)String codeId);
}

**Implements Class
package com.en.ws;
import java.io.Serializable;
import com.en.dto.ExampleDto;
import com.en.model.MasterModel;
//@WebService(endpointInterface = “com.en.ws.ExampleWSInf”, serviceName = “ExampleWS”, portName=”ExampleWS”)
public class ExampleWS  implements ExampleWSInf,Serializable {
private static final long serialVersionUID = 1L;
private MasterModel model;
public ExampleDto getData(String codeId){
ExampleDto dto=(ExampleDto)model.getDataObj(new Integer(codeId));
return dto;
}
public MasterModel getModel() {
return model;
}
public void setModel(MasterModel model) {
this.model = model;
}

}

XML Mapping for Spring framework work together with Apache CXF
<?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.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd”>

<!– Load CXF modules from cxf.jar –>
<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=”exampleWS” class=”com.en.ws.ExampleWS”>
<property name=”model” ref=”exampleModel”/>
</bean>
<jaxws:endpoint id=”EXAMPLEWS”
implementorClass=”com.en.ws.ExampleWS”
implementor=”#exampleWS”
address=”/example” />
</beans>

Development