Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following example shows a script that allows you to connect to the metadata server and get json data

Code Block
languagepowershell
$ENV:RED_META_DSN=$ENV:WSL_META_DSN
$ENV:RED_META_USER=$ENV:WSL_META_USER
$ENV:RED_META_PWD=$ENV:WSL_META_PWD
$ENV:RED_META_SCHEMA=$ENV:WSL_META_SCHEMA
$ENV:RED_META_DSN_ARCH=$ENV:WSL_META_DSN_ARCH
$ENV:RED_META_CON_STRING=$ENV:WSL_META_CONSTRING

$strCmds = @"
& cmd /k WslMetadataService.exe  --insecure --meta-dsn "WSENV~RED_META_DSN~" --meta-user "WSENV~RED_META_USER~" --meta-password "WSENV~RED_META_PWD~" --meta-schema "WSENV~RED_META_SCHEMA~" --meta-db-type 14 --ws-user "REST_API" --log-level 9 --meta-dsn-arch WSENV~RED_META_DSN_ARCH~ --meta-con-string "WSENV~RED_META_CON_STRING~"
"@

start-process powershell -ArgumentList "-noexit -command & Invoke-Command -ScriptBlock {$strCmds}"

Write-Output "1"
Write-Output "WslMetadataService started in separate window"
Write-Output "Use curl from a command window to get json data back from the service."
Write-Output "Examples (replace the 8080 port with the port returned by your service):"
Write-Output "curl http://localhost:8080/objectsById -o c:\temp\out_ALL_OBJECTS.json"
Write-Output "curl http://localhost:8080/objectsByName/load_customer -o c:\temp\out_LOAD_CUSTOMER.json"
Write-Output "curl http://localhost:8080/types -o c:\temp\out_types.json"