return operation;
}
protected void setHeaderProperties(Message requestJMSMsg, MessageImpl tuscanyMsg, Operation operation) throws JMSException {
EndpointReference from = new EndpointReferenceImpl(null);
tuscanyMsg.setFrom(from);
from.setCallbackEndpoint(new EndpointReferenceImpl("/")); // TODO: whats this for?
ReferenceParameters parameters = from.getReferenceParameters();
String conversationID = requestJMSMsg.getStringProperty(JMSBindingConstants.CONVERSATION_ID_PROPERTY);
if (conversationID != null) {
parameters.setConversationID(conversationID);
}
if (service.getInterfaceContract().getCallbackInterface() != null) {
String callbackdestName = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
if (callbackdestName == null && operation.isNonBlocking()) {
// if the request has a replyTo but this service operation is oneway but the service uses callbacks
// then use the replyTo as the callback destination
Destination replyTo = requestJMSMsg.getJMSReplyTo();
if (replyTo != null) {
callbackdestName = (replyTo instanceof Queue) ? ((Queue)replyTo).getQueueName() : ((Topic)replyTo).getTopicName();
}
}
if (callbackdestName != null) {
// append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
// as otherwise the invoker should use the uri from the service callback binding
parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
}
String callbackID = requestJMSMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
if (callbackID != null) {
parameters.setCallbackID(callbackID);