Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. Sample PS Script:
  2.  
  3. $SoapFile = "C:\Users\Administrator\Documents\AIM CCP\AIM_request.xml"
  4.  
  5. $ServiceURL = "http://192.168.1.252/AIMWebService/v1.1/AIM.asmx?WSDL"
  6.  
  7.  
  8. $AllProtocols= [System.Net.SecurityProtocolType]'SSL3,TLS,TLS11,TLS12'
  9.  
  10. [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
  11.  
  12.  
  13.  
  14. $result = (Invoke-WebRequest $ServiceURL -infile $soapfile -contentType "text/xml" -method POST)
  15.  
  16.  
  17.  
  18. [xml]$xml = $result.Content
  19.  
  20.  
  21.  
  22. $Server = $xml.Envelope.Body.GetPasswordResponse.GetPasswordResult.Address
  23.  
  24. $Database = $xml.Envelope.Body.GetPasswordResponse.GetPasswordResult.Database
  25.  
  26. $Username = $xml.Envelope.Body.GetPasswordResponse.GetPasswordResult.UserName
  27.  
  28. $Password = $xml.Envelope.Body.GetPasswordResponse.GetPasswordResult.Content
  29.  
  30.  
  31.  
  32. Write-Host "Server: $Server"
  33.  
  34. Write-Host "Database: $Database"
  35.  
  36. Write-Host "Username: $Username"
  37.  
  38. Write-Host "Password: $Password"
  39.  
  40.  
  41.  
  42.  
  43.  
  44. Sample relevant XML file (must be placed in the location mentioned in script) - name it AIM_request.xml
  45.  
  46.  
  47.  
  48. <?xml version="1.0" encoding="utf-8"?>
  49.  
  50. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  51.  
  52. <soap:Body>
  53.  
  54. <GetPassword xmlns="https://tempuri.org/">
  55.  
  56. <passwordWSRequest>
  57.  
  58. <AppID>SOAPUI</AppID>
  59.  
  60. <Safe>Oracle</Safe>
  61.  
  62. <Folder>Root</Folder>
  63.  
  64. <Object>AIMOracleObject</Object>
  65.  
  66. <Reason>I need to specify a reason to test CCP</Reason>
  67.  
  68. <ConnectionTimeout>60</ConnectionTimeout>
  69.  
  70. <QueryFormat>Exact</QueryFormat>
  71.  
  72. </passwordWSRequest>
  73.  
  74. </GetPassword>
  75.  
  76. </soap:Body>
  77.  
  78. </soap:Envelope>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement