Added support module, initialy containing JMS transport
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.transport;
|
||||
|
||||
import javax.xml.transform.Transformer;
|
||||
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.xml.transform.TransformerObjectSupport;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
public class SimpleTestingMessageReceiver extends TransformerObjectSupport implements WebServiceMessageReceiver {
|
||||
|
||||
public void receive(MessageContext messageContext) throws Exception {
|
||||
Assert.notNull(messageContext, "MessageContext is null");
|
||||
logger.info("Received message");
|
||||
Transformer transformer = createTransformer();
|
||||
transformer.transform(messageContext.getRequest().getPayloadSource(),
|
||||
messageContext.getResponse().getPayloadResult());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright 2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.transport.jms;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Session;
|
||||
import javax.xml.soap.MessageFactory;
|
||||
import javax.xml.soap.SOAPConstants;
|
||||
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
|
||||
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 JmsMessageSenderIntegrationTest extends AbstractDependencyInjectionSpringContextTests {
|
||||
|
||||
private JmsMessageSender messageSender;
|
||||
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
private MessageFactory messageFactory;
|
||||
|
||||
private static final String REQUEST_QUEUE_URI = "jms:RequestQueue";
|
||||
|
||||
private static final String SOAP_ACTION = "\"http://springframework.org/DoIt\"";
|
||||
|
||||
protected void onSetUp() throws Exception {
|
||||
messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
|
||||
}
|
||||
|
||||
protected String[] getConfigLocations() {
|
||||
return new String[]{"classpath:org/springframework/ws/transport/jms/jms-sender-applicationContext.xml"};
|
||||
}
|
||||
|
||||
public void setJmsTemplate(JmsTemplate jmsTemplate) {
|
||||
this.jmsTemplate = jmsTemplate;
|
||||
}
|
||||
|
||||
public void setMessageSender(JmsMessageSender messageSender) {
|
||||
this.messageSender = messageSender;
|
||||
}
|
||||
|
||||
public void testSendAndReceiveQueue() throws Exception {
|
||||
WebServiceConnection connection = null;
|
||||
try {
|
||||
connection = messageSender.createConnection(REQUEST_QUEUE_URI);
|
||||
SoapMessage soapRequest = new SaajSoapMessage(messageFactory.createMessage());
|
||||
soapRequest.setSoapAction(SOAP_ACTION);
|
||||
connection.send(soapRequest);
|
||||
|
||||
BytesMessage request = (BytesMessage) jmsTemplate.receive();
|
||||
validateMessage(request);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
messageFactory.createMessage().writeTo(bos);
|
||||
final byte[] buf = bos.toByteArray();
|
||||
jmsTemplate.send(request.getJMSReplyTo(), new MessageCreator() {
|
||||
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
BytesMessage response = session.createBytesMessage();
|
||||
response.setStringProperty(JmsTransportConstants.PROPERTY_BINDING_VERSION, "1.0");
|
||||
response.setIntProperty(JmsTransportConstants.PROPERTY_CONTENT_LENGTH, buf.length);
|
||||
response.setStringProperty(JmsTransportConstants.PROPERTY_CONTENT_TYPE, "text/xml");
|
||||
response.setBooleanProperty(JmsTransportConstants.PROPERTY_IS_FAULT, false);
|
||||
response.setStringProperty(JmsTransportConstants.PROPERTY_REQUEST_IRI, REQUEST_QUEUE_URI);
|
||||
response.setStringProperty(JmsTransportConstants.PROPERTY_SOAP_ACTION, SOAP_ACTION);
|
||||
|
||||
response.writeBytes(buf);
|
||||
return response;
|
||||
}
|
||||
});
|
||||
SoapMessage response = (SoapMessage) connection.receive(new SaajSoapMessageFactory(messageFactory));
|
||||
assertNotNull("No response received", response);
|
||||
assertEquals("Invalid SOAPAction", SOAP_ACTION, response.getSoapAction());
|
||||
assertFalse("Message is fault", response.hasFault());
|
||||
}
|
||||
finally {
|
||||
if (connection != null) {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateMessage(BytesMessage message) throws JMSException, IOException {
|
||||
assertEquals("Invalid SOAPAction", SOAP_ACTION,
|
||||
message.getStringProperty(JmsTransportConstants.PROPERTY_SOAP_ACTION));
|
||||
assertEquals("Invalid binding version", "1.0",
|
||||
message.getStringProperty(JmsTransportConstants.PROPERTY_BINDING_VERSION));
|
||||
assertEquals("Invalid service IRI", REQUEST_QUEUE_URI,
|
||||
message.getStringProperty(JmsTransportConstants.PROPERTY_REQUEST_IRI));
|
||||
assertFalse("Message is Fault", message.getBooleanProperty(JmsTransportConstants.PROPERTY_IS_FAULT));
|
||||
assertTrue("Invalid Content Type",
|
||||
message.getStringProperty(JmsTransportConstants.PROPERTY_CONTENT_TYPE).indexOf("text/xml") != -1);
|
||||
assertTrue("No Content Length", message.getIntProperty(JmsTransportConstants.PROPERTY_CONTENT_LENGTH) > 0);
|
||||
|
||||
assertTrue("Message has no contents", getMessageContents(message).length() > 0);
|
||||
|
||||
}
|
||||
|
||||
private String getMessageContents(BytesMessage message) throws JMSException, IOException {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytesRead;
|
||||
while ((bytesRead = message.readBytes(buffer)) != -1) {
|
||||
out.write(buffer, 0, bytesRead);
|
||||
}
|
||||
out.flush();
|
||||
return out.toString("UTF-8");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.transport.jms;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class JmsUriTest extends TestCase {
|
||||
|
||||
public void testJmsUri() {
|
||||
JmsUri uri = new JmsUri("jms:news?connectionFactoryName=SOAPJMSFactory&" + "deliveryMode=2&" +
|
||||
"destinationType=topic&" + "initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory&" +
|
||||
"jndiURL=theJndiURL&" + "priority=8&" + "timeToLive=10&" + "replyToName=interested&" +
|
||||
"userprop=mystuff");
|
||||
assertEquals("Invalid delivery mode", 2, uri.getDeliveryMode());
|
||||
assertEquals("Invalid destination", "news", uri.getDestination());
|
||||
assertEquals("Invalid destination type", "topic", uri.getDestinationType());
|
||||
assertTrue("Invalid pub sub domain", uri.isPubSubDomain());
|
||||
assertEquals("Invalid prority", 8, uri.getPriority());
|
||||
assertEquals("Invalid time to live", 10, uri.getTimeToLive());
|
||||
assertEquals("Invalid reply to name", "interested", uri.getReplyTo());
|
||||
|
||||
}
|
||||
|
||||
public void testGetDestinationNoParams() {
|
||||
JmsUri uri = new JmsUri("jms:news");
|
||||
assertEquals("Invalid destination", "news", uri.getDestination());
|
||||
}
|
||||
|
||||
public void testInvalidDeliveryMode() {
|
||||
testIllegalArgument("jms:news?deliveryMode=abc");
|
||||
}
|
||||
|
||||
public void testInvalidPriority() {
|
||||
testIllegalArgument("jms:news?priority=abc");
|
||||
}
|
||||
|
||||
public void testInvalidTimeToLive() {
|
||||
testIllegalArgument("jms:news?timeToLive=abc");
|
||||
}
|
||||
|
||||
public void testInvalidDestinationType() {
|
||||
testIllegalArgument("jms:news?destinationType=abc");
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
testIllegalArgument("");
|
||||
}
|
||||
|
||||
public void testIllegalParam() {
|
||||
testIllegalArgument("jms:news?bla");
|
||||
}
|
||||
|
||||
private void testIllegalArgument(String uri) {
|
||||
try {
|
||||
new JmsUri(uri);
|
||||
fail("Expected IllegalArgumentException for uri [" + uri + "]");
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
//expected
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
*/
|
||||
/*
|
||||
* Copyright 2006 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*
|
||||
|
||||
package org.springframework.ws.transport.jms;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.Destination;
|
||||
import javax.jms.MessageProducer;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.StreamMessage;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.codehaus.activemq.message.ActiveMQBytesMessage;
|
||||
import org.codehaus.activemq.message.ActiveMQTopic;
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.ws.MockWebServiceMessageFactory;
|
||||
import org.springframework.ws.context.MessageContext;
|
||||
import org.springframework.ws.server.endpoint.MessageEndpoint;
|
||||
|
||||
public class MessageEndpointMessageListenerTest extends TestCase {
|
||||
|
||||
private static final String REQUEST = " <SOAP-ENV:Envelope\n" +
|
||||
" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
|
||||
" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" + " <SOAP-ENV:Body>\n" +
|
||||
" <m:GetLastTradePrice xmlns:m=\"Some-URI\">\n" + " <symbol>DIS</symbol>\n" +
|
||||
" </m:GetLastTradePrice>\n" + " </SOAP-ENV:Body>\n" + "</SOAP-ENV:Envelope>";
|
||||
|
||||
private WebServiceMessageListener messageListener;
|
||||
|
||||
private BytesMessage request;
|
||||
|
||||
private MockControl sessionControl;
|
||||
|
||||
private Session sessionMock;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
messageListener = new WebServiceMessageListener();
|
||||
request = new ActiveMQBytesMessage();
|
||||
request.writeBytes(REQUEST.getBytes("UTF-8"));
|
||||
messageListener.setMessageFactory(new MockWebServiceMessageFactory());
|
||||
sessionControl = MockControl.createControl(Session.class);
|
||||
sessionMock = (Session) sessionControl.getMock();
|
||||
}
|
||||
|
||||
public void testOnMessageInvalidMessage() throws Exception {
|
||||
MockControl mockControl = MockControl.createControl(StreamMessage.class);
|
||||
StreamMessage message = (StreamMessage) mockControl.getMock();
|
||||
try {
|
||||
messageListener.onMessage(message, sessionMock);
|
||||
fail("Expected IllegalArgumentException");
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public void testOnMessageNoResponse() throws Exception {
|
||||
|
||||
MessageEndpoint endpoint = new MessageEndpoint() {
|
||||
|
||||
public void invoke(MessageContext messageContext) throws Exception {
|
||||
}
|
||||
};
|
||||
messageListener.setMessageReceiver(endpoint);
|
||||
|
||||
request.reset();
|
||||
messageListener.onMessage(request, sessionMock);
|
||||
}
|
||||
|
||||
public void testOnMessageResponse() throws Exception {
|
||||
MockControl producerControl = MockControl.createControl(MessageProducer.class);
|
||||
MessageProducer producerMock = (MessageProducer) producerControl.getMock();
|
||||
BytesMessage response = new ActiveMQBytesMessage();
|
||||
String correlationId = "correlationId";
|
||||
Destination replyTo = new ActiveMQTopic();
|
||||
request.setJMSCorrelationID(correlationId);
|
||||
request.setJMSReplyTo(replyTo);
|
||||
request.reset();
|
||||
sessionControl.expectAndReturn(sessionMock.createBytesMessage(), response);
|
||||
sessionControl.expectAndReturn(sessionMock.createProducer(replyTo), producerMock);
|
||||
producerMock.marshalSendAndReceive(response);
|
||||
sessionControl.replay();
|
||||
producerControl.replay();
|
||||
|
||||
MessageEndpoint endpoint = new MessageEndpoint() {
|
||||
|
||||
public void invoke(MessageContext messageContext) throws Exception {
|
||||
messageContext.getResponse();
|
||||
}
|
||||
};
|
||||
messageListener.setMessageReceiver(endpoint);
|
||||
|
||||
messageListener.onMessage(request, sessionMock);
|
||||
|
||||
sessionControl.verify();
|
||||
producerControl.verify();
|
||||
assertEquals("Invalid correlationId", correlationId, response.getJMSCorrelationID());
|
||||
}
|
||||
|
||||
}*/
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright 2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.transport.jms;
|
||||
|
||||
import javax.jms.BytesMessage;
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
import javax.jms.Queue;
|
||||
import javax.jms.Session;
|
||||
import javax.jms.Topic;
|
||||
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
|
||||
|
||||
public class WebServiceMessageListenerIntegrationTest extends AbstractDependencyInjectionSpringContextTests {
|
||||
|
||||
private static final String CONTENT =
|
||||
"<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>" + "<SOAP-ENV:Body>\n" +
|
||||
"<m:GetLastTradePrice xmlns:m='http://www.springframework.org/spring-ws'>\n" +
|
||||
"<symbol>DIS</symbol>\n" + "</m:GetLastTradePrice>\n" + "</SOAP-ENV:Body></SOAP-ENV:Envelope>";
|
||||
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
private Queue responseQueue;
|
||||
|
||||
private Queue requestQueue;
|
||||
|
||||
private Topic requestTopic;
|
||||
|
||||
public WebServiceMessageListenerIntegrationTest() {
|
||||
setAutowireMode(AUTOWIRE_BY_NAME);
|
||||
}
|
||||
|
||||
public void setJmsTemplate(JmsTemplate jmsTemplate) {
|
||||
this.jmsTemplate = jmsTemplate;
|
||||
}
|
||||
|
||||
public void setRequestQueue(Queue requestQueue) {
|
||||
this.requestQueue = requestQueue;
|
||||
}
|
||||
|
||||
public void setRequestTopic(Topic requestTopic) {
|
||||
this.requestTopic = requestTopic;
|
||||
}
|
||||
|
||||
public void setResponseQueue(Queue responseQueue) {
|
||||
this.responseQueue = responseQueue;
|
||||
}
|
||||
|
||||
protected String[] getConfigLocations() {
|
||||
return new String[]{"classpath:org/springframework/ws/transport/jms/jms-receiver-applicationContext.xml"};
|
||||
}
|
||||
|
||||
public void testReceiveQueue() throws Exception {
|
||||
final byte[] b = CONTENT.getBytes("UTF-8");
|
||||
jmsTemplate.send(requestQueue, new MessageCreator() {
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
BytesMessage request = session.createBytesMessage();
|
||||
request.setJMSReplyTo(responseQueue);
|
||||
request.writeBytes(b);
|
||||
return request;
|
||||
}
|
||||
});
|
||||
BytesMessage response = (BytesMessage) jmsTemplate.receive(responseQueue);
|
||||
assertNotNull("No response received", response);
|
||||
}
|
||||
|
||||
public void testReceiveTopic() throws Exception {
|
||||
final byte[] b = CONTENT.getBytes("UTF-8");
|
||||
jmsTemplate.send(requestTopic, new MessageCreator() {
|
||||
public Message createMessage(Session session) throws JMSException {
|
||||
BytesMessage request = session.createBytesMessage();
|
||||
request.writeBytes(b);
|
||||
return request;
|
||||
}
|
||||
});
|
||||
Thread.sleep(100);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ws.transport.jms.support;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.springframework.ws.transport.jms.support.JmsTransportUtils;
|
||||
|
||||
public class JmsTransportUtilsTest extends TestCase {
|
||||
|
||||
public void testHeaderToJmsProperty() throws Exception {
|
||||
String result = JmsTransportUtils.headerToJmsProperty("SOAPAction");
|
||||
assertEquals("Invalid result", "SOAPJMS_soapAction", result);
|
||||
}
|
||||
}
|
||||
7
support/src/test/resources/log4j.properties
Normal file
7
support/src/test/resources/log4j.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
log4j.rootCategory=WARN, stdout
|
||||
log4j.logger.org.springframework.ws=DEBUG
|
||||
log4j.logger.org.springframework.jms=DEBUG
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" 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">
|
||||
|
||||
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="RequestQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestTopic" class="org.apache.activemq.command.ActiveMQTopic">
|
||||
<property name="physicalName" value="RequestTopic"/>
|
||||
</bean>
|
||||
|
||||
<bean id="responseQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="ResponseQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
|
||||
<property name="connectionFactory" ref="connectionFactory"/>
|
||||
<property name="destination" ref="requestQueue"/>
|
||||
<property name="messageListener" ref="messageListener"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
|
||||
<property name="connectionFactory" ref="connectionFactory"/>
|
||||
<property name="destination" ref="requestTopic"/>
|
||||
<property name="messageListener" ref="messageListener"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageListener" class="org.springframework.ws.transport.jms.WebServiceMessageListener">
|
||||
<property name="messageFactory">
|
||||
<bean class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
|
||||
</property>
|
||||
<property name="messageReceiver" ref="messageReceiver"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageReceiver" class="org.springframework.ws.transport.SimpleTestingMessageReceiver"/>
|
||||
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" 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">
|
||||
|
||||
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<property name="physicalName" value="RequestQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory"/>
|
||||
<property name="defaultDestination" ref="requestQueue"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSender" class="org.springframework.ws.transport.jms.JmsMessageSender">
|
||||
<property name="connectionFactory" ref="connectionFactory"/>
|
||||
<property name="receiveTimeout" value="10"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user