This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of The Career Toolkit and have Mark Herschberg on-line!
See this thread for details.
Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Problem returning a String array from a web service

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to send an array of string from my web service.

When i try to compile client, following error comes:
incompatible types
[javac] found : java.util.List<java.lang.String>
[javac] required: java.lang.String[]


I am using Sun Application Server to deploy my web service application.

Can anybody help me in this regard?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like there is a type mismatch somewhere. Apparently, somewhere a List<String> is used, instead of a String[]. Make sure arrays are used where you consume the WS.
 
Sac Anand
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server Code


Client Code


Now, when i generate client side artifacts, it uses java.util.List<java.lang.String> but i don't know why?

WSDL looks like (automatically generated)


XSD is also generated at server side .. it looks like


Any help is highly appreciated.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[javac] found : java.util.List<java.lang.String>
[javac] required: java.lang.String[]



Looks like you're returning a List of Strings from a method instead of an Array of Strings.
 
Seriously? That's what you're going with? I prefer this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic