• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem returning a String array from a web service

 
Sac Anand
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?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • 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.
 
Marty Speck
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic