SOAP API: array of object

Hi,
I have developed a web service using SOAP4R. in contoller I have

def fetchfilename(comp)
@files = Wsm.find_by_sql([“select filename from wsms where comp=?”,
comp])
end

Now in API I have defined:(note the return type here)
api_method :fetchfilename, :expects => [:string], :returns => [Wsm]

My problem is I’m not able to get this to work. In SOAP Client when I do
something like this:

results = ws.fetchfilename(“SYSCFG”)
results.each do |rec|
puts rec.filename
end

It gives me “Don’t know how to cast Array to Wsmapping (RuntimeError)”

Any input on what I’m missing?

Thanks a bunch!

On 9/19/06, Ruby R. [email protected] wrote:

Now in API I have defined:(note the return type here)
It gives me “Don’t know how to cast Array to Wsmapping (RuntimeError)”

Any input on what I’m missing?

Try something like that

api_method :fetchfilename, :expects => [:string], :returns => [[Wsm]]


Kent

http://www.datanoise.com

Thanks! That worked!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs