0

I'm trying to access this URI: http://143.166.84.118/services/assetservice.asmx?WSDL (Dell warranty info)

In Windows Powershell I can do this no problem:

$service = New-WebServiceProxy -Uri http://143.166.84.118/services/assetservice.asmx?WSDL

But in PHP:

$DELL_URL = "http://143.166.84.118/services/assetservice.asmx?WSDL"; //Access webproxy by IP
$soap = new SoapClient($DELL_URL);

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://143.166.84.118/services/assetservice.asmx?WSDL' in C:\path\to\my\script.php:25 Stack trace: #0 C:\path\to\my\script.php(25): SoapClient->SoapClient('http://143.166....') #1 {main} thrown in C:\path\to\my\script.php on line 25

What am I doing wrong in php? I know the URL works cause it works with powershell.

As per Pete's suggestion I went to http://143.166.84.118/services/assetservice.asmx?WSDL and downloaded a local copy of the file then did this which worked:

$soap = new SoapClient($wsdlfilepath);

Do I always have to download a local copy of the file when using php?

edit: Didn't make any changes but now I'm getting "Uncaught SoapFault exception: [Client] looks like we got no XML document in..." error. Should I be worried about this? You can view the wsdl file by going to the link. Are there problems with it or extra white space? I didn't see any.

red888
  • 27,709
  • 55
  • 204
  • 392
  • 1
    Does it work if you download the WSDL and instantiate a new SoapClient using the local copy? – Pete Scott Oct 23 '14 at 15:28
  • That worked. I updated my post. So will I always have to download a local copy of the file first when using PHP? – red888 Oct 23 '14 at 15:37
  • 1
    No, you shouldn't. It probably means you have one of the issues discussed here: http://stackoverflow.com/questions/21861077/soap-error-parsing-wsdl-couldnt-load-from-but-works-on-wamp – Pete Scott Oct 23 '14 at 15:44
  • If that solves the issue, can you either mark your question as a duplicate of the link I provided or post your resolution here as an answer and then accept it (accept your own answer)? Thanks! – Pete Scott Oct 23 '14 at 16:25

0 Answers0