AppWorx, Dollar Universe and Sysload Community

 View Only

Wanna use the API with Powershell ?

  • 1.  Wanna use the API with Powershell ?

    Posted Jan 28, 2022 12:33 PM
    Edited by Eric Delawoevre Jan 28, 2022 12:34 PM
    As you finished to install your war WebService file into your tomcat,
    Here is a good starting point if you want to use the WebService API via Powershell


    $url = "https://univiewer.mycorp/duws/DuwsSEI?wsdl"
    $webservicex = New-WebServiceProxy -Uri $url -Class duwsSoap
    $type = $webservicex.GetType().Namespace

    $webservicex | gm

    $uvmsContext = New-Object ($type + '.uvmsContext')
    $contextHolder = New-Object ($type + '.contextHolder')
    $context = New-Object ($type + '.context')
    $envir = New-Object ($type + '.envir')
    $duwsVersion = New-Object ($type + '.duwsVersion')


    $uvmsNodeFilter = New-Object ($type + '.uvmsNodeFilter')
    $nodeFilter = New-Object ($type + '.nodeFilter')
    $muFilter = New-Object ($type + '.muFilter')

    #############################
    $duwsVersion = $webservicex.getWsVersion()

    ###########################

    $uvmsContext.uvmsHost = "myUVMS.mycorp"
    $uvmsContext.uvmsPort = 4184
    $uvmsContext.uvmsUser = "myLogin"
    $uvmsContext.uvmsPassword = "myPassword"

    $contextHolder.token = $webservicex.login($uvmsContext)

    ##################
    $uvmsNodeFilter.company = "*"
    $uvmsNodeFilter.node = "*"
    $webservicex.getDUEnvironmentList($contextHolder.token,$uvmsNodeFilter)

    #############################
    $envir.area = "X"
    $envir.company = "CRPPRD"
    $envir.node = "CRPPLSUV1"

    $context.envir=$envir
    $contextHolder.context = $context

    ##############################################
    $nodeFilter.node = "CRP*"
    $webservicex.getListNode($contextHolder, $nodeFilter)

    ###########################################

    $muFilter.mu = "*"
    $webservicex.getListMU($contextHolder,$muFilter)

    ##################################
    $webservicex.logout($contextHolder.token)

    ------------------------------
    [JobTitle]
    [CompanyName]
    #dollaruniverse
    ------------------------------