cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Eric" <Eric.John...@iona.com>
Subject RE: 答复: JMS WSDL question
Date Mon, 20 Nov 2006 14:04:33 GMT
Thanks a ton Willem. 

> -----Original Message-----
> From: Willem Jiang [mailto:ning.jiang@iona.com] 
> Sent: Sunday, November 19, 2006 8:51 PM
> To: cxf-dev@incubator.apache.org
> Subject: Re: 答复: JMS WSDL question
> 
> Hi Eric,
> 
> Here is the Server side code which can get and set the JMS 
> Header properties from context.
> 
> I had add the demo code to the
> 
> trunk\systests\src\test\java\org\apache\cxf\systest\jms\Greete
> rImplTwoWayJMS.java 
>     
>     @Resource
>     protected WebServiceContext wsContext;
>     public String greetMe(String me) {
>         MessageContext mc = wsContext.getMessageContext();
>         JMSMessageHeadersType headers =
>             (JMSMessageHeadersType) 
> mc.get(JMSConstants.JMS_SERVER_HEADERS);
>         System.out.println("get the message headers 
> JMSCorrelationID" + headers.getJMSCorrelationID());
>         System.out.println("Reached here :" + me);
>         return "Hello " + me;
>     }
> 
> Can You have a look :)
> 
> 
> Willem.
> 
> 
> Jiang, Ning (Willem) wrote:
> 
> >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\JMSCl
> ientServer
> >Test.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_CL
IENT_RESPONSE_HEADERS);
> >                if (responseHdr == null) {
> >                    fail("response Header should not be null");
> >                }
> >                
> >                assertTrue("CORRELATION ID should match :", 
> >                           
> "JMS_SAMPLE_CORRELATION_ID".equals(responseHdr.getJMSCorrelati
> onID()));
> >                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
> >
> >  
> >
> 
> 

Mime
View raw message