mrmonteith Posted April 13, 2015 Share Posted April 13, 2015 I'm new to SOAP and WSDLs in general. The stuff I'm debugging they said hasn't worked for quite some time. So this makes it harder. But basically I'm debugging the PHP script and got to this point: I wrote the output of $order_request as follows: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><fireOrder xmlns="http://ws.configureone.com"><in0>10203</in0></fireOrder></soapenv:Body></soapenv:Envelope> Then they try the following: $xml = simplexml_load_string($order_request, NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/"); But it appears that $xml is empty. From what I read it's supposed to convert a simple XML string into an object but don't think it will work in this situation. Maybe I'm wrong. Either way I'm not getting anything out of it. Thanks. Michael Quote Link to comment https://forums.phpfreaks.com/topic/295516-simplexml_load_string-problem/ Share on other sites More sharing options...
Solution requinix Posted April 13, 2015 Solution Share Posted April 13, 2015 SimpleXML is a bit picky about what it shows when you print_r() or var_dump() it. Namespaces can make it look like there's no data when there is. Fact is that trying to get data out of it is the easiest way to see if it's working. Try echo $in0 = $xml->Body->children("http://ws.configureone.com")->fireOrder->in0;or if not that, echo $in0 = $xml->children("http://schemas.xmlsoap.org/soap/envelope/")->Body->children("http://ws.configureone.com")->fireOrder->in0; Quote Link to comment https://forums.phpfreaks.com/topic/295516-simplexml_load_string-problem/#findComment-1508969 Share on other sites More sharing options...
mrmonteith Posted April 14, 2015 Author Share Posted April 14, 2015 Awsome, The first one did it! THANKS Quote Link to comment https://forums.phpfreaks.com/topic/295516-simplexml_load_string-problem/#findComment-1509033 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.