Ruby on rails 3 Rails Savon Soap HTTP错误(500)

Ruby on rails 3 Rails Savon Soap HTTP错误(500),ruby-on-rails-3,http,ssl,savon,Ruby On Rails 3,Http,Ssl,Savon,我正在使用Savon连接web服务 client = Savon::Client.new("https://nsd-preview.nimsoftondemand.com/servicedesk/webservices/ServiceRequest?wsdl") client.http.auth.ssl.verify_mode = :none client.wsdl.soap_actions 抛出错误像 W, [2013-03-12T15:54:12.159117 #4807] WARN

我正在使用Savon连接web服务

client = Savon::Client.new("https://nsd-preview.nimsoftondemand.com/servicedesk/webservices/ServiceRequest?wsdl")

client.http.auth.ssl.verify_mode = :none

client.wsdl.soap_actions
抛出错误像

W, [2013-03-12T15:54:12.159117 #4807]  WARN -- : HTTPI executes HTTP GET using the httpclient adapter
Savon::HTTP::Error: HTTP error (500):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Error</title>
      <link href="/servicedesk/web/common/css/form_builder/admin.css" rel="stylesheet" type="text/css" />

   </head>

   <body>
      <table width="100%" height ="500" border="0" cellpadding="0" cellspacing="0">
         <tr>
            <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="head_bg">

               <tr valign="top">
                <td width="31%" height="67" align="left"><img src="/servicedesk/web/common/img/misc/logo.gif" width="290" height="69" /></td>
                <td width="43%">&nbsp;</td>
                <td width="23%" align="right"><table border="0" align="right" cellpadding="2" cellspacing="0">
                    <tr>
                        <td height='16'><img src="/servicedesk/web/common/img/icons/about_us.gif"/></td>
                        <td align="right" class="top_panel_links"><a href="http://www.inteqnet.com" target="_blank" class="top_panel_links">About Us</a> |</td>
                        <td height="16"><img src="/servicedesk/web/common/img/icons/help.gif"/></td>
                        <td align="right" class="top_panel_links"><a href="/xwiki" target="_blank" class="top_panel_links">Help |</td>
                        <td height="16"><img src="/servicedesk/web/common/img/icons/login.gif" /></td>
                        <td align="right" class="top_panel_links"><a href="/servicedesk/web/jsp/apps/login.jsp" class="top_panel_links">Login</td>
                    </tr>
                  </table></td>
               </tr>

            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
               <tr>
                  <td height="40">&nbsp;</td>
               </tr>
               <tr>
                  <td align="center"><table border="0" align="center" cellpadding="0" cellspacing="0" >
                     <tr>
                        <td height="265" align="left" valign="top"><img src="/servicedesk/web/common/img/misc/login_lf.gif" width="9" height="265" /></td>
                        <td width="470" valign="middle" background="/servicedesk/web/common/img/misc/login_bg.gif"><table border="0" align="center" cellpadding="2" cellspacing="10">

                           <tr>
                              <td valign="top"><img src="/servicedesk/web/common/img/icons/ico_error.gif" width="45" height="45" /></td>

                              <td valign="top" class="error_text">We're sorry. We encountered an error in servicing your request. Please contact your Support Team for further assistance


                              or return to the <span class="link_text"><a href="/servicedesk/web/jsp/apps/login.jsp">Login Page</a></span> and try again.

                              </td>
                           </tr>

                        </table></td>
                        <td align="right" valign="top"><img src="/servicedesk/web/common/img/misc/login_rt.gif" width="9" height="265" /></td>
                     </tr>
                  </table></td>
               </tr>
               <tr>
                  <td align="center" class="footer_text">Copyight &copy; 2011 Nimsoft LLC. All rights reserved.</td>
               </tr>
            </table></td>
         </tr>
      </table>
   </body>
</html>
第一步我做错了什么 我几乎浪费了两天时间试图找到解决方案 我也尝试过发送证书文件,但仍然出现了错误。我应该怎么做才能获得有效数据

我正在使用savon 1.0.0

谢谢你的帮助


是否存在依赖性问题 我正在使用 ruby 1.8.7 rails 3.0.7 我安装了前面提到的savon 1.0.0的所有运行时依赖项和开发依赖项(这不是一个真正的答案,但在注释中放这么多代码是很麻烦的)

我创建了一个测试脚本,它看起来很好

require 'rubygems'
require 'savon'
client = Savon::Client.new("https://nsd-preview.nimsoftondemand.com/servicedesk/webservices/ServiceRequest?wsdl")
client.http.auth.ssl.verify_mode = :none
puts "Soap actions: " + client.wsdl.soap_actions.inspect
输出

$ ruby test.rb 
WARN -- : HTTPI executes HTTP GET using the net_http adapter
Soap actions: [:list_worklogs, :list_related_tickets, :list_attachments, :unrelate_configuration_item, :send_communication, :list_communications, :unrelate_ticket, :add_worklog, :update_service_request, :relate_attachment, :unrelate_attachment, :list_sla_compliance_levels, :update_worklog, :relate_configuration_item, :list_related_configuration_items, :list_activities, :relate_ticket, :log_service_request, :get_service_request, :list_service_requests]
ruby版本1.9.3p125

Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    akami (1.2.0)
      gyoku (>= 0.4.0)
      nokogiri (>= 1.4.0)
    builder (3.2.0)
    gyoku (1.0.0)
      builder (>= 2.1.2)
    httpi (1.1.1)
      rack
    nokogiri (1.5.6)
    nori (1.1.5)
    rack (1.5.2)
    savon (1.0.0)
      akami (~> 1.1)
      builder (>= 2.1.2)
      gyoku (>= 0.4.0)
      httpi (~> 1.0)
      nokogiri (>= 1.4.0)
      nori (~> 1.1)
      wasabi (~> 2.2)
    wasabi (2.5.1)
      httpi (~> 1.0)
      nokogiri (>= 1.4.0)

PLATFORMS
  ruby

DEPENDENCIES
  savon (= 1.0.0)

您使用的是哪一版本的savon我测试了1.0.0和1.1.0是否存在依赖性问题我仍然无法找到问题所在我添加了一个Gemfile.lock,用于在ruby 1.9.3上成功运行脚本我使用的是ruby 1.8.7和rails 3.0.7
GEM
  remote: http://rubygems.org/
  specs:
    akami (1.2.0)
      gyoku (>= 0.4.0)
      nokogiri (>= 1.4.0)
    builder (3.2.0)
    gyoku (1.0.0)
      builder (>= 2.1.2)
    httpi (1.1.1)
      rack
    nokogiri (1.5.6)
    nori (1.1.5)
    rack (1.5.2)
    savon (1.0.0)
      akami (~> 1.1)
      builder (>= 2.1.2)
      gyoku (>= 0.4.0)
      httpi (~> 1.0)
      nokogiri (>= 1.4.0)
      nori (~> 1.1)
      wasabi (~> 2.2)
    wasabi (2.5.1)
      httpi (~> 1.0)
      nokogiri (>= 1.4.0)

PLATFORMS
  ruby

DEPENDENCIES
  savon (= 1.0.0)