> I would expect to get a NetConnectNotAllowed error, but instead it > does the network call and gives me the actual web service error.
> Is there a way to intercept all HTTP calls from within soap4r? I'm > using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3
If soap4r uses Net::HTTP then it should Just Work. I haven't looked at soap4r's internals in a long time, but the last time I did it was painful. I wouldn't be at all surprised if it just makes socket calls, but I also wouldn't be surprised if some require arcana is going on which breaks fakeweb - a version of soap4r is in the standard library, and installing the gem broke Irb.
I guess I'm saying you'll need to dig into the internals, but I'd try it without the soap4r gem too.
On May 31, 1:37 pm, zilkey <j...@zilkey.com> wrote:
> Is there a way to intercept all HTTP calls from within soap4r? I'm
> using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3
I took a look at soap4r's source just now, and it looks like it's
using httpclient, which is an alternative to Net::HTTP. So FakeWeb
won't be able to stub out those requests, since it works by changing
the internals of Net::HTTP.
However! Michael Shapiro has a fork on github that has support for
both Net::HTTP and httpclient. I haven't had time to fully review his
changes, yet, and they're based on an older version of FakeWeb, but
hey -- if you're interested, give it a try and let me know how it
works out. http://github.com/koudelka/fakeweb/commit/f98f40261517a7d80d13b09a13e...
In general, I'd love to get a multi-adapter thing going on. There are
a few really interesting alternatives out there, like curb, typhoeus,
etc.
> On May 31, 1:37 pm, zilkey <j...@zilkey.com> wrote:
>> Is there a way to intercept all HTTP calls from within soap4r? I'm
>> using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3
> I took a look at soap4r's source just now, and it looks like it's
> using httpclient, which is an alternative to Net::HTTP. So FakeWeb
> won't be able to stub out those requests, since it works by changing
> the internals of Net::HTTP.
> However! Michael Shapiro has a fork on github that has support for
> both Net::HTTP and httpclient. I haven't had time to fully review his
> changes, yet, and they're based on an older version of FakeWeb, but
> hey -- if you're interested, give it a try and let me know how it
> works out. http://github.com/koudelka/fakeweb/commit/f98f40261517a7d80d13b09a13e...
> In general, I'd love to get a multi-adapter thing going on. There are
> a few really interesting alternatives out there, like curb, typhoeus,
> etc.
On Mon, Jun 1, 2009 at 8:30 AM, Chris Kampmeier <ch...@kampers.net> wrote:
> On May 31, 1:37 pm, zilkey <j...@zilkey.com> wrote:
> > Is there a way to intercept all HTTP calls from within soap4r? I'm
> > using the soap4r gem, v 1.5.8 and the fakeweb gem, v 1.2.3
> I took a look at soap4r's source just now, and it looks like it's
> using httpclient, which is an alternative to Net::HTTP. So FakeWeb
> won't be able to stub out those requests, since it works by changing
> the internals of Net::HTTP.
> However! Michael Shapiro has a fork on github that has support for
> both Net::HTTP and httpclient. I haven't had time to fully review his
> changes, yet, and they're based on an older version of FakeWeb, but
> hey -- if you're interested, give it a try and let me know how it
> works out.
> http://github.com/koudelka/fakeweb/commit/f98f40261517a7d80d13b09a13e...
> In general, I'd love to get a multi-adapter thing going on. There are
> a few really interesting alternatives out there, like curb, typhoeus,
> etc.
> Chris
-- Dr Nic Williams
Mocra - Premier iPhone and Ruby on Rails Consultants
w - http://mocra.com twitter - @drnic
skype - nicwilliams
e - dr...@mocra.com
p - +61 412 002 126 or +61 7 3102 3237