AnsweredAssumed Answered

Calling Web Service with Ruby

Question asked by pjmorce on Jun 3, 2009
Latest reply on Jun 3, 2009 by pjmorce

I am new to Alfresco and I am trying it to implement a Web Application using Ruby and Ruby on Rails.

I tried to follow the samples trying to call a web service from my ruby application but I could'nt make it work.

My server is running well. I already inserted some documents. The WSDL of the web service is also accessible. I also installed WSS4 which is needed.

The user/password of my alfresco server is admin/admin.

I tried to call the getStores web service operation and I also tried to query to web service.

Here goes the code of my method wich executes getStores operation:

def getStores
    puts "begin"
    user = "admin"
    pwd = "admin"   
    wsdl_url = "http://localhost:8080/alfresco/wsdl/repository-service.wsdl"
    wsdl_url_auth = "http://localhost:8080/alfresco/wsdl/authentication-service.wsdl"
    puts "a"
    soapDriver =
    puts "b"
    authentication_result = soapDriver.startSession(:username => 'admin', :password => 'admin')
    puts "c"
    ticket = authentication_result.inspect
    puts "1"
    factory =
    puts "2"
    soap = factory.create_rpc_driver
    puts "3"
    soap.streamhandler.client.receive_timeout = 180
    puts "h"
    resolver =
    soapResponse = soap.getStores(param)
    puts "5"
    puts "end"

The execution of this method returns the following error message: undefined method `process' for #<String:0x49fdfa4>

Here goes the code which executes the query:

def query
    puts "begin…"
      puts "1"
      wsdl_url = "http://localhost:8080/alfresco/wsdl/repository-service.wsdl"
      puts "2"
      soapDriver =
      puts "3"
      resolver =
      puts "4"
      puts "5"
      puts "6""admin", "admin"))
      puts "7"
      query_result = soapDriver.query(
        {:store => {:scheme => 'company_home', :address => 'SpacesStore'},
        :query => {:language => 'lucene', :statement => 'TEXT:"<brown>"'},
        :includeMetaData => false})
      puts "12"
      puts query_result.to_s
      puts "13"
    rescue Exception => e
      puts "Error (index): " + e.message
    puts "end…"
The executions of this method return the follow error message: Server Error

What am I doing wrong? What am I missing? (my Alfresco server is the version 3.0 - the last one).