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 137 changed one line
<property name="schema" value="/WEB-INF/hr.xsd"/>
<property name="schema" value="/WEB-INF/xsd/hr.xsd"/>
At line 256 added 4 lines
!! MessageDispatcher
Spring-WS의 서버측은 XML메시지를 endpoint로 전달하는 클래스로 디자인되었다.
다음은 Spring WS에서의 request를 처리 절차이다.
At line 261 added 140 lines
!! MessageDispatcherServlet
기본적으로 web.xml 파일에 정의할때 사용된다.
!! WSDL 노출
<bean id="orders" class="">
<constructor-arg value="/WEB-INF/wsdl/Orders.wsdl"/>
!! XSD에서 WSDL을 동적으로 생성하기
<bean id="holiday" class="">
<property name="builder">
<bean class="">
<property name="schema" value="/WEB-INF/xsd/Orders.xsd"/>
<property name="portTypeName" value="Orders"/>
<property name="locationUri" value="http://localhost:8080/ordersService/"/>
DynamicWsdl11Definition 는 WSDL을 생성하기 위해 Wsdl11DefinitionBuilder 를 사용한다. 위 예제에서는 XsdBasedSoap11Wsdl4jDefinitionBuilder를 사용했다. 동적으로 WSDL을 생성하기 위해서는 xsd에 request나 response로 끝나는 element가 있어야 한다. 이를테면 다음의 예를 보자.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
targetNamespace="" xmlns:xs="" xmlns:hr="">
<xs:element name="HolidayRequest">
<xs:element name="Holiday" type="hr:HolidayType"/>
<xs:element name="Employee" type="hr:EmployeeType"/>
위 소스의 경우 HolidayRequest라는 element가 있다. 이런 경우 자동으로 생성되는 WSDL에는 HolidayRequest 요소와 함께 Holiday라는 operation이 생성된다.
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="" xmlns:schema="" xmlns:soap="" xmlns:tns="" targetNamespace="">
<wsdl:message name="HolidayRequest">
<wsdl:portType name="HumanResource">
<wsdl:operation name="Holiday">
<wsdl:input message="tns:HolidayRequest" name="HolidayRequest">
!! DispatcherServlet에 Spring-WS 묶기
!! Endpoints
public interface PayloadEndpoint {
* Invokes an operation.
Source invoke(Source request) throws Exception;
Endpoint는 Spring-WS의 서버측 지원에 대한 핵심이다.
!! AbstractDomPayloadEndpoint
package samples;
public class SampleEndpoint extends AbstractDomPayloadEndpoint {
private String responseText;
public SampleEndpoint(String responseText) {
this.responseText = responseText;
protected Element invokeInternal(
Element requestElement,
Document document) throws Exception {
String requestText = requestElement.getTextContent();
System.out.println("Request text: " + requestText);
Element responseElement = document.createElementNS("http://samples", "response");
return responseElement;
<bean id="sampleEndpoint" class="samples.SampleEndpoint">
<constructor-arg value="Hello World!"/>
위 소스를 사용했을때 응답 메시지는 다음과 같다.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="">
<request xmlns="http://samples">
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