PHWinfo banniere

ACCUEIL ANNUAIRE ARTICLES COMPARATIF HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Go Back   PHWinfo > Forum Programmation > Scripting > comp.lang.ruby > Consuming a SOAP Service in Ruby.
FAQ Members List Search Today's Posts Mark Forums Read
Consuming a SOAP Service in Ruby.

Reply
 
Thread Tools
Old 07/06/10, 12:39   #1
Saeed Bhuta
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Consuming a SOAP Service in Ruby.

Hi,

I am trying to consume a SOAP service. I don't know a lot about this
area but from what I have read, I have come up with the following code
so far;

require 'soap/wsdlDriver'

wsdl="http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx"

driverFactory = SOAP::WSDLDriverFactory.new(wsdl)

p '>>>>>>>>here'
service = driverFactory.create_rpc_driver

board=service.GetDepartureBoard(4, 'ALN', '', '')

However I am getting the following error;
"ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
WSDL::XMLSchema::SimpleRestriction
ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
WSDL::XMLSchema::SimpleRestriction
ignored attr: {}default
/usr/lib/ruby/1.8/wsdl/import.rb:44:in `parse_attr': undefined method
`targetnamespace=' for #<WSDL::XMLSchema::Schema:0x..fdb72b8a6>
(NoMethodError)"

I'm assuming the error is related to the namespace?

Would sincerely appreciate it if someone could point me in the right
direction.

Saeed
--
Posted via http://www.ruby-forum.com/.

  Reply With Quote
Old 07/06/10, 18:59   #2
Tony Arcieri
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: Consuming a SOAP Service in Ruby.

[Note: parts of this message were removed to make it a legal post.]

I've had lots and lots of problems with soap4r in the past and would most
certainly not recommend it. Try Savon instead:

http://github.com/rubiii/savon

On Tue, Jul 6, 2010 at 5:39 AM, Saeed Bhuta <saeed.bhuta@placr.co.uk> wrote:

> Hi,
>
> I am trying to consume a SOAP service. I don't know a lot about this
> area but from what I have read, I have come up with the following code
> so far;
>
> require 'soap/wsdlDriver'
>
> wsdl="http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx"
>
> driverFactory = SOAP::WSDLDriverFactory.new(wsdl)
>
> p '>>>>>>>>here'
> service = driverFactory.create_rpc_driver
>
> board=service.GetDepartureBoard(4, 'ALN', '', '')
>
> However I am getting the following error;
> "ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
> WSDL::XMLSchema::SimpleRestriction
> ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
> WSDL::XMLSchema::SimpleRestriction
> ignored attr: {}default
> /usr/lib/ruby/1.8/wsdl/import.rb:44:in `parse_attr': undefined method
> `targetnamespace=' for #<WSDL::XMLSchema::Schema:0x..fdb72b8a6>
> (NoMethodError)"
>
> I'm assuming the error is related to the namespace?
>
> Would sincerely appreciate it if someone could point me in the right
> direction.
>
> Saeed
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
Tony Arcieri
Medioh! A Kudelski Brand

  Reply With Quote
Old 07/07/10, 15:41   #3
Tim Becker
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: Consuming a SOAP Service in Ruby.

The wsdl you presented is fairly short, I've found the easiest way to
implement small SOAP enpoints in ruby is to do this:

* Use Java or .NET Tools to create bindings out of the WSDL
* Make one or two sample calls.
* sniff the xml generated by those calls and use it to create
templates for ruby.

Unfortunately, SOAP is one of the most convoluted protocols the earth
has ever seen. The above may sound a bit TOO pragmatic, but you'll
save yourself a world of hurt.

-tim




On Tue, Jul 6, 2010 at 1:39 PM, Saeed Bhuta <saeed.bhuta@placr.co.uk> wrote:
> Hi,
>
> I am trying to consume a SOAP service. I don't know a lot about this
> area but from what I have read, I have come up with the following code
> so far;
>
> require 'soap/wsdlDriver'
>
> wsdl="http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx"
>
> driverFactory = SOAP::WSDLDriverFactory.new(wsdl)
>
> p '>>>>>>>>here'
> service = driverFactory.create_rpc_driver
>
> board=service.GetDepartureBoard(4, 'ALN', '', '')
>
> However I am getting the following error;
> "ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
> WSDL::XMLSchema::SimpleRestriction
> ignored element: {http://www.w3.org/2001/XMLSchema}maxLength of
> WSDL::XMLSchema::SimpleRestriction
> ignored attr: {}default
> /usr/lib/ruby/1.8/wsdl/import.rb:44:in `parse_attr': undefined method
> `targetnamespace=' for #<WSDL::XMLSchema::Schema:0x..fdb72b8a6>
> (NoMethodError)"
>
> I'm assuming the error is related to the namespace?
>
> Would sincerely appreciate it if someone could point me in the right
> direction.
>
> Saeed
> --
> Posted via http://www.ruby-forum.com/.
>
>


  Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 09:20.


Powered by vBulletin® ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
PHWinfo is a website Education Without Frontiers
Ad Management by RedTyger
All rights reserved
Page generated in 0.29529 seconds with 7 queries