on 06-05-2004 9:17 AM
Hi .. I have added a method in my EJB and wish to expose by WebService to be imported into model in WebDynpro Project . Here is my code ...
public Object[] Test1() {
// TODO : Implement
List AA = new ArrayList() ;
AA.add( new String[]{"123" , "456"} ) ;
AA.add( new String[]{"abc" , "def"} ) ;
return ( AA.toArray( new Object[AA.size()]) ) ;
}
After deploy to WAS , I test it in the WebService Test Page , and the resule just as listed below ..
Test1
 |-- response (test.types.p1.Test1Response)
  |-- Response (Object[])
   |-- (Object) [v]NULL
   |-- (Object) [v]NULL
But this is not what i expected . The actual result i expect would like this ...
Test1
 |-- response (test.types.p1.Test1Response)
  |-- Response (Object[])
   |-- element1 ( String[] )
   |-- element2 ( String[] )
Can any one help to verify where the problem is or give me any suggestion ?? Thanks for your help ...
Hi Bogi,
Your WS returns null due to the String array type has not been described in the Virtual Interface. Thus the WS Framework is not able to serialize the returned String array object.
As a solution you may create a new complex type that implements Serializable and contains the String array as a field. You will also have to add this new complex method manually in the Virtual Interface. Types are added automatially, when they are part of the signature of a method
Another way is to define another method that returns a String array.
Best regards,
Alexander
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.