Updates sandbox so it compiles.
This commit is contained in:
@@ -21,18 +21,14 @@ import javax.xml.soap.SOAPConstants;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class AddressingHelperTest extends AbstractWsAddressingTestCase {
|
||||
|
||||
private AddressingHelper helper;
|
||||
|
||||
private Element headerElement;
|
||||
|
||||
protected void onSetUp() throws Exception {
|
||||
helper = new AddressingHelper(new WsAddressing200408());
|
||||
SaajSoapMessage message = loadSaajMessage("request-200408.xml");
|
||||
headerElement = message.getSaajMessage().getSOAPHeader();
|
||||
}
|
||||
|
||||
public void testAddMessageHeaderRequiredFault12() throws Exception {
|
||||
|
||||
@@ -20,11 +20,15 @@ import java.io.IOException;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/** @author Arjen Poutsma */
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class Driver {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
new ClassPathXmlApplicationContext("applicationContext.xml", Driver.class);
|
||||
ClassPathXmlApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("applicationContext.xml", Driver.class);
|
||||
context.registerShutdownHook();
|
||||
System.out.println("Started....");
|
||||
System.in.read();
|
||||
}
|
||||
|
||||
@@ -16,17 +16,14 @@
|
||||
|
||||
package org.springframework.ws.transport.mail;
|
||||
|
||||
import java.util.Properties;
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.soap.MessageFactory;
|
||||
import javax.xml.soap.SOAPConstants;
|
||||
import javax.xml.soap.SOAPMessage;
|
||||
import javax.mail.URLName;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.springframework.ws.soap.SoapMessage;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessage;
|
||||
import org.springframework.ws.soap.saaj.SaajSoapMessageFactory;
|
||||
import org.springframework.ws.transport.WebServiceConnection;
|
||||
|
||||
public class MailMessageSenderIntegrationTest extends TestCase {
|
||||
@@ -36,17 +33,15 @@ public class MailMessageSenderIntegrationTest extends TestCase {
|
||||
private MessageFactory messageFactory;
|
||||
|
||||
private static final String URI = "mailto:ajwpi21@xs4all.nl?subject=SOAP Test";
|
||||
// private static final String URI = "mailto:revans@interface21.com?subject=Believe me now?";
|
||||
|
||||
private static final String SOAP_ACTION = "http://springframework.org/DoIt";
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("mail.smtp.host", "smtp.xs4all.nl");
|
||||
messageSender = new MailMessageSender();
|
||||
messageSender.setStoreUri("pop3://ajwpi21:sjantaL.@pop.xs4all.nl/INBOX");
|
||||
messageSender.setTransportUri("smtp://ajwpi21:sjantaL.@smtp.xs4all.nl");
|
||||
messageSender.setFrom("Arjen Poutsma <ajwp@xs4all.nl>");
|
||||
messageSender.setJavaMailProperties(properties);
|
||||
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
}
|
||||
|
||||
@@ -55,6 +50,7 @@ public class MailMessageSenderIntegrationTest extends TestCase {
|
||||
try {
|
||||
connection = messageSender.createConnection(URI);
|
||||
SOAPMessage saajMessage = messageFactory.createMessage();
|
||||
saajMessage.getSOAPBody().addBodyElement(new QName("http://springframework.org", "test"));
|
||||
SoapMessage soapRequest = new SaajSoapMessage(saajMessage);
|
||||
soapRequest.setSoapAction(SOAP_ACTION);
|
||||
connection.send(soapRequest);
|
||||
|
||||
@@ -76,7 +76,8 @@ public class TcpMessageReceiverIntegrationTest extends AbstractDependencyInjecti
|
||||
public void testTemplate() throws Exception {
|
||||
WebServiceTemplate template = new WebServiceTemplate(messageFactory);
|
||||
template.setMessageSender(messageSender);
|
||||
template.sendAndReceive("tcp://localhost",new StringSource(REQUEST), new StreamResult(System.out));
|
||||
template.sendSourceAndReceiveToResult("tcp://localhost", new StringSource(REQUEST),
|
||||
new StreamResult(System.out));
|
||||
}
|
||||
|
||||
protected String[] getConfigLocations() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
log4j.rootCategory=INFO, stdout
|
||||
log4j.logger.org.springframework.ws=DEBUG
|
||||
#log4j.logger.org.springframework.ws=DEBUG
|
||||
log4j.logger.org.springframework=DEBUG
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
|
||||
@@ -3,18 +3,20 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
|
||||
|
||||
<bean id="messagingReceiver" class="org.springframework.ws.transport.mail.MailMessageReceiver">
|
||||
<property name="storeUri" value="imap://ajwpi21:sjantaL.@imap.xs4all.nl/INBOX"/>
|
||||
<property name="messageFactory" ref="messageFactory"/>
|
||||
<property name="messageReceiver">
|
||||
<bean class="org.springframework.ws.transport.SimpleTestingMessageReceiver"/>
|
||||
</property>
|
||||
<property name="monitoringStrategy">
|
||||
<bean class="org.springframework.ws.transport.mail.DefaultMonitoringStrategy">
|
||||
<property name="pollingInterval" value="10000"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
|
||||
|
||||
<!-- define an MBeanExporter -->
|
||||
<bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
|
||||
<!-- the beans to be exported to JMX -->
|
||||
<property name="beans">
|
||||
<map>
|
||||
<entry key="spring-ws:service=messagingContainer">
|
||||
|
||||
Reference in New Issue
Block a user