7

Ich habe Probleme, den Soap-Client mit Savon in Schienen 3.1 zu bauen. Aber ich bin in der Lage, die Antwort erfolgreich zu erhalten, wenn ich versuche, die Anforderung von der Curl-Befehlszeile zu stellen. Meine curl Anfrage von der Kommandozeile wie folgt aussehenRails 3.1 Savon Seife Anfrage Timeout geben :: Fehler: Timeout :: Fehler ut mit curl ich bekomme Antwort

curl -d @Downloads/test.xml -H "content-type: text/xml;charset=UTF-8" -H "SOAPAction: http://services.bamnetworks.com/registration/identityPoint/create" "https://qaservices.bamnetworks.com/ws/services/IdentityPointService" -v 

aus dem ich eine perfekte Antwort wie diese bekommen.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header /><soapenv:Body><identityPoint_create_response xmlns="http://services.bamnetworks.com/registration/types/1.6"><status><code>-2000</code><message> [Duplicate credential constraint violated] [com.bamnetworks.registration.types.exception.DuplicateCredentialException]</message><exceptionClass>com.bamnetworks.registration.types.exception.DuplicateCredentialException</exceptionClass> 

Aber wenn ich versuche, eine Anfrage von Savon Client zu machen jedes Mal, ich bin immer die

HTTPI executes HTTP POST using the net_http adapter 
Timeout::Error: Timeout::Error 

Meine Savon Anfrage dieser aussehen

client = Savon::Client.new do |wsdl, http| 
    http.auth.ssl.verify_mode = :none 
    wsdl.document = "https://qaservices.bamnetworks.com/ws/services/IdentityPointService?wsdl" 
end 

begin 

response = client.request :ns, :identityPoint_create_request do |soap, wsdl, http| 

     http.headers['SOAPAction'] = 'http://services.bamnetworks.com/registration/identityPoint/create' 
     http.headers = { "Content-Length" => "0", "Connection" => "Keep-Alive" } 
     soap.namespaces["xmlns:ns0"]="http://services.bamnetworks.com/application/types/1.0" 

     soap.header = { 
      "ns0:appCredentials" => { 
       "ns0:name"=>"XXXXXXX", 
       "ns0:password"=>"XXXXXXXXX" 
      } 
     } 
     soap.body ={ 
      :identification => { 
       :email => { 
        :address => "m[email protected]" 
       }, 
       :password => { :address => { :id => 44 } } 
      }, 
      :profileProperty => { 

       :name => "birthDay", 
       :value => "17" 
      }, 
      :profileProperty =>  { 
       :name => "birthMonth", 
       :value => "8" 
      }, 
      :profileProperty =>  { 
       :name => "birthYear", 
       :value => "1986" 
      }, 
      :attributes! => { :identification => { :type => "email-password" } } 
     } 
    end 

Ich weiß nicht, wo ich bin den Fehler machen. Wenn mir jemand dabei hilft, es herauszufinden. Danke!

+0

haben Sie versucht, das Timeout auf eine größere Zahl zu setzen? Vielleicht möchten Sie in diese Frage http://stackoverflow.com/questions/6384230/how-to-set-savon-default-timeout-value schauen –

Antwort

0

Seife Server-Problem wird versucht Linie Dies kann zu kommentieren:

http.headers = { "Content-Length" => "0", "Connection" => "Keep-Alive" }