XML-RPC Webservice API

Hi,

After following the excellent tutorials in the Agile Web D.
with Rails book, I was able to get my webservice working pretty much
perfectly :slight_smile:

I can access it via SOAP and XML-RPC and look at service.wsdl to find
the API. What I can’t do however is get the API for the XML-RPC call. It
fails with :

Internal protocol error: NilClass is not a valid input stream. It must
be
either a String, IO, StringIO or Source.
Backtrace:
/usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:133:in stream=' /usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:100:ininitialize’
/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:6:in initialize' /usr/lib/ruby/1.8/rexml/document.rb:173:inparse_stream’
/usr/lib/ruby/1.8/xmlrpc/parser.rb:717:in parse' /usr/lib/ruby/1.8/xmlrpc/parser.rb:475:inparseMethodCall’
/usr/lib/ruby/1.8/xmlrpc/marshal.rb:63:in load_call' /usr/lib/ruby/1.8/xmlrpc/marshal.rb:32:inload_call’
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/protocol/xmlrpc_protocol.rb:36:in
decode_request' /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/protocol/xmlrpc_protocol.rb:32:indecode_action_pack_request’
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/protocol/discovery.rb:20:in
discover_web_service_request' /usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/protocol/discovery.rb:18:indiscover_web_service_request’
/usr/lib/ruby/gems/1.8/gems/actionwebservice-1.1.2/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:44:in
dispatch_web_service_request' (eval):1:inapi’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in
perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:inperform_action_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:inperform_action’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:inprocess_without_session_management_support’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in
process' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:indispatch’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/rails.rb:66:in
process' /usr/lib/ruby/1.8/thread.rb:135:insynchronize’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/rails.rb:64:in
process' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:425:inprocess_client’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:424:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:495:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:494:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:483:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:774:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:772:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/bin/mongrel_rails:97:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel/command.rb:163:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/bin/mongrel_rails:194
/usr/bin/mongrel_rails:18

I’ve tested it with Webrick as well and I get the same error. I’ve tried
googling for it but I haven’t come across anything too useful. I’m
wondering if there is a well known reason for this to happen when
everything else seems to be fine…

Anyway, as always, any help you can give me will be gratefully
appreciated :slight_smile:

Cheers,

Pete

Can you post a small example which reproduces this problem?

It seems like the XMLRPC client that you use doesn’t send any xml to the
server.

On 4/17/06, Pete [email protected] wrote:

/usr/lib/ruby/1.8/xmlrpc/marshal.rb:63:in load_call' dispatch_web_service_request’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in
process' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.12.4/lib/mongrel.rb:774:in run’
I’ve tested it with Webrick as well and I get the same error. I’ve tried

Pete

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


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

–
Kent

Pete,

I can access it via SOAP and XML-RPC and look at service.wsdl to find
the API. What I can’t do however is get the API for the XML-RPC call. It
fails with :

Internal protocol error: NilClass is not a valid input stream. It must
be
either a String, IO, StringIO or Source.
Backtrace:
[snip]

I see the same error message. My guess is that this is the same as the
“Typo bug” that has bit so many. It bit me when I was trying to
generate XML-RPC documentation for a customer. (It’s not a bug in
Typo, it’s a bug in Rails. See
http://www.mail-archive.com/[email protected]/msg01648.html)

Jim

Jim M., [email protected], [email protected]
http://www.io.com/~jimm

I am having the same problems… The error messages are pretty much the
same… I would really like to get this working with AWS and not have to
have a standalone SOAP server communicating through something like a
socket. It’s just not the Rails Way ™

William

Pete wrote:

I don’t suppose there is a known solution to it? :slight_smile:

I could only find info on Typo when I was googling…

Cheers,

Pete

I don’t suppose there is a known solution to it? :slight_smile:

I could only find info on Typo when I was googling…

Cheers,

Pete

Hello,

I have the same problem here : I am trying to implement a Web Service
via AWS from a wsdl (for legacy reasons).
Did you find out something ?

David

On 24 oct 2006, 16:24, William [email protected]

Alright, so I can get a SOAP client to talk to ActiveWebService, which
is great, however, the main point of this endeavor is an integration
with QuickBooks Web Connector, which is a SOAP client. However, the QBWC
SOAP client wants to just access the ActionWebService SOAP server like
this:

Parameters: {“action”=>“api”, “controller”=>“qbwc”}

This causes Rails to spit out something very similar to the error
messages that the starter of this thread was getting.

My SOAP client, called from ActionWebService::Client::Soap.new, works
fine, but it access the server like this:

Parameters: {“<?xml version"=>"\"1.0\" encoding=\"utf-8\" ?>\n<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema\”\n
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/\“\n
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance\”>\n env:Body\n
<n1:Authenticate xmlns:n1="urn:ActionWebService"\n
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/\“>\n
<param0 xsi:type="xsd:string">test\n <param1
xsi:type="xsd:string">test\n </n1:Authenticate>\n
</env:Body>\n</env:Envelope>”, “action”=>“api”, “controller”=>“qbwc”}

Now, is this something peculiar about Intuit (the makers of QuickBook
and QBWC) or is this a Rails related issue. I know that “AWS does not
try to implement every facet of the WC3 specifications for SOAP” (from
Agile by Thomas an DHH). Should I be using some other SOAP library, such
as SOAP4R, in order to get this type of scrict functionality that QBWC
is demanding, or is there a way around this?

“In general, there are two approaches to building SOAP web services and
their clients (code- first and WSDL-first), with a fair degree of
religious argument for each approach, however there is little dispute
that when interoperability is important, a WSDL-first approach makes the
most sense. In the case of the Web Connector, the Web Connector is
acting as a SOAP client which was written based on a canonical standard
.NET web serviceâ??s WSDL, so we followed the WSDL-first approach to
building the client and as we went through the process of testing with
.NET and Java web services we found the WSDL-first approach to be the
most reliable method of ensuring that the web services we built to
support the web connector remain compatible with the web connector. In
fact, we spent quite a bit of time tracking down what appeared to be
bugs in the web connector (and were certainly less than graceful
failures) that turned out to be caused by web services that did not
conform to the WSDL we expected! We therefore strongly recommend a
wsdl-first approach to developing a web service that works with the web
connector!” (from QBWC PDF)

Now, I know that SOAP4R has a wsdl2ruby script, however I’ve never
gotten it to run. Does ActionWebService have the ability to turn a WSDL
file in to a service API, aka, wsdl2AWS? That would be a great feature.

What I’m guessing is that QBWC is very anal and is probably not going to
work with AWS, and judging by my luck recently, not going to work with
SOAP4R either, which means I’m going to have to have some standalone PHP
soap server talking to my Rails app in some RESTful manner… freaking
nightmare. :slight_smile:

It is good to know that there’s others out there having simular issues,
however.

William