Istanziare un client SOAP usando WSDLDriverFactory

Ciao a tutti, ho realizzato questo server soap per provare un pò la
libreria soap4r

codice:
require ‘soap/rpc/standaloneServer’

class MyServer < SOAP::RPC::StandaloneServer

def initialize(*args)
super(*args)
add_method(self, “sayhelloto”, “username”)
end

def sayhelloto(username)
“Hello, #{username}.”
end
end

server = MyServer.new(“MyRubyServer”, “urn:mySoapServer”, “localhost”,
12321)
trap(‘INT’) {server.shutdown}
server.start

ho provato ad implementare un client in questo modo:

codice:
require “soap/wsdlDriver”
url = “http://localhost:12321/

client = SOAP::WSDLDriverFactory.new(url).createDriver

lancio il server e poi il client ma mi viene restituito quest’errore:

codice:
/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:116:in decode_tag': unknown element: {}HTML (WSDL::XMLSchema::Parser::UnknownElementError) from /usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:82:instart_element’
from /usr/lib/ruby/1.8/xsd/xmlparser/parser.rb:67:in start_element' from /usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:34:intag_start’
from /usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in parse' from /usr/lib/ruby/1.8/rexml/document.rb:201:inparse_stream’
from /usr/lib/ruby/1.8/xsd/xmlparser/rexmlparser.rb:27:in do_parse' from /usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:63:inparse’
from /usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:42:in parse' from /usr/lib/ruby/1.8/wsdl/importer.rb:31:inparse’
from /usr/lib/ruby/1.8/wsdl/xmlSchema/importer.rb:30:in import' from /usr/lib/ruby/1.8/wsdl/importer.rb:18:inimport’
from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:124:in import' from /usr/lib/ruby/1.8/soap/wsdlDriver.rb:28:ininitialize’
from soapClient.rb:14:in `new’
from soapClient.rb:14

ho forse sbagliato l’url per recuperare il file WSDL ?

I manuali da cui ho preso spunto sono principalmente Programming Ruby e
CookBook, ma qui non si capisce bene (o meglio, io non l’ho capito)
come deve essere formato l’ url per recuperare il file WSDL.
Ho provato anche le seguenti combinazioni:

codice:
url = “http://localhost:12321/mySoapServer.wsdl
url = “http://localhost:12321/mySoapServer
url = “http://localhost:12321/urn:mySoapServer.wsdl
url = “http://localhost:12321/urn:mySoapServer
url = “http://localhost:12321/MyRubyServer.wsdl
url = “http://localhost:12321/MyRubyServer

ma dava sempre lo stesso errore.

In effetti non so di preciso come deve essere composto.

Qualcuno può aiutarmi porfavor?

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