Reputation: 175
The organization I'm trying to connect to has asked if I could load their WSDL from a local resource before executing their functions. I've tried a bunch of options but I keep getting could not connect to host errors. Here's my logic
$sc = new SoapClient("http://localhost.com/wsdl.xml", array());
I've also tried:
$sc = new SoapClient("http://localhost.com/wsdl.xml, array ( "encoding"=>"ISO-8859-1",
"stream_context" => stream_context_create($opts),
"trace"=>1,
"location"=>'http://remoteurl.com/wsdl',
"exceptions"=>TRUE,
"connection_timeout"=>20000 ));
If I just use the remoteurl.com/wsdl it works. Any ideas?
Upvotes: 1
Views: 2335
Reputation: 3367
Just save the complete wsdl-file including the referenced xsd (if used) to local drive (or network share) and change the url-path prefix from 'http://...' to 'file://..local-wsdl-path-here'
Upvotes: 2