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 149 added 108 lines
!! Spring WebService
Spring WebService의 핵심 인터페이스는 WebServiceMessage이다.
SoapMessage는 SOAP관련 WebServiceMessage의 하위클래스이다.
실제 WebServiceMessage를 생성하는 메소드는 WebServiceMessageFactory에 들어있다.
__SaajSoapMessageFactory__
SOAP with Attachments API for Java를 사용한다.
[{Java2HtmlPlugin
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
}]
<div class="information">
SAAJ는 DOM에 기초한다. 이 말은 메모리에 저장된다는 것을 뜻하기 때문에 좀더 큰 SOAP메시지의 경우 적절하지 않다고 볼수 있다. 이 경우 AxiomSoapMessageFactory가 더 적절하다.
</div>
__AxiomSoapMessageFactory__
StAX(Streaming API for XML)에 기초한 AXis 2 Object Model를 사용한다.
[{Java2HtmlPlugin
<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
<property name="payloadCaching" value="true"/>
</bean>
}]
__SOAP 버전__
현재 1.1, 1.2 버전을 지원한다. 디폴트는 1.1이다.
[{Java2HtmlPlugin
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd">
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>
</property>
</bean>
</beans>
}]
!! MessageContext
요청(클라이언트측)과 응답(서버측)이라는 두가지를 포함하는 객체이다.
__클라이언트 측__
클라이언트에서는 webServiceTemplate를 통해 MessageContext가 생성한다.
[{Java2HtmlPlugin
import java.io.StringReader;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.transport.WebServiceMessageSender;
public class WebServiceClient {
private static final String MESSAGE = "<message xmlns=\"http://tempuri.org\">Hello Web Service World</message>";
private final WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
public void setDefaultUri(String defaultUri) {
webServiceTemplate.setDefaultUri(defaultUri);
}
// send to the configured default URI
public void simpleSendAndReceive() {
StreamSource source = new StreamSource(new StringReader(MESSAGE));
StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult(source, result);
}
// send to an explicit URI
public void customSendAndReceive() {
StreamSource source = new StreamSource(new StringReader(MESSAGE));
StreamResult result = new StreamResult(System.out);
webServiceTemplate.sendSourceAndReceiveToResult("http://localhost:8080/AnotherWebService", source, result);
}
}
}]
[{Java2HtmlPlugin
<beans xmlns="http://www.springframework.org/schema/beans">
<bean id="webServiceClient" class="WebServiceClient">
<property name="defaultUri" value="http://localhost:8080/WebService"/>
</bean>
</beans>
}]
[http://static.springframework.org/spring-ws/site/reference/html/images/sequence.png]
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