Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Nico Du Plessis
Nico Du Plessis
16,637 Points

php curl wsdl xml request error

Hi there, I am trying to consume a web service using a url like: http://192.168.48.21:8099/wsa/wsa1/wsdl?targetURI=urn:bars-com:DTAGSA-otaping.

This service accepts xml code. I use curl to access the url. I store the xml in a variable called $xml and the url in $url.

I get an error back "No resources found at the requested path: /wsa/wsa1/wsdl"

What am I missing? I am sure there is syntax or parameter problem, but I can't find it.

$headers = array( "Content-type: text/xml", "Content-length: " . strlen($xml), "Connection: close", ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$data = curl_exec($ch); echo $data; if(curl_errno($ch)) print curl_error($ch); else curl_close($ch);