WCF Command Line Tools

The purpose of this blog is to document command line tools used by WCF with example.

netsh.exe http

This command line focus on grants or revoke http access permission.

List http port access permission

1 netsh http show

Grant access to http port for login user

1 set URL=http://+:8001/
2 netsh http add urlacl url=%URL% user=%USERDOMAIN%\%USERNAME%

Revoke access to http port

1 set URL=http://+:8001/
2 netsh http delete urlacl url=%URL%

Reference

SvcUtil.exe

This tool generates proxy service classes.

SvcUtil.exe batch example

 1 set URL=http://localhost:8732/mex
 2 set SVC_PATH=/directory:D:\Projects\b
 3 set SVC_OUTPUT_FILE=/o:OutputFile
 4 set SVC_CONFIG_FILE=/config:app.config
 5 set SVC_TAREGET_CLIENT_VERSION=/tcv:Version35
 6 set SVC_LANGUAGE=/l:c#
 7 set SVC_NAMESPACE=/namespace:*
 8 set SVC_ASYNC=/async
 9 
10 set PROGRAM=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\SvcUtil.exe
11 
12 @REM set OPTIONS=%URL% "%SVC_PATH%" "%SVC_OUTPUT_FILE%" /target:xmlSerializer
13 @REM set OPTIONS=%URL% "%SVC_PATH%" /target:metadata
14 set OPTIONS=%URL% "%SVC_PATH%" "%SVC_OUTPUT_FILE%" "%SVC_CONFIG_FILE%" %SVC_TAREGET_CLIENT_VERSION% %SVC_LANGUAGE% /target:code %SVC_NAMESPACE% %SVC_ASYNC%
15 
16 @REM echo "%PROGRAM%" %OPTIONS%
17 "%PROGRAM%" %OPTIONS%

Reference

SvcTraceViewer.exe

This GUI tool inspects log files generated by WCF services.

SvcTraceViewer.exe batch example

1 set PROGRAM=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\SvcTraceViewer.exe
2 @REM echo "%PROGRAM%"
3 "%PROGRAM%"

Reference

Reference