Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- ini_set("display_errors", 1);
- $soapUrl = "http://myserver/AIMWebservice/v1.1/AIM.asmx"; // asmx URL of WSDL
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <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/">
- <soap:Body>
- <GetPassword xmlns="https://tempuri.org/">
- <passwordWSRequest>
- <AppID>app Id</AppID>
- <Safe>CofreEquipeFerrmantas</Safe>
- <Folder>path</Folder>
- <Object>Operating System-WinDomain</Object>
- <UserName>SPSMON01</UserName>
- <Address>BSBR</Address>
- <Database>null</Database>
- <PolicyID>null</PolicyID>
- <Reason>null</Reason>
- <ConnectionTimeout>360</ConnectionTimeout>
- <Query>null</Query>
- <QueryFormat>null/QueryFormat>
- </passwordWSRequest>
- </GetPassword>
- </soap:Body>
- </soap:Envelope>';
- $headers = array(
- "POST /AIMWebservice/v1.1/AIM.asmx HTTP/1.1",
- "Host: myserver",
- "Content-Type: text/xml; charset=\"utf-8\"",
- "SOAPAction: \"https://tempuri.org/GetPassword\"",
- "Content-length: ".strlen($xml_post_string),
- );
- $url = $soapUrl;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $response = curl_exec($ch);
- curl_close($ch);
- $response1 = str_replace("<soap:Body>","",$response);
- $response2 = str_replace("</soap:Body>","",$response1);
- echo $response1.' - '.$response2;
- $parser = simplexml_load_string($response2);
- print_r($response).PHP_EOL;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement