Showing posts with label posh. Show all posts
Showing posts with label posh. Show all posts

Wednesday, May 18, 2011

Tiny clients to consume Web Services. (PHP, WinPoSh, Python, Ruby)

PHP:
$wsClient = new SoapClient('http://server/webapp/path/to/webservice');
$ResultHolder = $wsClient->RemoteOperation();

WinPoSh:
PS C:\> $wsClient = New-WebServiceProxy -Uri http://server/webapp/path/to/webservice
PS C:\> $wsClient | Get-Member
PS C:\> $wsClient.RemoteOperation()

Python:

import sys
from SOAPpy import WSDL

WSDLFILE = 'http://server/webapp/path/to/webservice'
_client = WSDL.Proxy(WSDLFILE)

result_holder = _client.RemoteOperation()

Ruby:
require 'savon'
# create a client for the service
client = Savon.client(wsdl: 'http://server/webapp/path/to/webservice')
print client.operations
# => [:find_user, :list_users]
# call the 'remoteOperation' operation
#response = client.call(:remote_operation, message: { id: 1 })
#response.body
# => { remote_operation_response: { id: 1, otherfield: 'Foo Bar' } }

Thursday, June 03, 2010

Twittie v0.1. A little script to use twitter.com services.

#Twittie01.ps1
#A little script to use twitter.com services.
#03-JUN-2010


[System.Net.ServicePointManager]::Expect100Continue = $false;

Friday, February 05, 2010

Windows PowerShell (PoSh) to parse some HTML content.

#wps_lidimedia_v30.ps1
#Windows PowerShell script to upgrade LidiMedia content (resources to be displayed in a moodle platform).
#NOV-2009