私はRemedy 9.1 Webサービスを使用していくつかのインターフェイスを構築しています。 Forms認証を使用してWSDLに到達するように構成されています。より強力なWebサービスが保護された状態に保たれるように、その設定を維持したいと思います。フォーム認証を使用したPowerShell WebServiceProxy
私は解決策の一部を持っていますが、彼らは一緒に働くことはできませんが、おそらく解決策を知っていますか?
#this is the url that you want will send thae request to
$url = "https://mycompany-itsm.columncloud.com/arsys/servlet/LoginServlet"
#here you can set your POST params
$parameters = "username=username&pwd=ppaasswwoorrdd&encpwd=1&ipoverride=0&initialState=-1&timezone=-28800000&goto=/arsys/WSDL/protected/servername/HPD_IncidentInterface_Create_WS"
#creating the xmlHtpp system object
$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open('POST', $url, $false)
#Setting required header of the request
$http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
$http_request.setRequestHeader("Content-length", $parameters.length)
#Assigning the params to the request
$Resp = $http_request.send($parameters)
echo $http_request.responseText
:私は、フォーム認証の後ろに戻ってWebサービスを移動する場合、私はこれを行う場合、私はWSDLを取得することができ、しかし
function New-ObjectFromProxy {
param($proxy, $proxyAttributeName, $typeName)
# Locate the assembly for $proxy
$attribute = $proxy | gm | where { $_.Name -eq $proxyAttributeName }
$str = "`$assembly = [" + $attribute.TypeName + "].assembly"
invoke-expression $str
# Instantiate an AuthenticationHeaderValue object.
$type = $assembly.getTypes() | where { $_.Name -eq $typeName }
return $assembly.CreateInstance($type)
}
$Now = get-date -Format G
$Q = "'System Broadcast End Date' >= """ + $Now + """"
$proxy = New-WebServiceProxy -Uri "https://mycompany-itsm.columncloud.com/arsys/WSDL/public/servername/CFG%3ABroadcast"
$authHeader = New-ObjectFromProxy -proxy $proxy -proxyAttributeName "AuthenticationInfoValue" -typeName "AuthenticationInfo"
$authHeader.userName = "username"
$authHeader.password = "password"
$proxy.AuthenticationInfoValue = $authHeader
$Response = $proxy.GetList($Q,"","")
$Response | format-Table Broadcast_Start_Date, Broadcast_Message
:私は、フォーム認証を削除する場合
この
作品これらのソリューションを組み合わせて、フォームauthを使用してWSDLにアクセスし、webServiceProxyオブジェクトを作成するソリューションを探したいと思います。おそらく私のgoogle-fuは弱いですが、私はnew-webserviceProxyのformsauthソリューションを見つけられませんでした。