Hello All,
I'm trying to rebuild using SAVON v2 some old SOAP code which was using SOAP4R gem. And I got stuck at very beginning :(
I can't even pass digest authentication and receiving HTTP 403 all the time.
The credentials are correct as 'curl
https://peakflow-int.telia.net/soap/sp -k -3 --digest -u user:password' gives no errors here.
Can anyone advise me that can be the issue here?
Thank you in advance!
Regards,
Artem
require 'savon'
require 'httpclient'
HTTPI.adapter = :httpclient
client = Savon.client do
wsdl './PeakflowSP.wsdl'
endpoint '
https://peakflow-int.telia.net/soap/sp'
ssl_verify_mode :none
ssl_version :SSLv3
convert_request_keys_to :none
pretty_print_xml true
log true
log_level :debug
digest_auth("user","password")
end
rqst = (<<__XML__)
<?xml version="1.0" encoding="utf-8"?>
<peakflow version="1.0">
<query id="query1" type="traffic">
<time start_ascii="10 days ago" end_ascii="now"/>
<unit type="bps_snmp"/>
<search limit="2000"/>
<filter type="router">
<instance name="router_name"/>
</filter>
<filter type="interface" binby="1"/>
</query>
</peakflow>
__XML__
response = client.call(:run_xml_query, message: { :query => rqst} )
Here is some debug output
I, [2014-02-07T16:51:13.700631 #20838] INFO -- : SOAP request:
https://peakflow-int.telia.net/soap/spI, [2014-02-07T16:51:13.700851 #20838] INFO -- : SOAPAction: "urn:PeakflowSPAction", Content-Type: text/xml;charset=UTF-8, Content-Length: 885
D, [2014-02-07T16:51:13.701199 #20838] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:PeakflowSP" xmlns:env="
http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:runXmlQuery>
<query><?xml version="1.0" encoding="utf-8"?>
<peakflow version="1.0">
<query id="query1" type="traffic">
<time start_ascii="10 days ago" end_ascii="now"/>
<unit type="bps_snmp"/>
<search limit="2000"/>
<filter type="router">
<instance name="router_name"/>
</filter>
<filter type="interface" binby="1"/>
</query>
</peakflow>
</query>
<output_format>xml</output_format>
</tns:runXmlQuery>
</env:Body>
</env:Envelope>
D, [2014-02-07T16:51:13.701760 #20838] DEBUG -- : HTTPI POST request to
peakflow-int.telia.net (httpclient)
at depth 1 - 19: self signed certificate in certificate chain
I, [2014-02-07T16:51:14.042514 #20838] INFO -- : SOAP response (status 403)
.....
/home/arta00/.rvm/gems/ruby-2.1.0/gems/savon-2.3.3/lib/savon/response.rb:86:in `raise_soap_and_http_errors!': HTTP error (403): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"> (Savon::HTTPError)