0

I try to make a SOAP request:

$soapclient = new SoapClient('http://www.moviestarplanet.fr/WebService/ThirdParty/ThirdPartyService.asmx?wsdl');
$params = array('username' => 'string', 'password' => 'string');
$response = $soapclient->Login($params);
var_dump($response);

but an error telling me:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.moviestarplanet.fr/WebService/ThirdParty/ThirdPartyService.asmx?wsdl' : failed to load external entity[...]

I searched for a long time on the net, but I haven't found any solution... Anyone can help me, please? Thanks!

2
  • Do you have allow_url_fopen=On in php.ini ? Thats just first came into my mind. Also check here: stackoverflow.com/questions/12875409/… Commented Sep 11, 2016 at 15:41
  • Thanks for your help. Yes I have allow_url_fopen=On and your link didn't help me... I'm very lost... Commented Sep 11, 2016 at 16:12

1 Answer 1

-1

I have found the solution !

<?php
$xml_data = '
<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:Header>
    <ThirdPartyTokenHeader xmlns="http://moviestarplanet.com/">
      <ThirdPartyToken>8346D304-F85E-4dc1-98EB-033CBEE0217F</ThirdPartyToken>
    </ThirdPartyTokenHeader>
  </soap:Header>
  <soap:Body>
    <Login xmlns="http://moviestarplanet.com/">
      <username>USER</username>
      <password>PASS</password>
    </Login>
  </soap:Body>
</soap:Envelope>
';

$headers = array(
"POST /WebService/ThirdParty/ThirdPartyService.asmx HTTP/1.1",
"Referer: www.moviestarplanet.fr",
"User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; GT-I9505 Build/KOT49H)",
"Content-Type: text/xml; charset=utf-8",
"Host: www.moviestarplanet.fr",
"Content-length: ".strlen($xml_data),
"Expect: 100-continue"
);

$url = 'http://www.moviestarplanet.fr/WebService/ThirdParty/ThirdPartyService.asmx?WSDL';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);

$reply = curl_exec($ch); 

echo($reply);
?>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.