-
Notifications
You must be signed in to change notification settings - Fork 6
/
wcf.test.ps1
27 lines (21 loc) · 1.01 KB
/
wcf.test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
param([switch] $UseFiddler)
. .\wcf.ps1
if ($UseFiddler) {
$hostname = 'localhost.fiddler'
}
else {
$hostname = 'localhost'
}
$wsdlImporter = Get-WsdlImporter "http://$($hostname):14232/EchoService.svc/mex"
# Get-WsdlImporter "http://$($hostname):14232/EchoService.svc" -HttpGet
# Get-WsdlImporter "http://$($hostname):14232/EchoService.svc?wsdl" -HttpGet
# $proxyType = Get-WcfProxyType $wsdlImporter
# $endpoints = $wsdlImporter.ImportAllEndpoints();
# $proxy = New-Object $proxyType($endpoints[0].Binding, $endpoints[0].Address);
# $proxy = Get-WcfProxy "http://$($hostname):14232/EchoService.svc/mex"
# $proxy = Get-WcfProxy $wsdlImporter # "http://$($hostname):14232/EchoService.svc/WCF" (New-Object System.ServiceModel.WSHttpBinding)
$proxy = Get-WcfProxy 'net.tcp://localhost:8732/EchoService/mex' 'net.tcp://localhost:8732/EchoService/' (New-Object System.ServiceModel.NetTcpBinding)
$proxy.Echo("Justin Dearing");
#Get-Help Get-WsdlImporter
#Get-Help Get-WcfProxyType
#Get-Help Get-WcfProxy