gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 14:17:46 30 4
gpt4 key购买 nike

我正在使用 Savon 连接网络服务

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>

但如果我下载文件并尝试打开意味着

client = Savon.client File.expand_path("path/ServiceRequest_nimsoft.xml")

client.wsdl.soap_actions

=> [:update_worklog, :list_related_tickets, :get_service_request, :add_worklog, :relate_configuration_item, :list_attachments, :list_service_requests, :update_service_request, :list_related_configuration_items, :unrelate_configuration_item, :relate_attachment, :list_activities, :send_communication, :unrelate_attachment, :relate_ticket, :list_communications, :list_sla_compliance_levels, :list_worklogs, :log_service_request, :unrelate_ticket]

我第一步做错了什么我几乎浪费了 2 天的时间来寻找解决方案 我也尝试发送证书文件,但仍然发生错误我应该怎么做才能获得有效数据

我正在使用savon 1.0.0

感谢任何帮助

有没有依赖问题我在用 ruby 1.8.7轨道 3.0.7我为提到的 savon 1.0.0 安装了所有运行时依赖项和开发依赖项 here

最佳答案

(这不是一个真正的答案,但是在评论中放这么多代码很乱)

我创建了一个测试脚本,我觉得它很好

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)

关于ruby-on-rails-3 - Rails Savon Soap HTTP 错误 (500),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15358973/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com