Created
August 10, 2012 21:16
-
-
Save niklasb/3318047 to your computer and use it in GitHub Desktop.
Savon + Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'savon' | |
require 'pry' | |
url = 'http://kim-cm-bts01.scc.kit.edu/HeadingTreeService/HeadingTreeService.svc?wsdl' | |
client = Savon::Client.new do | |
wsdl.document = 'http://kim-cm-bts01.scc.kit.edu/HeadingTreeService/HeadingTreeService.svc?wsdl' | |
http.proxy = "http://dtun.de:9999" | |
end | |
# make a request | |
client.request "GetHeadingTreeReq" do | |
term = "SS 2012" | |
# we should make IIS understand what Savon generates, instead of hardcoding | |
# the envelope! | |
soap.xml = <<-XML | |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:kit="http://KIT.Campus.Migration.KIM.Service.EventService.GetHeadingTree"> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<kit:GetHeadingTreeReq> | |
<!--1 or more repetitions:--> | |
<Semester>#{term}</Semester> | |
</kit:GetHeadingTreeReq> | |
</soapenv:Body> | |
</soapenv:Envelope> | |
XML | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
missing http?
client = Savon::Client.new do |http|
...
end