JMS WSDL question

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

JMS WSDL question

Johnson, Eric
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?
Reply | Threaded
Open this post in threaded view
|

Re: JMS WSDL question

Willem2
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.xsd


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?
>
>  
>

Reply | Threaded
Open this post in threaded view
|

RE: JMS WSDL question

Johnson, Eric
In reply to this post by Johnson, Eric
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:[hidden email]]
> Sent: Thursday, November 16, 2006 8:07 PM
> To: [hidden email]
> 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.xsd
>
>
> 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?
> >
> >  
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: JMS WSDL question

Willem2
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:[hidden email]]
>>Sent: Thursday, November 16, 2006 8:07 PM
>>To: [hidden email]
>>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.xsd
>>
>>
>>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?
>>>
>>>
>>>
>>>      
>>>
>>    
>>
>
>  
>

Reply | Threaded
Open this post in threaded view
|

RE: JMS WSDL question

Johnson, Eric
In reply to this post by Johnson, Eric
 
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:[hidden email]]
> Sent: Thursday, November 16, 2006 8:40 PM
> To: [hidden email]
> 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:[hidden email]]
> >>Sent: Thursday, November 16, 2006 8:07 PM
> >>To: [hidden email]
> >>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.xsd
> >>
> >>
> >>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?
> >>>
> >>>
> >>>
> >>>      
> >>>
> >>    
> >>
> >
> >  
> >
>
>
Reply | Threaded
Open this post in threaded view
|

RE: JMS WSDL question

Ulhas Bhole
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:[hidden email]]
> > Sent: Thursday, November 16, 2006 8:40 PM
> > To: [hidden email]
> > 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:[hidden email]]
> > >>Sent: Thursday, November 16, 2006 8:07 PM
> > >>To: [hidden email]
> > >>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.xsd
> > >>
> > >>
> > >>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?
> > >>>
> > >>>
> > >>>
> > >>>      
> > >>>
> > >>    
> > >>
> > >
> > >  
> > >
> >
> >
Reply | Threaded
Open this post in threaded view
|

RE: JMS WSDL question

Ulhas Bhole
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:[hidden email]]
> > > Sent: Thursday, November 16, 2006 8:40 PM
> > > To: [hidden email]
> > > 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:[hidden email]]
> > > >>Sent: Thursday, November 16, 2006 8:07 PM
> > > >>To: [hidden email]
> > > >>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.xsd
> > > >>
> > > >>
> > > >>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?
> > > >>>
> > > >>>
> > > >>>
> > > >>>      
> > > >>>
> > > >>    
> > > >>
> > > >
> > > >  
> > > >
> > >
> > >

Client.java (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: JMS WSDL question

Johnson, Eric
In reply to this post by Johnson, Eric
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:[hidden email]]
> Sent: Friday, November 17, 2006 11:41 AM
> To: [hidden email]
> 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:[hidden email]]
> > > > Sent: Thursday, November 16, 2006 8:40 PM
> > > > To: [hidden email]
> > > > 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:[hidden email]]
> > > > >>Sent: Thursday, November 16, 2006 8:07 PM
> > > > >>To: [hidden email]
> > > > >>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?
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>      
> > > > >>>
> > > > >>    
> > > > >>
> > > > >
> > > > >  
> > > > >
> > > >
> > > >
>
Reply | Threaded
Open this post in threaded view
|

答复: JMS WSDL question

Willem2
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:[hidden email]]
Sent: 11/18/2006 (星期六) 0:48
To: [hidden email]; 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:[hidden email]]
> Sent: Friday, November 17, 2006 11:41 AM
> To: [hidden email]
> 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:[hidden email]]
> > > > Sent: Thursday, November 16, 2006 8:40 PM
> > > > To: [hidden email]
> > > > 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:[hidden email]]
> > > > >>Sent: Thursday, November 16, 2006 8:07 PM
> > > > >>To: [hidden email]
> > > > >>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?
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>      
> > > > >>>
> > > > >>    
> > > > >>
> > > > >
> > > > >  
> > > > >
> > > >
> > > >
>

Reply | Threaded
Open this post in threaded view
|

Re: 答复: JMS WSDL question

Willem2
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\GreeterImplTwoWayJMS.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\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:[hidden email]]
>Sent: 11/18/2006 (星期六) 0:48
>To: [hidden email]; 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
>
>  
>

Reply | Threaded
Open this post in threaded view
|

RE: 答复: JMS WSDL question

Johnson, Eric
In reply to this post by Willem2
Thanks a ton Willem.

> -----Original Message-----
> From: Willem Jiang [mailto:[hidden email]]
> Sent: Sunday, November 19, 2006 8:51 PM
> To: [hidden email]
> 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:[hidden email]]
> >Sent: 11/18/2006 (星期六) 0:48
> >To: [hidden email]; 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
> >
> >  
> >
>
>