• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem using array in WebSphere web service

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a service that accepts a request object that inturn contains an array of Strings. I generated the wsdl using java2wsdl provided in the base_51 runtime of RAD 6.0. From the WSDL i then generated client and server stubs, serialization classes using wsdl2java again from the same runtime bin. I did not tinker around with options, just used the defaults...

I invoke the web service with request containing array of 6 strings, but when the control reaches my service implementation, there is only one string in the array. Has anybody faced a similar scenario? What could be going wrong here?

So from client


When the control reaches the service implementation i see that the length of codes string array is 1 instead of 3 at runtime.

What could i be doing wrong?
 
Sabarish Sasidharan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found the answer here, hope it works

http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=13753412&cat=7&thread=64877&treeDisplayType=threadmode1&forum=199#13753412
 
Sabarish Sasidharan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it worked !

So basically for each array instance attribute we have to add a getter accepting a int and a setter accepting int cum array type. The following code should make things clear.

 
reply
    Bookmark Topic Watch Topic
  • New Topic