cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiang, Ning \(Willem\)" <Ning.Ji...@iona.com>
Subject 答复: JMS WSDL question
Date Sat, 18 Nov 2006 02:29:07 GMT
Hi Eric,
I may missunderstand the context which we talk about. Ulhas said it right. Current CXF also
support to set and get the JMS header properities from the context. There is an system for
it , which you can find from trunk\systests\src\test\java\org\apache\cxf\systest\jms\JMSClientServerTest.java


public void testContextPropogation() throws Exception {
        serviceName =  new QName("http://cxf.apache.org/hello_world_jms",
                                 "HelloWorldService");
        portName = new QName("http://cxf.apache.org/hello_world_jms", "HelloWorldPort");
        URL wsdl = getClass().getResource("/wsdl/jms_test.wsdl");
        assertNotNull(wsdl);

        HelloWorldService service = new HelloWorldService(wsdl, serviceName);
        assertNotNull(service);

        try {

            //Current CXF support addPort API, which would make the code and wsdl more easy
to read 
            HelloWorldPortType greeter = service.getPort(portName, HelloWorldPortType.class);
            InvocationHandler handler  = Proxy.getInvocationHandler(greeter);
            BindingProvider  bp = null;
            
            if (handler instanceof BindingProvider) {
                bp = (BindingProvider)handler;
                //System.out.println(bp.toString());
                Map<String, Object> requestContext = bp.getRequestContext();
                JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
                requestHeader.setJMSCorrelationID("JMS_SAMPLE_CORRELATION_ID");
                requestHeader.setJMSExpiration(3600000L);
                JMSPropertyType propType = new JMSPropertyType();
                propType.setName("Test.Prop");
                propType.setValue("mustReturn");
                requestHeader.getProperty().add(propType);
                requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
            } 
 
            String greeting = greeter.greetMe("Milestone-");
            assertNotNull("no response received from service", greeting);

            assertEquals("Hello Milestone-", greeting);

            if (bp != null) {
                Map<String, Object> responseContext = bp.getResponseContext();
                JMSMessageHeadersType responseHdr = 
                     (JMSMessageHeadersType)responseContext.get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
                if (responseHdr == null) {
                    fail("response Header should not be null");
                }
                
                assertTrue("CORRELATION ID should match :", 
                           "JMS_SAMPLE_CORRELATION_ID".equals(responseHdr.getJMSCorrelationID()));
                assertTrue("response Headers must conain the app specific property set by
request context.", 
                           responseHdr.getProperty() != null);
            }
        } catch (UndeclaredThrowableException ex) {
            throw (Exception)ex.getCause();
        }
    }

You may need some sample for the server side, I will show you it later.

Current CXF JMS can't get the address , client , server configuration from the Context that
I just show you.
JMS message header properties can't be setted from the spring configuration.

Eric, would you please review them? If you have any JMS related requirements or issues, please
feel free to ask me.

I will go through them, and do some clean up work next week.

Thanks,

Willem. 
  


-----Original Message-----
From: Johnson, Eric [mailto:Eric.Johnson@iona.com]
Sent: 11/18/2006 (星期六) 0:48
To: cxf-dev@incubator.apache.org; Bhole, Ulhas
Subject: RE: JMS WSDL question
 
Thanks for the added information Ulhas. Willem mentioned that the Celtix
context stuff does not work, but that he was looking into to it.
Cheers,
Eric 

> -----Original Message-----
> From: Ulhas Bhole [mailto:ulhas.bhole@iona.com] 
> Sent: Friday, November 17, 2006 11:41 AM
> To: cxf-dev@incubator.apache.org
> Subject: RE: JMS WSDL question
> 
> Hi Eric,
> 
> Here is the sample attached of the old client that shows how 
> it was used. 
> 
> I am not sure whether current code supports the same model to 
> access JMS context info. On other thing to clarify on the 
> WSDL, configuration, and JMS-context stuff is that JMS WSDL 
> extensors can be configured via Configuration but some 
> configuration specific stuff like session pool size cannot be 
> set in WSDL and same holds true for context info. which 
> cannot be set via WSDL or configuration.
> 
> Regards,
> 
> Ulhas Bhole
> 
> On Fri, 2006-11-17 at 16:12 +0000, Ulhas Bhole wrote:
> > Hi Eric,
> > 
> > It needs to be set programmatically and very few of the 
> attributes are
> > settable. It is set through   RequestContext and can be 
> retrived from
> > respose via ResponseContext.
> > 
> > If you want the exact mechanism you will need to search for 
> some old 
> > installer of celtix (pre-apache) and look at the JMS samples.
> > 
> > Regards,
> > 
> > Ulhas Bhole
> > 
> > On Fri, 2006-11-17 at 10:30 -0500, Johnson, Eric wrote:
> > >  No it is a slightly different question.
> > > I'm wondering how I go about setting the JMS header 
> attributes such 
> > > as JMSPriority. Do I do it in the WSDL using the elements 
> defined in 
> > > the jms-context namespace? Is there a way to do this 
> programmatically?
> > > Cheers,
> > > Eric
> > > 
> > > > -----Original Message-----
> > > > From: Willem Jiang [mailto:ning.jiang@iona.com]
> > > > Sent: Thursday, November 16, 2006 8:40 PM
> > > > To: cxf-dev@incubator.apache.org
> > > > Subject: Re: JMS WSDL question
> > > > 
> > > > Hi Eric,
> > > > 
> > > > I do a quick look into the code, I think current CXF doesn't 
> > > > support get the header properties from configuration, because 
> > > > there is no header related beans in the generated code.
> > > > I can fill a JIRA task for it and will get it done next week.
> > > > One more question, I remember you had a mail for the  
> JMS Context 
> > > > Mechanism.
> > > > Is it  the same question with this header issue?
> > > > There are both "Context" related  jms-context element and maybe 
> > > > some kind of Message context :)
> > > > 
> > > > Cheers,
> > > > Willem.
> > > >  
> > > > 
> > > > Johnson, Eric wrote:
> > > > 
> > > > >Willem,
> > > > >So I can use the jms-context elements in the WSDL to 
> specify the 
> > > > >JMS header properties? Can I also place them in the 
> configuration file?
> > > > >Are there examples?
> > > > >Cheers,
> > > > >Eric
> > > > > 
> > > > >
> > > > >  
> > > > >
> > > > >>-----Original Message-----
> > > > >>From: Willem Jiang [mailto:ning.jiang@iona.com]
> > > > >>Sent: Thursday, November 16, 2006 8:07 PM
> > > > >>To: cxf-dev@incubator.apache.org
> > > > >>Subject: Re: JMS WSDL question
> > > > >>
> > > > >>Hi Eric,
> > > > >>
> > > > >>You can find the schema of the jms WSDL extensions from 
> > > > 
> >>trunk/common/schemas/src/main/resources/schemas/wsdl/jms-context
> > > > >>.xsd
> > > > >>and
> > > > 
> >>trunk/common/schemas/src/main/resources/schemas/wsdl/jms-conf.xs
> > > > >>d
> > > > >>
> > > > >>
> > > > >>Willem.
> > > > >>
> > > > >>Johnson, Eric wrote:
> > > > >>
> > > > >>    
> > > > >>
> > > > >>>Can the elements defined in jms-conf and jms-context be
> > > > used as WSDL
> > > > >>>extensions? For example can I set the session pooling
> > > > values or the
> > > > >>>time-to-live in the WSDL for a JMS endpoint?
> > > > >>>
> > > > >>> 
> > > > >>>
> > > > >>>      
> > > > >>>
> > > > >>    
> > > > >>
> > > > >
> > > > >  
> > > > >
> > > > 
> > > > 
> 


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message