cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: svn commit: r986571 - in /cxf/trunk: distribution/src/main/release/samples/jms-spec-demo/wsdl/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/ rt/bindings/soa
Date Wed, 15 Sep 2010 00:58:27 GMT
Hi Dan
On 9/14/10 11:06 PM, Daniel Kulp wrote:
> On Tuesday 14 September 2010 8:47:34 am Willem Jiang wrote:
>> On 9/14/10 4:16 PM, Willem Jiang wrote:
>> 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.
>
> No, we really want a jaxws style Endpoint.publish("jms://.....") type thing to
> work with the soap/jms stuff.
>
> One option would be to have an extra flag on SoapBindingInfo that record if
> this is really a full "soap/jms spec compliant" thing or not.  The
> SoapBindingFactory could then use that flag to determine whether to add the
> extra interceptors or not.
>
> Would that work?
>
> Dan
>

The address is bond to endpoint which is decoupled with the BingingInfo, 
so it is hard to detect the address information when we create the 
SoapBindingInfo.

Here is a way to override the transportId without any addition 
configuration for the jaxws style Endpoint.publish("jms://....."). As 
the old JMS transport doesn't support the jms URI, we just need to hack 
the transportId looking up processor from the 
AbstractWSDLBasedEndpointFactory to set the transportId with soap over 
jms transportId if there is an address which is started with "jms://".

How about it?

Willem


>
>
>>
>> Any thoughts ?
>>
>> Willem
>>
>>> I will did a quick fix for it.
>>>
>>> Willem
>>>
>>>> On Tue, Sep 14, 2010 at 3:46 PM, Jim Ma<mail2jimma@gmail.com>  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<mail2jimma@gmail.com> 
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:Envelop
>>>>>> e>";
>>>>>>
>>>>>> 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
>


Mime
View raw message