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? Thanks!!!
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 adding 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 for debugging purposes.
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
# 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…empty
</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>