开发者

Hiccups while trying to consume a simple WCF service (Hello world) from Powershell

For the first time ever I am trying to consume a simple WCF service from the Powershell and getting hiccups.

I am referring to this link to setup the environment variable which is as under

$env:VSINSTALLDIR="$env:Program Files\Microsoft Visual Studio 10.0"
$env:VCINSTALLDIR="$env:Program Files\Microsoft Visual Studio 10.0\VC"
$env:DevEnvDir="$env:VSINSTALLDIR\Common7\IDE"
$env:FrameworkSDKDir="$env:VSINSTALLDIR\SDK\v3.5"
$FrameworkPath=$([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())
$env:FrameworkDir=$(split-path $FrameworkPath -Parent)
$env:FrameworkVersion=$(split-path $FrameworkPath -Leaf)
$env:PATH="$env:VSINSTALLDIR\Common7\IDE;$env:VCINSTALLDIR\BIN;$env:VSINSTALLDIR\Common7\Tools;$env:VSINSTALLDIR\Common7\Tools\bin;$env:VCINSTALLDIR\PlatformSDK\bin;$env:FrameworkSDKDir\bin;$env:FrameworkDir\$env:FrameworkVersion;$env:VCINSTALLDIR\VCPackages;$env:PATH"
$env:INCLUDE="$env:VCINSTALLDIR\ATLMFC\INCLUDE;$env:VCINSTALLDIR\INCLUDE;$env:VCINSTALLDIR\PlatformSDK\include;$开发者_运维技巧env:FrameworkSDKDir\include;$env:INCLUDE"
$env:LIB="$env:VCINSTALLDIR\ATLMFC\LIB;$env:VCINSTALLDIR\LIB;$env:VCINSTALLDIR\PlatformSDK\lib;$env:FrameworkSDKDir\lib;$env:LIB"
$env:LIBPATH="$FrameworkPath;$env:VCINSTALLDIR\ATLMFC\LIB"

The link mentioned has targeted for VS 2005 but I am using VS 2010. Henceforth, some parameter values I have changed as per my settings.

And then when I am trying to run the same from the PowerShell command prompt by issuing

wsdl.exe http://localhost:55853/Service1.svc?wsdl

I am encountering an error

The term 'wsdl.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the sp elling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:9 + wsdl.exe <<<< http://localhost:55853/Service1.svc?wsdl + CategoryInfo : ObjectNotFound: (wsdl.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Could anyone please help me as what mistake I am doing here?

Thanks


You have the name of the Program Files environment variable wrong, this code should work:

$env:VSINSTALLDIR="$env:ProgramFiles\Microsoft Visual Studio 10.0"
$env:VCINSTALLDIR="$env:ProgramFiles\Microsoft Visual Studio 10.0\VC"
$env:DevEnvDir="$env:VSINSTALLDIR\Common7\IDE"
$env:FrameworkSDKDir="$env:VSINSTALLDIR\SDK\v3.5"
$FrameworkPath=$([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())
$env:FrameworkDir=$(split-path $FrameworkPath -Parent)
$env:FrameworkVersion=$(split-path $FrameworkPath -Leaf)
$env:PATH="$env:VSINSTALLDIR\Common7\IDE;$env:VCINSTALLDIR\BIN;$env:VSINSTALLDIR\Common7\Tools;$env:VSINSTALLDIR\Common7\Tools\bin;$env:VCINSTALLDIR\PlatformSDK\bin;$env:FrameworkSDKDir\bin;$env:FrameworkDir\$env:FrameworkVersion;$env:VCINSTALLDIR\VCPackages;$env:PATH"
$env:INCLUDE="$env:VCINSTALLDIR\ATLMFC\INCLUDE;$env:VCINSTALLDIR\INCLUDE;$env:VCINSTALLDIR\PlatformSDK\include;$env:FrameworkSDKDir\include;$env:INCLUDE"
$env:LIB="$env:VCINSTALLDIR\ATLMFC\LIB;$env:VCINSTALLDIR\LIB;$env:VCINSTALLDIR\PlatformSDK\lib;$env:FrameworkSDKDir\lib;$env:LIB"
$env:LIBPATH="$FrameworkPath;$env:VCINSTALLDIR\ATLMFC\LIB"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜