# Issue with string arrays using soap Web Service

**URL:** <https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309>\
**Category:** Rails\
**Created:** [November 9, 2006, 12:32am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309 "2006-11-09T00:32:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [November 9, 2006, 12:32am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/1 "2006-11-09T00:32:26Z")

</div>

Repost because I can’t find the original…

I’m using a soap based web service (Backend in Java XFire web service).  
I can connect fine and even execute the web service. The issue is  
that I have 3 fields that are string arrays. I am passing in data  
correctly I believe. But the outgoing soap message is not showing the  
array data. Has anybody run into something like this?

I’ll paste the basics of the code below:

```
  url = "<VALID URL HERE>"
  urn = "urn:<VALID SERVICE HERE>"
  soap = SOAP::RPC::Driver.new(url, urn)

      # I've tried addign it specifically and letting the following

```

create it:  
# soap =  
SOAP::WSDLDriverFactory.new(wsdl\_url).create\_rpc\_driver  
# Neither worked.  
soap.add\_method(‘serviceName’, ‘in0’, ‘in1’, ‘in2’, ‘in3’, ‘in4’,  
‘in5’, ‘in6’, ‘in7’)

```
      # This will dump out the messages being sent and received.
  soap.wiredump_file_base = "soapresult"

     #This creates an array of Strings from the NODE parameters of

```

my categories.  
categories = getSelectedCategories(@params[“NODE”])

```
     # Prints array entries so I know there is actual data there.
  i = 0
  categories.each do |d|
    db("Category = [#{categories[i]}]")
    i += 1
  end

     # Setting up the valid fields for the query.
  categoryOptions = []
  appId = "servicetest"
  domains = nil
  locale = "<VALID LOCALE>"
  markuptype = "<VALID TYPE - String >"
  markupoptions = nil #This is also an array of strings...but

```

isn’t needed yet.

```
      # One of many permutations of the calls I've tried. I can

```

get a response from the  
# service. But I can’t get the String Array part of the SOAP  
document filled  
# out correctly.  
@results = soap.serviceName([:in0 =\> doc], [:in1 =\> categories],  
[:in2 =\> categoryOptions], [:in3 =\> appId], [:in4 =\> domains], [:in5 =\>  
locale], [:in6 =\> markuptype], [:in7 =\> markupoptions])

* * *

Sent values in the SOAP body:

env:Body  
\<n1:serviceName xmlns:n1=“http://”\>  
n1:in0madonna\</n1:in0\>  
n1:in1  
n1:string\</n1:string\> # The in1 field is the array…and  
dosn’t get the 3 strings in it!!!  
\</n1:in1\>  
n1:in2  
n1:string\</n1:string\>  
\</n1:in2\>  
n1:in3servicetest\</n1:in3\>  
n1:in4  
n1:string\</n1:string\>  
\</n1:in4\>  
n1:in5en\_us\</n1:in5\>  
n1:in6InlineHrefMarkup\</n1:in6\>  
n1:in7  
n1:string\</n1:string\>  
\</n1:in7\>  
\</n1:getMarkupDoc\>  
\</env:Body\>

* * *

Sanitized WSDL below:

 \<?xml version="1.0" encoding="UTF-8" ?\>
- \<wsdl:definitions xmlns:wsdl=“[http://schemas.xmlsoap.org/wsdl/](http://schemas.xmlsoap.org/wsdl/)”  
xmlns:soap11=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”  
xmlns:soap12=“[http://www.w3.org/2003/05/soap-envelope](http://www.w3.org/2003/05/soap-envelope)”  
xmlns:soapenc11=“[http://schemas.xmlsoap.org/soap/encoding/](http://schemas.xmlsoap.org/soap/encoding/)”  
xmlns:soapenc12=“[http://www.w3.org/2003/05/soap-encoding](http://www.w3.org/2003/05/soap-encoding)”  
xmlns:tns=“[http://servername.iwebsys.aol.com:3000/servicename/services/servicename](http://servername.iwebsys.aol.com:3000/servicename/services/servicename)”  
xmlns:wsdlsoap=“[http://schemas.xmlsoap.org/wsdl/soap/](http://schemas.xmlsoap.org/wsdl/soap/)”  
xmlns:xsd=“[XML Schema](http://www.w3.org/2001/XMLSchema)”  
targetNamespace=“[http://servername.iwebsys.aol.com:3000/servicename/services/servicename](http://servername.iwebsys.aol.com:3000/servicename/services/servicename)”\>
- wsdl:types
- \<xsd:schema  
targetNamespace=“[http://servername.iwebsys.aol.com:3000/servicename/services/servicename](http://servername.iwebsys.aol.com:3000/servicename/services/servicename)”  
elementFormDefault=“qualified” attributeFormDefault=“qualified”\>
- \<xsd:complexType name=“ArrayOfString”\>
- xsd:sequence  
\<xsd:element name=“string” type=“xsd:string” nillable=“true”  
minOccurs=“0” maxOccurs=“unbounded” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>
- \<xsd:element name=“getKeywordList”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“in0” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in1” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in2” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in3” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in4” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in5” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getKeywordListResponse”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“out” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getKeywordList1”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“in0” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in1” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in2” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in3” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in4” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in5” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getKeywordList1Response”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“out” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getMarkupDoc1”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“in0” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in1” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in2” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in3” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in4” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in5” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in6” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in7” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getMarkupDoc1Response”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“out” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getMarkupDoc”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“in0” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in1” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in2” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in3” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in4” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in5” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in6” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\<xsd:element name=“in7” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getMarkupDocResponse”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“out” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getCategories”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“in0” type=“xsd:string” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>
- \<xsd:element name=“getCategoriesResponse”\>
- xsd:complexType
- xsd:sequence  
\<xsd:element name=“out” type=“tns:ArrayOfString” nillable=“true”  
minOccurs=“1” maxOccurs=“1” /\>  
\</xsd:sequence\>  
\</xsd:complexType\>  
\</xsd:element\>  
\</xsd:schema\>  
\</wsdl:types\>
- \<wsdl:message name=“getKeywordListRequest”\>  
\<wsdl:part element=“tns:getKeywordList” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getMarkupDocRequest”\>  
\<wsdl:part element=“tns:getMarkupDoc” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getMarkupDoc1Request”\>  
\<wsdl:part element=“tns:getMarkupDoc1” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getMarkupDocResponse”\>  
\<wsdl:part element=“tns:getMarkupDocResponse” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getMarkupDoc1Response”\>  
\<wsdl:part element=“tns:getMarkupDoc1Response” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getKeywordListResponse”\>  
\<wsdl:part element=“tns:getKeywordListResponse” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getCategoriesRequest”\>  
\<wsdl:part element=“tns:getCategories” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getCategoriesResponse”\>  
\<wsdl:part element=“tns:getCategoriesResponse” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getKeywordList1Request”\>  
\<wsdl:part element=“tns:getKeywordList1” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:message name=“getKeywordList1Response”\>  
\<wsdl:part element=“tns:getKeywordList1Response” name=“parameters” /\>  
\</wsdl:message\>
- \<wsdl:portType name=“servicenameServicePortType”\>
- \<wsdl:operation name=“getKeywordList”\>  
\<wsdl:input message=“tns:getKeywordListRequest”  
name=“getKeywordListRequest” /\>  
\<wsdl:output message=“tns:getKeywordListResponse”  
name=“getKeywordListResponse” /\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getKeywordList1”\>  
\<wsdl:input message=“tns:getKeywordList1Request”  
name=“getKeywordList1Request” /\>  
\<wsdl:output message=“tns:getKeywordList1Response”  
name=“getKeywordList1Response” /\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getMarkupDoc1”\>  
\<wsdl:input message=“tns:getMarkupDoc1Request”  
name=“getMarkupDoc1Request” /\>  
\<wsdl:output message=“tns:getMarkupDoc1Response”  
name=“getMarkupDoc1Response” /\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getMarkupDoc”\>  
\<wsdl:input message=“tns:getMarkupDocRequest”  
name=“getMarkupDocRequest” /\>  
\<wsdl:output message=“tns:getMarkupDocResponse”  
name=“getMarkupDocResponse” /\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getCategories”\>  
\<wsdl:input message=“tns:getCategoriesRequest”  
name=“getCategoriesRequest” /\>  
\<wsdl:output message=“tns:getCategoriesResponse”  
name=“getCategoriesResponse” /\>  
\</wsdl:operation\>  
\</wsdl:portType\>
- \<wsdl:binding name=“servicenameServiceHttpBinding”  
type=“tns:servicenameServicePortType”\>  
\<wsdlsoap:binding style=“document”  
transport=“[http://schemas.xmlsoap.org/soap/http](http://schemas.xmlsoap.org/soap/http)” /\>
- \<wsdl:operation name=“getKeywordList”\>  
\<wsdlsoap:operation soapAction=“” /\>
- \<wsdl:input name=“getKeywordListRequest”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:input\>
- \<wsdl:output name=“getKeywordListResponse”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:output\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getKeywordList1”\>  
\<wsdlsoap:operation soapAction=“” /\>
- \<wsdl:input name=“getKeywordList1Request”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:input\>
- \<wsdl:output name=“getKeywordList1Response”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:output\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getMarkupDoc1”\>  
\<wsdlsoap:operation soapAction=“” /\>
- \<wsdl:input name=“getMarkupDoc1Request”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:input\>
- \<wsdl:output name=“getMarkupDoc1Response”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:output\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getMarkupDoc”\>  
\<wsdlsoap:operation soapAction=“” /\>
- \<wsdl:input name=“getMarkupDocRequest”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:input\>
- \<wsdl:output name=“getMarkupDocResponse”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:output\>  
\</wsdl:operation\>
- \<wsdl:operation name=“getCategories”\>  
\<wsdlsoap:operation soapAction=“” /\>
- \<wsdl:input name=“getCategoriesRequest”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:input\>
- \<wsdl:output name=“getCategoriesResponse”\>  
\<wsdlsoap:body use=“literal” /\>  
\</wsdl:output\>  
\</wsdl:operation\>  
\</wsdl:binding\>
- \<wsdl:service name=“servicenameService”\>
- \<wsdl:port binding=“tns:servicenameServiceHttpBinding”  
name=“servicenameServiceHttpPort”\>  
\<wsdlsoap:address  
location=“[http://servername.iwebsys.aol.com:3000/servicename/services/servicenameService](http://servername.iwebsys.aol.com:3000/servicename/services/servicenameService)”  
/\>  
\</wsdl:port\>  
\</wsdl:service\>  
\</wsdl:definitions\>

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [November 9, 2006, 12:33am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/2 "2006-11-09T00:33:34Z")

</div>

Oh yeah…don’t blame me for the WSDL. It’s a java XFire generated  
one.

Thanks for any help!

MudDawg

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [November 10, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/3 "2006-11-10T15:21:14Z")

</div>

Anybody?

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [November 14, 2006, 2:45am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/4 "2006-11-14T02:45:57Z")

</div>

Bueller???

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [November 12, 2006, 3:11am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/5 "2006-11-12T03:11:52Z")

</div>

TTT

---

<div class="post-metadata">

**Author:** ![hatless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/848f3c/32.png) [@hatless](https://www.ruby-forum.com/u/hatless)\
**Post date:** [December 5, 2008, 9:01am UTC](https://www.ruby-forum.com/t/issue-with-string-arrays-using-soap-web-service/75309/6 "2008-12-05T09:01:39Z")

</div>

Hi there.

Did you ever find a solution to this problem because I think I am  
experiencing something similar: Using Ruby as SOAP Client, I have to  
send an array as an input parameter and I’ve tried every variation of  
sending the data into the SOAP method possible but I still can’t get  
the data into the SOAP message and as such I can’t get the data I need  
back from the web service on the other side (written by a 3rd party  
in .net).

Any assistance would be hugely appreciated!

Thanks,  
Phillipa.

On Nov 14 2006, 3:45 am, Steve K. \<rails-mailing-l…@andreas-
