You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Balaji Kandan <bk...@orangescape.com> on 2004/05/20 16:19:57 UTC

AXIS - jms transaction

Does AXIS support jms transactions for jms transport mechanism???

 

balaji


RE: AXIS - jms transaction

Posted by Balaji <bk...@orangescape.com>.
thanks Biorn...i am looking forward to implement this change...

Thanks for ur input,
balaji

-----Original Message-----
From: Biörn Biörnstad [mailto:bioern-infnews@vis.ethz.ch] 
Sent: Monday, May 24, 2004 5:10 PM
To: axis-user@ws.apache.org
Subject: Re: AXIS - jms transaction

Hi Balaji,

IMO there is no workaround since you need to control the way jms session are

created, which is "internal" to the code. I'm not sure how complicated it
would 
be to add this feature. The axis jms code is quite complex since the authors

have built a huge abstraction mechnism for connecting to a jms system.

Basically you only need to change two things (I don't know how familiar you
are 
with JMS...).
- when the jms session is created make it transacted.
- after processing a WS request (possibly sending a response) commit the tx.

Session:
This is a bit complicated since you need to understand the axis jms
connection 
machinery. I searched and found the following two methods to be the only
place 
where jms sessions are created. So, you should be safe changing these two 
methods to return transacted sessions.

o.a.a.transport.jms.TopicConnector.createTopicSession(TopicConnection 
connection, int ackMode)

o.a.a.transport.jms.QueueConnector.createQueueSession(QueueConnection 
connection, int ackMode)

There remains one problem: you need to use the same session for receiving
the 
request as for sending the reply. Using a transaction for only one message
is of 
no use. I'm not sure whether axis uses one or two separate sessions for
these tasks.

Committing:
This seems easy at first sight but turns out be quite tricky as well. In 
SimpleJMSWorker.run() you need to commit at the end of the method. But for
this 
you need a reference to the jms session and I don't know how to get that.

So, in the end it doesn't seem very easy to add this feature.

Bioern


Balaji Kandan wrote:
> Hi Biorn,
> Thanks for replying, are u saying the only way to implement transactions
is
> to rewrite the JMS Transport? Or is there a workaround?
> 
> Thanks in advance,
> balaji





Re: AXIS - jms transaction

Posted by Biörn Biörnstad <bi...@vis.ethz.ch>.
Hi Balaji,

IMO there is no workaround since you need to control the way jms session are 
created, which is "internal" to the code. I'm not sure how complicated it would 
be to add this feature. The axis jms code is quite complex since the authors 
have built a huge abstraction mechnism for connecting to a jms system.

Basically you only need to change two things (I don't know how familiar you are 
with JMS...).
- when the jms session is created make it transacted.
- after processing a WS request (possibly sending a response) commit the tx.

Session:
This is a bit complicated since you need to understand the axis jms connection 
machinery. I searched and found the following two methods to be the only place 
where jms sessions are created. So, you should be safe changing these two 
methods to return transacted sessions.

o.a.a.transport.jms.TopicConnector.createTopicSession(TopicConnection 
connection, int ackMode)

o.a.a.transport.jms.QueueConnector.createQueueSession(QueueConnection 
connection, int ackMode)

There remains one problem: you need to use the same session for receiving the 
request as for sending the reply. Using a transaction for only one message is of 
no use. I'm not sure whether axis uses one or two separate sessions for these tasks.

Committing:
This seems easy at first sight but turns out be quite tricky as well. In 
SimpleJMSWorker.run() you need to commit at the end of the method. But for this 
you need a reference to the jms session and I don't know how to get that.

So, in the end it doesn't seem very easy to add this feature.

Bioern


Balaji Kandan wrote:
> Hi Biorn,
> Thanks for replying, are u saying the only way to implement transactions is
> to rewrite the JMS Transport? Or is there a workaround?
> 
> Thanks in advance,
> balaji


About the xs:choice and xs:choice maxOccurs="unbounded"

Posted by jiadao <ji...@ds.e-technik.uni-dortmund.de>.
Hi:
I found that the terms enwrapped with the 
<Xs:choice> </xs:choice> and <xs:all> </xs:all> or just use the
<xs:sequence> </xs:sequence>
These complexTypes are serialized into the javatypes, 
They are basically the same. I can not see any logic in the 
created javacode. I am not sure whether I am wrong?

For example:
 <xs:complexType name="example">
   <xs:sequence>
    <xs:choice maxOccurs="unbounded">
      <xs:element name="a" type="x:aa" /> 
      <xs:element name="b" type="x:bb" /> 
  </xs:choice>
  </xs:sequence>
  </xs:complexType> 
  the above the maxOccurs seems have no effect at all.
  <xs:complexType name="example">
   <xs:sequence>
    <xs:all maxOccurs="unbounded">
      <xs:element name="a" type="x:aa" /> 
      <xs:element name="b" type="x:bb" /> 
  </xs:all>
  </xs:sequence>
  </xs:complexType>

The created javatypes are basically the same. Also ,
I think that the <choice maxOccurs="unbounded">
There are should be one Arrary to reprensent it, but I can not
Find any arrary in the Java files.

any Sugestions? I am wondering whether I have to implement the "choice",
"all" myself? Can the Axis WSDL2Java can do it for me ?
thank u very much
jiadao 




Re: How to Serialize/Deserialize to/from file(For testing)

Posted by aa bb <al...@yahoo.com>.
Ok -- New Direction trying the following:
AxisEngine ae = new AxisServer().getClientEngine();
		
        FileReader reader = new FileReader(new
File("//var//tmp/goodResponse/goodResponse.xml"));
        InputSource is = new InputSource(reader);
        MessageContext mc = new MessageContext(ae);
        
		DeserializationContext dc = new
DeserializationContextImpl(is,mc,Constants.AXIS_SAX);
		dc.parse();
Yet the next step would be to obtain a Deserializer
from dc, yet it is coming back null?
Any one know why ?

org.apache.axis.encoding.Deserializer deser =
dc.getDeserializer(_OTA_AirLowFareSearchRS.class,new
javax.xml.namespace.QName("http://www.opentravel.org/OTA/2003/05",
">OTA_AirLowFareSearchRS"));

--- aa bb <al...@yahoo.com> wrote:
> I have seen this posting here, yet with on
> definitive
> answers.
> So, I figured we could put something together...
> 
> Here is the situation:
> We are a consumer of a WS and the providers test
> systems are like a yoyo always up and down. In order
> to keep our development team moveing Iam needing to
> perform this type of task...
> I can obtain a good response, capture it to file by
> serializing it and then have the developers use the
> file and deserialize it and continue developing
> while
> the yoyo is down..
> 
> Can any one help ?
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://messenger.yahoo.com/ 


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

How to Serialize/Deserialize to/from file(For testing)

Posted by aa bb <al...@yahoo.com>.
I have seen this posting here, yet with on definitive
answers.
So, I figured we could put something together...

Here is the situation:
We are a consumer of a WS and the providers test
systems are like a yoyo always up and down. In order
to keep our development team moveing Iam needing to
perform this type of task...
I can obtain a good response, capture it to file by
serializing it and then have the developers use the
file and deserialize it and continue developing while
the yoyo is down..

Can any one help ?


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

RE: AXIS - jms transaction

Posted by jiadao <ji...@ds.e-technik.uni-dortmund.de>.
Or in other words, I found that the terms enwrapped with the 
<Xs:choice> </xs:choice> and <xs:all> </xs:all> or just use the
<xs:sequence> </xs:sequence>
These complexTypes are serialized into the javatypes, 
They are basically the same. I can not see any logic in the 
created javacode. I am not sure whether I am wrong?


 <xs:complexType name="example">
   <xs:sequence>
    <xs:choice maxOccurs="unbounded">
      <xs:element name="a" type="x:aa" /> 
      <xs:element name="b" type="x:bb" /> 
  </xs:choice>
  </xs:sequence>
  </xs:complexType> 
  the above the maxOccurs seems have no effect at all.
  <xs:complexType name="example">
   <xs:sequence>
    <xs:all maxOccurs="unbounded">
      <xs:element name="a" type="x:aa" /> 
      <xs:element name="b" type="x:bb" /> 
  </xs:all>
  </xs:sequence>
  </xs:complexType>

any Sugestions? I am wondering whether I have to implement the "choice",
"all" myself? Can the Axis WSDL2Java can do it for me ?
thank u very much
jiadao 



-----Original Message-----
From: jiadao [mailto:jiadao@ds.e-technik.uni-dortmund.de] 
Sent: Montag, 24. Mai 2004 17:50
To: axis-user@ws.apache.org
Subject: RE: AXIS - jms transaction

Hi, 
   I am wondering that whether the AXIS has implemented all the XML
schema ,the JAX-RPC specification 1.1, for example the <xs:choice>,
<xs:all> and so on. Can the WSDL2Java do all the serialization and
deserialization of the java types between the xml types which conforms
to the xml schema.

thank very much!

jiadao
. 




RE: AXIS - jms transaction

Posted by jiadao <ji...@ds.e-technik.uni-dortmund.de>.
Hi, 
   I am wondering that whether the AXIS has implemented all the XML
schema ,the JAX-RPC specification 1.1, for example the <xs:choice>,
<xs:all> and so on. Can the WSDL2Java do all the serialization and
deserialization of the java types between the xml types which conforms
to the xml schema.

thank very much!

jiadao
. 



RE: AXIS - jms transaction

Posted by Balaji Kandan <bk...@orangescape.com>.
Hi Biorn,
Thanks for replying, are u saying the only way to implement transactions is
to rewrite the JMS Transport? Or is there a workaround?

Thanks in advance,
balaji

-----Original Message-----
From: Biörn Biörnstad [mailto:bioern-infnews@vis.ethz.ch] 
Sent: Friday, May 21, 2004 10:19 PM
To: axis-user@ws.apache.org
Subject: Re: AXIS - jms transaction

Hi Balaji

Although it would make sense to use jms transactions in an axis server the 
source code doesn't seem to make any use of them.

-Bioern

Balaji Kandan wrote:
> Does AXIS support jms transactions for jms transport mechanism???
> 
>  
> 
> balaji
> 
> 





Re: AXIS - jms transaction

Posted by Biörn Biörnstad <bi...@vis.ethz.ch>.
Hi Balaji

Although it would make sense to use jms transactions in an axis server the 
source code doesn't seem to make any use of them.

-Bioern

Balaji Kandan wrote:
> Does AXIS support jms transactions for jms transport mechanism???
> 
>  
> 
> balaji
> 
>