Soap and Http-access problem.

Discussion in 'Ruby' started by Ola Bini, Aug 4, 2006.

  1. Ola Bini

    Ola Bini Guest

    Hi,

    I'm working on an application where some of the business logic is
    accessible with SOAP. I've used SOAP4R to generate everything and it
    works splendid (I use http-access2 since we require https). Anyway, a
    week ago, this stopped working, for no reason I can figure out. But it
    just stopped working on my dev machine, not on our production_test
    server or anything. I'm sitting on Windows 2003, and the stack trace
    looks like this:
    Bad file descriptor - connect(2) (, #0)
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:1391:in
    `initialize'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:1391:in
    `create_socket'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:1352:in `connect'
    d:/programming/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
    d:/programming/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:1351:in `connect'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:1209:in `query'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:892:in `query'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:434:in
    `do_get_block'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:370:in
    `conn_request'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:285:in `request'
    d:/programming/ruby/lib/ruby/site_ruby/1.8/http-access2.rb:264:in `post'
    d:/programming/ruby/lib/ruby/1.8/soap/streamHandler.rb:170:in `send_post'
    d:/programming/ruby/lib/ruby/1.8/soap/streamHandler.rb:109:in `old_send'
    #{RAILS_ROOT}/vendor/lpw/lpw.rb:11:in `send'
    d:/programming/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:170:in `route'
    d:/programming/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:141:in `call'
    d:/programming/ruby/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call'
    d:/programming/ruby/lib/ruby/1.8/soap/rpc/driver.rb:232:in `getUserData'
    #{RAILS_ROOT}/app/models/address_information.rb:25:in `fetch'
    #{RAILS_ROOT}/app/models/lpw_object.rb:23:in `fetch'
    #{RAILS_ROOT}/app/controllers/lpw_controller.rb:110:in `addr'
    d:/Programming/Ruby/bin/mongrel_rails:18

    I would be very thankful for any help coming to terms with this.

    Regards
    --
    Ola Bini (http://ola-bini.blogspot.com)
    JvYAML, RbYAML, JRuby and Jatha contributor
    System Developer, Karolinska Institutet (http://www.ki.se)
    OLogix Consulting (http://www.ologix.com)

    "Yields falsehood when quined" yields falsehood when quined.
    Ola Bini, Aug 4, 2006
    #1
    1. Advertising

  2. Ola Bini

    Ola Bini Guest

    NAKAMURA, Hiroshi wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    >
    > Hmm. Trying to execute TCPSocket.new(nil, 0) here. Endpoint URL is
    > broken somewhere.
    >
    >> d:/programming/ruby/lib/ruby/1.8/soap/streamHandler.rb:109:in `old_send'

    >
    > Do you know what's 'old_send' here? What version of soap4r are you using?
    >
    > Regards,
    > // NaHi
    >
    >


    Hi,

    I'm using Soap4R 1.5.5. Regarding the old_send, that's the result of
    monkey_patching, since I add some big problems with another thing. Hmm.
    old_send is just send renamed. But this shouldn't be the problem, it
    works on another machine and has worked on this machine. The monkey
    patching looks like this:

    module SOAP
    class HTTPStreamHandler
    alias :eek:ld_send :send
    def send(endpoint_url, conn_data, soapaction = nil, charset = @charset)
    ret = old_send(endpoint_url,conn_data,soapaction,charset)
    if ret.receive_string =~ /.*?(<\?xml.*?<\/soapenv:Envelope>).*?/m
    ret.receive_string = $1
    end
    ret
    end
    end
    end

    and the reason that is is necessary can you find here:
    http://ola-bini.blogspot.com/2006/08/rails-soap4r-and-java.html

    in the next to last paragraph.

    Regards
    --
    Ola Bini (http://ola-bini.blogspot.com)
    JvYAML, RbYAML, JRuby and Jatha contributor
    System Developer, Karolinska Institutet (http://www.ki.se)
    OLogix Consulting (http://www.ologix.com)

    "Yields falsehood when quined" yields falsehood when quined.
    Ola Bini, Aug 7, 2006
    #2
    1. Advertising

  3. Ola Bini

    Ola Bini Guest

    NAKAMURA, Hiroshi wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Hi,
    >
    > Ola Bini wrote:
    > Do your production and development environment both uses http proxy to
    > access foreign WS?
    >


    Hi,

    Nope, no proxies anywhere. It's a straight call through https to the
    other machine.

    > Hmm. There must be an attachment interoperability problem. Can I see
    > entire response XML?


    I don't have it available right now, but I'll dig after it. Suffice to
    say, there was noise before <?xml (some kind of multipart structure,
    maybe), and what looked like the complete PDF sent attached after (the
    same data contained in a byte-array inside the SOAP-response)

    Regards
    --
    Ola Bini (http://ola-bini.blogspot.com)
    JvYAML, RbYAML, JRuby and Jatha contributor
    System Developer, Karolinska Institutet (http://www.ki.se)
    OLogix Consulting (http://www.ologix.com)

    "Yields falsehood when quined" yields falsehood when quined.
    Ola Bini, Aug 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nagesh
    Replies:
    2
    Views:
    9,360
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 12, 2006
  2. Ivan S
    Replies:
    0
    Views:
    516
    Ivan S
    Aug 13, 2008
  3. Mullin Yu
    Replies:
    0
    Views:
    202
    Mullin Yu
    Oct 8, 2003
  4. Frederik Vanderhaegen

    Soap Extension problem (seems that soap request is not sent to server)

    Frederik Vanderhaegen, Oct 20, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    258
    Frederik Vanderhaegen
    Oct 20, 2006
  5. Nick Gauthier

    SOAP and .NET: <env: vs <soap:

    Nick Gauthier, Feb 13, 2008, in forum: Ruby
    Replies:
    0
    Views:
    111
    Nick Gauthier
    Feb 13, 2008
Loading...

Share This Page