Hi, After following the excellent tutorials in the Agile Web Development with Rails book, I was able to get my webservice working pretty much perfectly :) 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:in `initialize'' /usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:6:in `initialize'' /usr/lib/ruby/1.8/rexml/document.rb:173:in `parse_stream'' /usr/lib/ruby/1.8/xmlrpc/parser.rb:717:in `parse'' /usr/lib/ruby/1.8/xmlrpc/parser.rb:475:in `parseMethodCall'' /usr/lib/ruby/1.8/xmlrpc/marshal.rb:63:in `load_call'' /usr/lib/ruby/1.8/xmlrpc/marshal.rb:32:in `load_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:in `decode_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:in `discover_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:in `api'' /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:in `perform_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:in `measure'' /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:in `perform_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:in `process_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:in `dispatch'' /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:in `synchronize'' /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:in `process_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:in `run'' /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:in `run'' /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:in `run'' /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:in `run'' /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 :) Cheers, Pete -- Posted via http://www.ruby-forum.com/.
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 <miggyx@peteslan.net> wrote:> Hi, > > After following the excellent tutorials in the Agile Web Development > with Rails book, I was able to get my webservice working pretty much > perfectly :) > > 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:in `initialize'' > /usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:6:in `initialize'' > /usr/lib/ruby/1.8/rexml/document.rb:173:in `parse_stream'' > /usr/lib/ruby/1.8/xmlrpc/parser.rb:717:in `parse'' > /usr/lib/ruby/1.8/xmlrpc/parser.rb:475:in `parseMethodCall'' > /usr/lib/ruby/1.8/xmlrpc/marshal.rb:63:in `load_call'' > /usr/lib/ruby/1.8/xmlrpc/marshal.rb:32:in `load_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:in > `decode_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:in > `discover_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:in `api'' > /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:in > `perform_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:in `measure'' > /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:in > `perform_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:in > `process_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:in > `dispatch'' > /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:in `synchronize'' > /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:in > `process_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:in `run'' > /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:in `run'' > /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:in `run'' > /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:in > `run'' > /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 :) > > > Cheers, > > > Pete > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Kent --- http://www.datanoise.com
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/typo-list@rubyforge.org/msg01648.html) Jim -- Jim Menard, jimm@io.com, jim.menard@gmail.com http://www.io.com/~jimm
I don''t suppose there is a known solution to it? :) I could only find info on Typo when I was googling.... Cheers, Pete -- Posted via http://www.ruby-forum.com/.
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 (tm) William Pete wrote:> I don''t suppose there is a known solution to it? :) > > I could only find info on Typo when I was googling.... > > > Cheers, > > > Pete-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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</param0>\n <param1 xsi:type=\"xsd:string\">test</param1>\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. :) It is good to know that there''s others out there having simular issues, however. William -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---