Here is the method and definition, I know it requires basic authentication and the case_ID
OpGet Method string OpGet(Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1yServiceDesk_serviceagent_wsdl.AuthenticationInfo AuthenticationInfo, string Case_ID,
- $uri = 'https://sninstance/RemedyService/RemedyServiceDesk.serviceagent?wsdl'
- $SN = New-WebServiceProxy -uri $URI -Credential $sncred
- $type = $SN.GetType().Namespace
- $get = new-object ($type + '.AuthenticationInfo')
- $get.username = $username
- $get.password = $password
I get this far.
TypeName: Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1yServiceDesk_serviceagent_wsdl.AuthenticationInfo
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
password Property string password {get;set;}
userName Property string userName {get;set;}
And here I can't figure out what to do.
$SN.opget($get,'INC2760753') Cannot find an overload for "opget" and the argument count: "2"
This is how I'm doing it without new-webserviceproxy
- $uri = "https://$sninstance/RemedyService/RemedyServiceDesk.serviceagent/RemedyServiceDeskEndpoint"
- $xml = [xml]@"
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:TIBCO_ITIL_ServiceDesk">
- <soapenv:Header/>
- <soapenv:Body>
- <urn:OpGet>
- <urn:AuthenticationInfo>
- <urn:userName>user</urn:userName>
- <urn:password>pass</urn:password>
- </urn:AuthenticationInfo>
- <urn:Case_ID>$case_id</urn:Case_ID>
- </urn:OpGet>
- </soapenv:Body>
- </soapenv:Envelope>
- "@
- $header = @{ SOAPAction = "/RemedyService/RemedyServiceDesk.serviceagent/RemedyServiceDeskPortTypeEndpoint/OpGet" }
- $post = Invoke-RestMethod -Uri $uri -Headers $header -Method Post -Body $xml -ContentType "text/xml"
- $post.envelope.body.opgetresponse