Matthew,

Arrays of primitive types have "special" classnames:

array of int has the classname [I
array of float has the classname [F
array of long has the classname [J
array of double has the classname [D
array of boolean has the classname [Z
array of byte has the classname [B
array of short has the classname [S

The classname for arrays of objects take the form:

  [L<fullyqualifiedclass>;

for example:

  [Ljava.lang.String;    or  [Ljava.io.File;

Multidimentional arrays are specified with extra [ characters on the front
of the classname. For example the classname for an int[][] would be [[I

Regards,
Owen



|---------+---------------------------->
|         |           "Matthew Bateman"|
|         |           <[EMAIL PROTECTED]|
|         |           ic.com>          |
|         |                            |
|         |           21/03/2003 19:09 |
|         |           Please respond to|
|         |           wsif-user        |
|         |                            |
|---------+---------------------------->
  
>---------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                                         |
  |       To:       <[EMAIL PROTECTED]>                                                
                                                   |
  |       cc:                                                                          
                                                         |
  |       Subject:  primitive arrays with the java provider                            
                                                         |
  |                                                                                    
                                                         |
  |                                                                                    
                                                         |
  
>---------------------------------------------------------------------------------------------------------------------------------------------|



I'm trying to use the WSIF java provider to call a java class that takes an
array of ints (int[]).  However, I can't figure out how to specify that its
an array of ints.  The docs on the provider page say it has to be a
primitive or a fully qualified java class.  So how is an array specified?
I have the xsd:schema element defining the array (it was generated by
Axis).  I tried using elementName and typeName in the binding, neither
worked.

I tried using "int" as the formatType.  This is the error I get:

org.apache.wsif.WSIFException:
[EMAIL PROTECTED] : Could not invoke
'addArray'; nested exception is:
            org.apache.wsif.WSIFException: No method named 'addArray' found
that match the parts specified

It seems obvious because I assume WSIF is looking for addArray(int args),
when its addArray(int[] args).

I tried using "int[]" as the formatType.  This is the error I get:

The meta information is not consistent.; nested exception is:
            org.apache.wsif.WSIFException: Could not instantiate class 'int
[]'; nested exception is:
            java.lang.ClassNotFoundException: int[]
org.apache.wsif.WSIFException: Could not instantiate class 'int[]'; nested
exception is:
            java.lang.ClassNotFoundException: int[]
java.lang.ClassNotFoundException: int[]
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:190)
            at
org.apache.wsif.providers.java.WSIFOperation_Java.getClassForName(Unknown
Source)
            at
org.apache.wsif.providers.java.WSIFOperation_Java.getMethodArgumentClasses(Unknown

Source)
            at
org.apache.wsif.providers.java.WSIFOperation_Java.getConstructors(Unknown
Source)
            at org.apache.wsif.providers.java.WSIFOperation_Java.
&lt;init&gt;(Unknown Source)
            at
org.apache.wsif.providers.java.WSIFPort_Java.getDynamicWSIFOperation(Unknown

Source)
            at
org.apache.wsif.providers.java.WSIFPort_Java.createOperation(Unknown
Source)
Which again seems obvious.

So how do I specifiy an array of ints?  (Or any array for that matter, I
assume I would have the same problem with an array of String or something.)

Thanks in advance.



Reply via email to