Giter VIP home page Giter VIP logo

Comments (10)

inossidabile avatar inossidabile commented on May 14, 2024

Not really. It should just work. I can't see any reason for that to not work with passenger. WashOut is a pure ruby and clean Rails code without monkey patching. I need more info :)

from wash_out.

inossidabile avatar inossidabile commented on May 14, 2024

Do you have any progress? Give more info I'll try to help.

from wash_out.

arrk-shoba avatar arrk-shoba commented on May 14, 2024

Hi,
Sorry, was busy with the testing. I could test on Passenger (although there was some issue with the XML parsing...fixed that today.)
However I am still facing an issue.

NoMethodError
in UnionWsController#_action
undefined method struct?' for #<Array:0xd66d638> nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:86:inblock (2 levels) in _render_soap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in each' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:ineach_with_index'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in block in _render_soap' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:89:incall'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:89:in block (3 levels) in _render_soap' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:89:inmap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:89:in block (2 levels) in _render_soap' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:ineach'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in each_with_index' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:inblock in _render_soap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:87:in call' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:87:inblock (2 levels) in _render_soap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in each' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:ineach_with_index'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in block in _render_soap' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:87:incall'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:87:in block (2 levels) in _render_soap' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:ineach'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:in each_with_index' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:85:inblock in _render_soap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:100:in call' nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out/dispatcher.rb:100:in_render_soap'
nested_form/ruby/1.9.1/bundler/gems/wash_out-05936cf2a2ca/lib/wash_out.rb:20:in `block in <top (required)>'

There is some issue with the rendering...I find it weird as at times the same piece of code is running well.

from wash_out.

inossidabile avatar inossidabile commented on May 14, 2024

It doesn't look like a problem of passenger. Can you give me the dump of request you sent to it?

from wash_out.

arrk-shoba avatar arrk-shoba commented on May 14, 2024

Yes, I agree. Now the problem is not with Passenger. However, I do not understand why the dispatcher throws the error at times. It is not the case that I face this error for every request. Some are successful, others fail although internally the record is saved, output generated and when it has to create the soap response, it fails.


SOAP Request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WashOut">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:upload_student soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <import_student_request xsi:type="urn:import_student_request">
            <students xsi:type="urn:students">
               <student xsi:type="urn:student">
                  <id xsi:type="xsd:string">U31001</id>
                  <forename xsi:type="xsd:string">Shoba</forename>
                  <surname xsi:type="xsd:string">Menon</surname>
                  <dob xsi:type="xsd:string">07-08-1990</dob>
                  <gender xsi:type="xsd:string">F</gender>
                  <institution_email xsi:type="xsd:string">[email protected]</institution_email>
                  <nationality xsi:type="xsd:string"/>
                  <domicile_country xsi:type="xsd:string">IND</domicile_country>
                  <fee_status xsi:type="xsd:string">IN</fee_status>
                  <hall_of_residence xsi:type="xsd:string">HA001</hall_of_residence>
                  <programme_id xsi:type="xsd:string">P1002</programme_id>
                  <study_type xsi:type="xsd:string">PG</study_type>
                  <year_of_study xsi:type="xsd:string">1</year_of_study>
                  <start_date xsi:type="xsd:string">02-02-2012</start_date>
                  <end_date xsi:type="xsd:string">02-02-2013</end_date>
                  <record_type xsi:type="xsd:string">New</record_type>
               </student>
            </students>
         </import_student_request>
      </urn:upload_student>
   </soapenv:Body>
</soapenv:Envelope>

Controller code:

soap_action "upload_student",
              :args   => {:import_student_request => { :students => { :student => [{:id => :string, :forename => :string,  :surname => :string, 
                        :dob => :string,  :gender => :string, :institution_email => :string, 
                        :nationality => :string,  :domicile_country => :string,         
                        :fee_status => :string,  :hall_of_residence => :string,   
                        :programme_id => :string, :study_type => :string,  :year_of_study => :string,
                        :start_date => :string, :end_date => :string, :record_type => :string } ] } }},
              :return => { :"import-student-response" => { :students => { :student => [{ :id => :string, :status => :string }] } }}
  def upload_student


    puts "--------------------------"
    puts "In upload_student...."

    request_obj = params[:import_student_request][:students]
    @student = Student.new

    response_hash = @student.save_student_for_ws(request_obj, @union)
    # response_hash contains student id as key and the status values (which can be Success/Failed - if Failed with reasons)

    stud_status_array = Array.new(response_hash.length)
    idx = 0

    response_hash.each do |student_id, status| 
      puts "Student id-->"+student_id.to_s
      puts "Status-->"+status         
      stud_status_array[idx] = Hash.new
      stud_status_array[idx][:"id"] = student_id.to_s
      stud_status_array[idx][:"status"] = status
      idx +=1;
    end

    output = { :"import-student-response"  => 
      {:students => 
        {:student =>  stud_status_array       
        }
      }
    }
    puts "---- Output of upload_student ==>"+output.to_s

    render :soap => output 

  end

Output of upload_student ==>{:"import-student-response"=>{:students=>{:student=>[{:id=>"U1001", :status=>"Success"}]}}}

from wash_out.

inossidabile avatar inossidabile commented on May 14, 2024

I can't reproduce that. It just works for me with the structure that shows up at yours Output of upload student. Are you sure it fails while trying to respond with this one? I need the exact structure it fails with.

from wash_out.

arrk-shoba avatar arrk-shoba commented on May 14, 2024

Even I could not reproduce the issue on my machine. It happens almost 50% times on one of the test machines; hence I wished to drill down to the cause. However I could not yet trace the cause. Thanks a lot. I do not see any point in keeping this issue open as I tried on other machines where it worked!

from wash_out.

inossidabile avatar inossidabile commented on May 14, 2024

Good news. I've managed to reproduce that. Looks fixed. Try the new 0.3.5 version.

from wash_out.

arrk-shoba avatar arrk-shoba commented on May 14, 2024

It seems to be fixed as I didn't see the error again on the testing machine where I had found the error before. Thanks again!

btw, how did you reproduce it? I couldn't do it on my machine.

from wash_out.

inossidabile avatar inossidabile commented on May 14, 2024

I've played with concurrency and thread-safety a bit. And it failed miserably 😱 That's why it was so floating. Now it's ok :)

from wash_out.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.