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 Aaron Evans <aa...@yahoo.ca> on 2006/01/21 17:05:17 UTC
[Axis2-0.94] - problem with generated stub
Hi,
I generated a client stub based on some wsdl from a third party. The client stub
uses ADB for data binding.
I've noticed some strange behaviour and was wondering if anyone else has seen
something similar or can explain it to me.
Basically, there are two web service methods (wsdl:operation) that I am using,
call them A and B.
Now say I need to call A twice, then B twice.
If I instantiate a new instance of the stub for each invocation, then everything
works fine.
However, if I only instantiate the client stub once and try to reuse it for
all service method invocations, it works fine for the two calls to A, but
as soon as I start calling B, things don't work as they should.
B is supposed to return a complex type called 'BResponse' that simply contains
a sequence (of max lenght 1) of a complex type, C.
B comes back non-null, but C is coming back null.
If I reverse the order of the method calls (so, B,B,A,A), then the first two
calls to B then work fine, but as soon as I start calling A, the same thing
happens.
A is supposed to return an object, AResponse that contains an object D, but
D ends up coming back as null.
Any ideas?
I have been out of the web service world for a little while now, so excuse
me if this isn't very clear.
Incidentally, I remember a few years back when I was using axis 1, there was
a java tool that was very nice for debugging that you could use as a proxy in
between the client and the ws endpoint and it would show you the soap headers
and payloads that were going back and forth. Does anyone know what I'm talking
about and where to get it?
thx,
aaron
Re: [Axis2-0.94] - problem with generated stub
Posted by Aaron Evans <aa...@yahoo.ca>.
Ajith Ranabahu <ajith.ranabahu <at> gmail.com> writes:
>
>
> Nope, No need to touch the generated code. Just the mentioned fix will do
>
Thanks, worked like a charm! :)
Re: [Axis2-0.94] - problem with generated stub
Posted by Ajith Ranabahu <aj...@gmail.com>.
Nope, No need to touch the generated code. Just the mentioned fix will do
On 1/22/06, Aaron Evans <aa...@yahoo.ca> wrote:
>
> Ajith Ranabahu <ajith.ranabahu <at> gmail.com> writes:
>
> >
> >
> > Hi Aaron,
> > This is a bug in the newly introduced options class. We actually found
> > the problem few days back and fixed it in the latest codebase.
> > The problem is that the stub wise options object (you'll see this when
> > you open the generated stub code) attaches itself to the operation
> > clients options object once a method has been called!
> > Here is the fix if you have the .94 code. (Unfortunatley I can't think
> > of a workaround that does not include manipulating code :()
> >
> > Open the org.apache.axis2.client.Options class in the core module.
> > at line 223 change the soapAction = parent.getSOAPAction();
> > to return parent.getSOAPAction();
> > Now that method should look like this
> > public String getSoapAction() {
> > if (soapAction == null && parent != null) {
> > return parent.getSoapAction();
> > }
> > return (soapAction != null) ? soapAction : "";
> > }
> > Other getter methods also need to be modified in this way but
> essentially this
> is the method that would make the difference.
> > Ajith
> >
>
> Thanks, I will do the above patch in my environment. One question though,
> you
> say that "other getter methods also need to be modified in this way". Is
> this
> restricted to the axis core source or do I also need to patch my generated
> stub
> at all?
>
> aaron
>
>
--
Ajith Ranabahu
Re: [Axis2-0.94] - problem with generated stub
Posted by Aaron Evans <aa...@yahoo.ca>.
Ajith Ranabahu <ajith.ranabahu <at> gmail.com> writes:
>
>
> Hi Aaron,
> This is a bug in the newly introduced options class. We actually found
> the problem few days back and fixed it in the latest codebase.
> The problem is that the stub wise options object (you'll see this when
> you open the generated stub code) attaches itself to the operation
> clients options object once a method has been called!
> Here is the fix if you have the .94 code. (Unfortunatley I can't think
> of a workaround that does not include manipulating code :()
>
> Open the org.apache.axis2.client.Options class in the core module.
> at line 223 change the soapAction = parent.getSOAPAction();
> to return parent.getSOAPAction();
> Now that method should look like this
> public String getSoapAction() {
> if (soapAction == null && parent != null) {
> return parent.getSoapAction();
> }
> return (soapAction != null) ? soapAction : "";
> }
> Other getter methods also need to be modified in this way but essentially this
is the method that would make the difference.
> Ajith
>
Thanks, I will do the above patch in my environment. One question though, you
say that "other getter methods also need to be modified in this way". Is this
restricted to the axis core source or do I also need to patch my generated stub
at all?
aaron
Re: [Axis2-0.94] - problem with generated stub
Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi Aaron,
This is a bug in the newly introduced options class. We actually found the
problem few days back and fixed it in the latest codebase. The problem is
that the stub wise options object (you'll see this when you open the
generated stub code) attaches itself to the operation clients options object
once a method has been called!
Here is the fix if you have the .94 code. (Unfortunatley I can't think of a
workaround that does not include manipulating code :()
Open the org.apache.axis2.client.Options class in the core module.
at line 223 change the soapAction = parent.getSOAPAction();
to return parent.getSOAPAction();
Now that method should look like this
public String getSoapAction() {
if (soapAction == null && parent != null) {
return parent.getSoapAction();
}
return (soapAction != null) ? soapAction : "";
}
Other getter methods also need to be modified in this way but essentially
this is the method that would make the difference.
Ajith
On 1/21/06, Aaron Evans <aa...@yahoo.ca> wrote:
>
> Hi,
> I generated a client stub based on some wsdl from a third party. The
> client stub
> uses ADB for data binding.
>
> I've noticed some strange behaviour and was wondering if anyone else has
> seen
> something similar or can explain it to me.
>
> Basically, there are two web service methods (wsdl:operation) that I am
> using,
> call them A and B.
>
> Now say I need to call A twice, then B twice.
>
> If I instantiate a new instance of the stub for each invocation, then
> everything
> works fine.
>
> However, if I only instantiate the client stub once and try to reuse it
> for
> all service method invocations, it works fine for the two calls to A, but
> as soon as I start calling B, things don't work as they should.
>
> B is supposed to return a complex type called 'BResponse' that simply
> contains
> a sequence (of max lenght 1) of a complex type, C.
>
> B comes back non-null, but C is coming back null.
>
> If I reverse the order of the method calls (so, B,B,A,A), then the first
> two
> calls to B then work fine, but as soon as I start calling A, the same
> thing
> happens.
>
> A is supposed to return an object, AResponse that contains an object D,
> but
> D ends up coming back as null.
>
> Any ideas?
>
> I have been out of the web service world for a little while now, so excuse
> me if this isn't very clear.
>
> Incidentally, I remember a few years back when I was using axis 1, there
> was
> a java tool that was very nice for debugging that you could use as a proxy
> in
> between the client and the ws endpoint and it would show you the soap
> headers
> and payloads that were going back and forth. Does anyone know what I'm
> talking
> about and where to get it?
>
> thx,
> aaron
>
>
--
Ajith Ranabahu
Re: [Axis2-0.94] - problem with generated stub
Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
org.apache.axis2.tool.tracer.HTTPTracer which is in tools module.
But we did not include axis2-tools-0.94.jar with the 0.94 release. But
we have an idea to ship a jar containing only the tcpmon with the next
release.
- -- Chinthaka
Aaron Evans wrote:
> trebor iksrazal <iksrazal <at> yahoo.com> writes:
>
>> tcpmon ? the soap applet AFAIK hasn't been ported to axis2 yet.
>>
>
> Yes, that is the one. Gee, it would be really nice if they did
> port it to axis2, I remember finding it very useful for debugging.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
iD8DBQFD06ygjON2uBzUhh8RAq/FAJ4h/B8i7n5XN3OBR0moSlJ7DaFxLACfTOtM
LwGV23mdCDq2Gc1k33XcajQ=
=zksD
-----END PGP SIGNATURE-----
Re: [Axis2-0.94] - problem with generated stub
Posted by trebor iksrazal <ik...@yahoo.com>.
I started the port a few weeks ago when I really
needed it. I got a bit stuck on the handler part. On
my todo list, unless someone beats me to it ;-) .
iksrazal
http://www.braziloutsource.com/
--- Davanum Srinivas <da...@gmail.com> wrote:
> Hmm, "they" includes you...the soap monitor applet
> was originally
> written by a user :)
>
> -- dims
>
> [1]
>
http://marc.theaimsgroup.com/?l=axis-dev&m=103127528227619&w=2
>
> On 1/21/06, Aaron Evans <aa...@yahoo.ca>
> wrote:
> > trebor iksrazal <iksrazal <at> yahoo.com> writes:
> >
> > >
> > > tcpmon ? the soap applet AFAIK hasn't been
> ported to
> > > axis2 yet.
> > >
> >
> > Yes, that is the one. Gee, it would be really
> nice if they did port it to
> > axis2, I remember finding it very useful for
> debugging.
> >
> >
>
>
> --
> Davanum Srinivas : http://wso2.com/blogs/
>
"None are more hopelessly enslaved than those who falsely believe they are free. -- Goethe"
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: [Axis2-0.94] - problem with generated stub
Posted by Davanum Srinivas <da...@gmail.com>.
Hmm, "they" includes you...the soap monitor applet was originally
written by a user :)
-- dims
[1] http://marc.theaimsgroup.com/?l=axis-dev&m=103127528227619&w=2
On 1/21/06, Aaron Evans <aa...@yahoo.ca> wrote:
> trebor iksrazal <iksrazal <at> yahoo.com> writes:
>
> >
> > tcpmon ? the soap applet AFAIK hasn't been ported to
> > axis2 yet.
> >
>
> Yes, that is the one. Gee, it would be really nice if they did port it to
> axis2, I remember finding it very useful for debugging.
>
>
--
Davanum Srinivas : http://wso2.com/blogs/
Re: [Axis2-0.94] - problem with generated stub
Posted by Aaron Evans <aa...@yahoo.ca>.
trebor iksrazal <iksrazal <at> yahoo.com> writes:
>
> tcpmon ? the soap applet AFAIK hasn't been ported to
> axis2 yet.
>
Yes, that is the one. Gee, it would be really nice if they did port it to
axis2, I remember finding it very useful for debugging.
Re: [Axis2-0.94] - problem with generated stub
Posted by trebor iksrazal <ik...@yahoo.com>.
<snip>
Sorry, can't help much with your main problem.
>
> Incidentally, I remember a few years back when I was
> using axis 1, there was
> a java tool that was very nice for debugging that
> you could use as a proxy in
> between the client and the ws endpoint and it would
> show you the soap headers
> and payloads that were going back and forth. Does
> anyone know what I'm talking
> about and where to get it?
>
> thx,
> aaron
>
>
tcpmon ? the soap applet AFAIK hasn't been ported to
axis2 yet.
HTH,
iksrazal
http://www.braziloutsource.com/
"None are more hopelessly enslaved than those who falsely believe they are free. -- Goethe"
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com