Rails 3.1 Запрос мыла Savon дает тайм-аут ::Ошибка :Тайм-аут ::Ошибка при использовании curl я получаю ответ

У меня возникли проблемы с созданием клиента мыла с использованием savon в rails 3.1. Но я могу успешно получить ответ, когда пытаюсь сделать запрос из командной строки curl. Мой запрос curl из командной строки выглядит так

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

От которого я получил идеальный ответ, как это.

<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>

Но когда я пытаюсь сделать запрос от клиента Savon каждый раз, когда я получаю

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

Мой запрос Savon выглядит так

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 => "mlb_user@mlb.com"
              },
              :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

Я не знаю, где я делаю ошибку. Если кто поможет мне в этом разобраться. Спасибо!

7
задан Vivek Parihar 29 June 2012 в 10:11
поделиться