File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Support string array in wsdl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Support string array in wsdl " Watch "Support string array in wsdl " New topic

Support string array in wsdl

beng shi

Joined: Dec 03, 2010
Posts: 1
Hi All,
I am using soapUI to read and test my wsdl that I created by java code.

In the wsdl for supporting string of array I have

I can load it in the soapUI without any error but when I ask soupUI to create soap request sample message it gives

Whereas , it should create something like (this is created by Axis)

My definition and the Axis one are :

I am thinking something is wrong but I could not find that.
I will be thankful if you share any idea about what is the reason or how to solve that.

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
First of all, you should really read up on the WS-I Basic Profile for web service interoperability.
Using SOAP encoding is not recommended etc.
Have you considered using the maxOccurs attribute with a value greater than 1 in the XML schema specifying the string array?
I feel this could simplify your XML schema.
Best wishes!

My free books and tutorials:
Sudhir Jha

Joined: Apr 08, 2011
Posts: 1
Hello EveryBody,

I am trying to retrieve an image from Db using web services.
See My Web Method:
public String[] getSignature(int A, String B, long C){

<Some Code which return an Array of String>

Web Interface:
public String[] getSignature(int A, String B, long C);

in wsdl file : i can see value comes as:

<xs:complexType name="getSignature">
<xs:sequence> <xs:element name="arg0" type="xs:int"/>
<xs:element name="arg1" type="xs:string" minOccurs="0"/>
<xs:element name="arg2" type="xs:long"/>
</xs:sequence> </xs:complexType>
<xs:complexType name="getSignatureResponse">
<xs:sequence> <xs:element name="return" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>

while sending client request,i had sent in this way....
String sk[] = port1.getSignature(125, "xyz", 562);
But its shows that : cannot convert from List<String> to String[]

Indeed in the stub generated by webInterface has code like
List<String> getSignature

what should be done?
Please suggest me some way to do that.

I agree. Here's the link:
subject: Support string array in wsdl
It's not a secret anymore!