murugesan
murugesan

Reputation: 31

Rails Savon Soap HTTP error (500)

I am using Savon for connecting web services

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

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

client.wsdl.soap_actions

throws error like

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>

but if i download the file and tried to open means

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]

what i am doing wrong in the first step i almost wasted 2 days for trying to find the solutions i tried with sending certificate file also but still the error is happening what should i do to get valid data

i am using savon 1.0.0

Any help appreciated

is there any dependency problem i am using ruby 1.8.7 rails 3.0.7 i installed all run time dependency and development dependency for savon 1.0.0 mentioned here

Upvotes: 0

Views: 1311

Answers (1)

Arctodus
Arctodus

Reputation: 5847

(This isnt really an answer, but it's messy to put this much code in a comment)

I created a test script and it looks fine to me

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

Output

$ 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 version 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)

Upvotes: 1

Related Questions