Add new attachment

Only authorized users are allowed to upload new attachments.

This page (revision-6) was last changed on 28-Oct-2007 19:56 by DongGukLee  

This page was created on 28-Oct-2007 14:19 by DongGukLee

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 39 changed one line
이 파일은 EndPoints, WebServiceMessageReceivers 를 정의한다.
이 파일은 EndPoints, WebServiceMessageReceivers 를 정의한다. 여기서 파일명은 openframework-ws-servlet.xml 이라고 가정한다.
At line 44 changed 2 lines
<beans xmlns="" xmlns:xsi=""
<beans xmlns=""
At line 52 added 99 lines
!! Endpoint 구현하기
XML 메시지를 다루기 위해 Endpoint를 구현해야 한다. 여기서 XML을 다루기 위해 사용할수 있는 방식은 JDOM, DOM, dom4j, XOM, SAX, 그리고 StAX 가 있다.
import java.text.SimpleDateFormat;
import java.util.Date;
import openframework.service.HumanResourceService;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Namespace;
import org.jdom.xpath.XPath;
public class HolidayEndpoint extends AbstractJDomPayloadEndpoint {
private XPath startDateExpression;
private XPath endDateExpression;
private XPath nameExpression;
private HumanResourceService humanResourceService;
public HolidayEndpoint(HumanResourceService humanResourceService) throws JDOMException {
this.humanResourceService = humanResourceService;
Namespace namespace = Namespace.getNamespace("hr", "");
startDateExpression = XPath.newInstance("//hr:StartDate");
endDateExpression = XPath.newInstance("//hr:EndDate");
nameExpression = XPath.newInstance("concat(//hr:FirstName,' ',//hr:LastName)");
protected Element invokeInternal(Element holidayRequest) throws Exception {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = dateFormat.parse(startDateExpression.valueOf(holidayRequest));
Date endDate = dateFormat.parse(endDateExpression.valueOf(holidayRequest));
String name = nameExpression.valueOf(holidayRequest);
humanResourceService.bookHoliday(startDate, endDate, name);
return null;
openframework-ws-servlet.xml 파일에 다음 설정을 추가한다.
<beans xmlns="">
<bean id="holidayEndpoint" class="">
<constructor-arg ref="hrService"/>
<bean id="hrService" class="openframework.service.StubHumanResourceService"/>
!! 메시지를 Endpoint로 보내기
<bean class="">
<property name="mappings">
<prop key="{}HolidayRequest">holidayEndpoint</prop>
<property name="interceptors">
<bean class=""/>
!! WSDL 배포하기
<bean id="holiday" class="">
<property name="builder">
<bean class="">
<property name="schema" value="/WEB-INF/xsd/hr.xsd"/>
<property name="portTypeName" value="HumanResource"/>
<property name="locationUri" value="http://localhost:8888/holidayService/"/>
<property name="targetNamespace" value=""/>
여기서 bean의 id값인 holiday는 wsdl을 가져올때 사용되는 값이다. 간단하게는 http://[[서버주소]/[[context명]/[[bean의 id].wsdl 이라는 URL을 사용하면 WSDL을 가져올수 있다. 위와 같은 경우 다음과 같은 URL을 가지게 된다.
Version Date Modified Size Author Changes ... Change note
6 28-Oct-2007 19:56 4.93 kB DongGukLee to previous
5 28-Oct-2007 19:26 12.412 kB DongGukLee to previous | to last
4 28-Oct-2007 16:53 8.382 kB DongGukLee to previous | to last
3 28-Oct-2007 14:47 4.922 kB DongGukLee to previous | to last
2 28-Oct-2007 14:46 4.922 kB DongGukLee to previous | to last
1 28-Oct-2007 14:19 1.444 kB DongGukLee to last
« This page (revision-6) was last changed on 28-Oct-2007 19:56 by DongGukLee