Skip to content

Instantly share code, notes, and snippets.

@niklasb
Created August 10, 2012 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklasb/3318047 to your computer and use it in GitHub Desktop.
Save niklasb/3318047 to your computer and use it in GitHub Desktop.
Savon + Proxy
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
@u007
Copy link

u007 commented Feb 22, 2017

missing http?
client = Savon::Client.new do |http|
...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment