Skip to content

Instantly share code, notes, and snippets.

View tjarratt's full-sized avatar

Tim Jarratt tjarratt

View GitHub Profile
@tjarratt
tjarratt / gist:9635638
Last active August 29, 2015 13:57
WCF Soap and Savon

From what I understand, WCF is a platform and set of tools for building frameworks in .Net. Using WCF it's possible to create services that act like SOAP, or REST, but it's also possible to create other services of your own devising.

From what I'd read, it's possible for your WCF service to have a WSDL that provides a SOAP-like description of the operations it provides. Given that, you may be able to coerce Savon into making requests on your behalf.

However, I don't want to give you the impression that Savon was designed to make working with WCF from ruby easy. The truth is that Savon was created to make interacting with SOAP services easy. This means that any services that implements a traditional SOAP interface, with a client WSDL is likely to work, but anything slightly outside the box is more complicated and less unlikely to work without some tinkering.

Like most good software, Savon is open source, so I'd love to know how well it works

± tj+tj |master ✗| → cf push -p ~/workspace/vcap-test-assets/sinatra/dora
Using manifest file /Users/pivotal/workspace/cli/manifest.yml
Creating app dorai!@#!@#!@#$ in org cli / space deadspace as cf-cli-eng@pivotallabs.com...
OK
...SNIP...
|2.0.0-p353| stanley in ~/workspace/cli
± tj+tj |master ✗| → cf delete -f 'dorai!@#!@#!@#$'
<definitions name="fooDelivery" targetNamespace="http://foo.com/wsdl">
<types>
<xs:schema targetNamespace="http://foo.com/xsd/standard">
<xs:element name="fooInput">
<xs:complexType>
<xs:attribute default="true" name="synchronous" type="xs:boolean" use="optional"/>
<xs:attribute name="sessionId" type="xs:string" use="optional"/>
<xs:attribute name="parentSessionId" type="xs:string" use="optional"/>
<xs:attribute name="logLevel" type="xs:int" use="optional"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2003-2004 The Sporting Exchange Limited. All rights reserved.
The presentation, distribution or other dissemination of the information contained herein by The Sporting Exchange Limited (Betfair) is not a license, either expressly or impliedly, to any intellectual property owned or controlled by Betfair.
Save as provided by statute and to the fullest extent permitted by law, the following provisions set out the entire liability of Betfair (including any liability for the acts and omissions of its employees, agents and sub-contractors) to the User in respect of the use of its WSDL file whether in contract, tort, statute, equity or otherwise:
(a) The User acknowledges and agrees that (except as expressly provided in this Agreement) the WSDL is provided "AS IS" without warranties of any kind (whether express or implied);
(b) All conditions, warranties, terms and undertakings (whether express or implied, statutory or otherwise relating to the deliver
@tjarratt
tjarratt / gist:d4a060c1169b19112646
Created May 1, 2014 20:25
rvm use rbx-2 --install --binary --fuzzy
tjarratt at retinabook in ~/git/jasmine-gem on ensure-rake-task-loaded-once
± rvm use rbx-2 --install --binary --fuzzy
rbx-2.2.6 is not installed - installing.
rubinius-2.2.6 - #removing rubies/rubinius-2.2.6 - please wait
Searching for binary rubies, this might take some time.
Found remote file http://binaries.rubini.us/osx/10.9/x86_64/rubinius-2.2.6.tar.bz2
Checking requirements for osx.
Certificates in '/Users/tjarratt/.rvm/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
rubinius-2.2.6 - #configure
ruby-1.9.3-p327:
system:
uname: "Darwin pivotal-guest-242.sf.pivotallabs.com 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr 2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
@tjarratt
tjarratt / gist:b09915277359bf02ccb4
Created May 2, 2014 18:17
attach tasks from file to pivotal tracker story
#!/usr/bin/env ruby
require 'pivotal-tracker'
PivotalTracker::Client.token = ENV['TRACKER_TOKEN']
PivotalTracker::Client.use_ssl = true
if ARGV.length != 4
puts <<-USAGE
usage: attach-tasks-to-story $PROJECT_ID $STORY_ID $TASKS_FILE
@tjarratt
tjarratt / gist:bfc85dfe33e6425fd828
Created May 27, 2014 22:35
ast + go + swappin pointers == SADFACE
func swap(dest **ast.Node, old, new ast.Node) bool {
udest := (*unsafe.Pointer)(unsafe.Pointer(dest))
return atomic.CompareAndSwapPointer(udest,
unsafe.Pointer(&old),
unsafe.Pointer(&new),
)
}
// MAKE THIS WORK with an ast node
[
{
"id": "buildpack",
"translation": "buildpack"
}
]
login:
ldap:
profile_type: search-and-compare
url: ldap://192.168.50.1:389/
userDN: 'cn=admin,dc=test,dc=com'
userPassword: 'password'
searchBase: 'dc=test,dc=com'
searchFilter: cn={0}
passwordAttributeName: userPassword
localPasswordCompare: true