On 9/14/10 4:16 PM, Willem Jiang wrote:
On 9/14/10 4:01 PM, Jim Ma wrote:
We already replaced "http://cxf.apache.org/transports/jms"; with
"http://www.w3.org/2010/soapjms/"; in SOAPBindingFactory:

if
("http://cxf.apache.org/transports/jms".equals(config.getTransportURI()))
{
info.setTransportURI("http://www.w3.org/2010/soapjms/";);
config.setTransportURI("http://www.w3.org/2010/soapjms/";);
} else {
info.setTransportURI(config.getTransportURI());
}

Does that mean we internally remove the
"http://cxf.apache.org/transports/jms"; transport support and
completely move to soap jms stuff ?

I don't think it's a good idea to override the old jms transport id
"http://cxf.apache.org/transports/jms"; with the new SOAP over JMS
transportId, In this case we will face a problem that CXF 2.3.0 will not
support the JMS configure of CXF 2.2.x.But I can't remember why this
code was put into SOAPBindingFactory.

After checking the change log and the chat log, I found why we have the upper codes. The upper codes is try to support to specify the address with JMS URI in code first model with JAXWS API (You can't specify the transportId from that). But it will cause the side effect that CXF 2.3.0 will not support the old JMS configuration out of box.

As we can't get the address string from the SoapBindingConfiguration to workaround this issue, JAXWS API doesn't support the SOAP over JMS specification out of box, and we still support the old JMS configuration, so I suggest to remove this code.

Any thoughts ?

Willem

I will did a quick fix for it.

Willem


On Tue, Sep 14, 2010 at 3:46 PM, Jim Ma<[email protected]> wrote:
The cxf.xml I just pasted is I modified to test .
Here is the original one which works before the soap jms change :

<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns='http://www.springframework.org/schema/beans'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:beans='http://www.springframework.org/schema/beans'
xmlns:jms="http://cxf.apache.org/transports/jms";
xmlns:jaxws='http://cxf.apache.org/jaxws'
xsi:schemaLocation='http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.w3.org/2006/07/ws-policy
http://www.w3.org/2006/07/ws-policy.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd'>

<jaxws:endpoint
implementor='org.jboss.test.ws.jaxws.samples.jmsendpoints.jmstransport.OrganizationJmsEndpoint'

transportId="http://cxf.apache.org/transports/jms";>
</jaxws:endpoint>

<jms:destination
name="{http://org.jboss.ws/samples/jmstransport}JmsPort.jms-destination";>

<jms:address
destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="queue/RequestQueue"
jndiReplyDestinationName="queue/ResponseQueue">
</jms:address>
</jms:destination>

<jms:conduit
name="{http://org.jboss.ws/samples/jmstransport}JmsPort.jms-conduit";>
<jms:address
destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="queue/RequestQueue"
jndiReplyDestinationName="queue/ResponseQueue">
</jms:address>
</jms:conduit>

</beans>

On Tue, Sep 14, 2010 at 1:27 PM, Jim Ma<[email protected]> wrote:
Hi all ,
After this commit, the SoapJMSInInterceptor is added to check the
"SOAPJMS_conentType" and other key/value pairs in message header . It
requires the "SOAPJMS_contentType" and other properties added in the
jms message. Are such header (jms message property) checks in
SoapJMSInInterceptor required in SOAP JMS specification ? If the
answer is yes , do we actually need to require user to add these
properties to each jms request message as we do in
SOAPJMSTestSuiteTest now ?

I also want to keep the following java first jms test case work
without properties setting in jms message ? Can the SoapJMSInteceptor
automatically be disabled for this test case ?

------SEI impl-----------
@javax.jws.WebService(portName = "GreeterPort",
serviceName = "JMSGreeterService",
targetNamespace = "http://cxf.apache.org/jms_greeter";,
public class GreeterJMSImpl {
public String greetMe(String me) {
LOG.info("Executing operation greetMe");
System.out.println("Executing operation greetMe");
System.out.println("Message received: " + me + "\n");
return "Hello " + me;
}


-----------------cxf.xml ------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans
....
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/jms
http://cxf.apache.org/schemas/configuration/jms.xsd'>

<jaxws:endpoint
implementor='org.apache.cxf.jms_greeter.GreeterJMSImpl'
transportId="http://www.w3.org/2010/soapjms/";>
</jaxws:endpoint>

<jms:destination
name="{http://cxf.apache.org/jms_greeter}GreeterPort.jms-destination";>
<jms:address
destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="queue/RequestQueue"
jndiReplyDestinationName="queue/ResponseQueue">
</jms:address>
</jms:destination>

<jms:conduit
name="{http://cxf.apache.org/jms_greeter}GreeterPort..jms-conduit";>
<jms:address
destinationStyle="queue"
jndiConnectionFactoryName="ConnectionFactory"
jndiDestinationName="queue/RequestQueue"
jndiReplyDestinationName="queue/ResponseQueue">
</jms:address>
</jms:conduit>
</beans>

---Client code -------
String reqMessage ="<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>...</env:Envelope>";

InitialContext context = new InitialContext();
QueueConnectionFactory connectionFactory
(QueueConnectionFactory)context.lookup("ConnectionFactory");
Queue reqQueue = (Queue)context.lookup("queue/RequestQueue");
Queue resQueue = (Queue)context.lookup("queue/ResponseQueue");
QueueConnection con = connectionFactory.createQueueConnection();
QueueSession session = con.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueReceiver receiver = session.createReceiver(resQueue);
ResponseListener responseListener = new ResponseListener();
receiver.setMessageListener(responseListener);
con.start();

TextMessage message = session.createTextMessage(reqMessage);
message.setJMSReplyTo(resQueue);
waitForResponse = true;
QueueSender sender = session.createSender(reqQueue);
sender.send(message);
sender.close();
int timeout = 5;
while (waitForResponse&& timeout> 0)
{
Thread.sleep(1000);
timeout = timeout -1;
}


Cheers,
Jim

Reply via email to