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 Miguel Correia Ricardo <mi...@gmail.com> on 2006/09/04 16:43:00 UTC

Lame Question DII

Hi you all,

I've a lame question, because I'm newbie when it matters to Axis.
I'm doing a dynamic invocation, and the only access that I have to the
java types that I need to register is with the Java Reflection
mechanisms (I do reflection to an Java Interface).

It works. But it works too well. First of all, I don't register faults
(my specific user expceptions), and I can catch them anyway.

But, what it really bugs me, is how can the service invocation work,
if I pass the type of the parameter incorrectly with the method
addParameter. For example, let's imagine that I have a complex array
that is an method parameter. What passes in the SOAP message is when I
do the service invocation is:
(...)
<credentials xsi:type="soapenc:Array"
soapenc:arrayType="ns2:LoginCredential[1]"
xmlns:ns1="http://authservice.api.[Lsys"
xmlns:ns2="http://authservice.api.sys"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
(...)

Has you can see, the xmlns:ns1, refers to what I pass with the method
addParameter. This is the result from the reflection of an array type,
and that is in the form [L<array name>, and there isn't another way of
passing the java type has <nome of the array type>[], that
would be the correct way (at least with Java Reflection).
The code is:
(...)
String name = params[i].getName();
Class type = paramTypes[i]; (it passes [Lsys.api.authservice;]
QName qType = getXMLType(type); (converted to
xml:ns1="http://authservice.api.[Lsys")
currentCall.addParameter(name, qType, ParameterMode.IN);
(...)

But, I register LoginCredential also, because in this example, it's
not used has an array in another parameter. But the clever thing, is
that SOAP uses the xml:ns2, that is correct, and not the one that i've
passed with the addParameter (that is the xml:ns1). But, how does this
works? Will it work always? Or I'm just lucky? Oh, and I don't use
ArrayBeanSerializer, for the array complex types, I delegate that to
the soapen:arrayType, I only register the complex types that the array
carries.

Hope any one can help. Because it need to understand how it works, and
will it always work this way...

Best regards,
Miguel

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org