Forum: Ruby How to use WSDLDriverFactory with basic authentication?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
50b4f6b7db4a70d50167acc29499832a?d=identicon&s=25 ddavidson (Guest)
on 2006-01-10 14:04
(Received via mailing list)
I am trying to use SOAP::WSDLDriverFactory but the server requires
basic authentication.

I've tried using something like:

WSDL_URI = 'http://user:password@server:80/TestService?wsdl';
factory = SOAP::WSDLDriverFactory.new(WSDL_URI)

But I keep getting parse errors:

/usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:112:in `decode_tag': Unknown
element {}html. (WSDL::XMLSchema::Parser::UnknownElementError)

Which I am rather sure is due to the need for basic authentication,
since other SOAP services that don't require authentication work just
fine.  I can also get the raw WSDL just fine using something like:

require 'net/http'
Net::HTTP.start('server') { |http|
        req = Net::HTTP::Get.new("/TestService?wsdl")
        req.basic_auth( 'user', 'password' )
        response = http.request(req)
        puts response.body
}

Any tips on how to use basic authentication with WSDLDriverFactory, or
how else can I work around this?

Thanks in advance!
C4ec160c6223ee24609cbd07fd922be5?d=identicon&s=25 NAKAMURA, Hiroshi (Guest)
on 2006-02-05 15:40
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Sorry for late reply.

ddavidson wrote:
> /usr/lib/ruby/1.8/wsdl/xmlSchema/parser.rb:112:in `decode_tag': Unknown
> element {}html. (WSDL::XMLSchema::Parser::UnknownElementError)

No easy way for now.  It should be allowed to configure basic_auth
user/passwd with property file.  Soap4r client reads "soap/property"
file in ruby's search path but you cannot set basic_auth parameters now.
 I filed a ticket at http://dev.ctor.org/soap4r/ticket/198 .

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFD5g3Pf6b33ts2dPkRAlBsAJ9BZWSVY97cYyTKlDVQJRcAyabTrwCgqtLo
fDYa3UkC3BDtmGnGLfGmmrc=
=JAq4
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.