I'm doing a SOAP call and get data returned in XML. The returning XML has a markup from which I don't know how to handle. I only need all <web_get_debiteuren>
.
I thought of using php SimpleXMLElement (http://www.php.net/manual/en/simplexml.examples-basic.php). But I'm not able to do something like this:
$xml = new SimpleXMLElement($result);
echo $xml->soap;
How would I be able to wals through all results <web_get_debiteuren>
part of the XML file?
See XML below:
<?xml version="1.0" encoding="windows-1250"?>
<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:body>
<getdatawithoptionsresponse xmlns="urn:Afas.Profit.Services">
<getdatawithoptionsresult>
<AfasGetConnector>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="AfasGetConnector">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="web_get_debiteuren">
<xs:complexType>
<xs:sequence>
<xs:element name="Nummer_debiteur" type="xs:string" minOccurs="0"/>
<xs:element name="Naam_debiteur" type="xs:string" minOccurs="0"/>
<xs:element name="E-mail_werk" type="xs:string" minOccurs="0"/>
<xs:element name="Voornaam" type="xs:string" minOccurs="0"/>
<xs:element name="Achternaam" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<web_get_debiteuren>
<Nummer_debiteur>10000</Nummer_debiteur>
<Naam_debiteur>Test</Naam_debiteur>
<Voornaam>Hans</Voornaam>
<Achternaam>Klok</Achternaam>
</web_get_debiteuren>
<web_get_debiteuren>
<Nummer_debiteur>11000</Nummer_debiteur>
<Naam_debiteur>Sven</Naam_debiteur>
<E-mail_werk>e@mail.com</E-mail_werk>
<Voornaam>Sven</Voornaam>
<Achternaam>Kramer</Achternaam>
</web_get_debiteuren>
<web_get_debiteuren>
<Nummer_debiteur>11001</Nummer_debiteur>
<Naam_debiteur>Ireen</Naam_debiteur>
<E-mail_werk>i@reen.nl</E-mail_werk>
<Voornaam>Ireen</Voornaam>
<Achternaam>Wust</Achternaam>
</web_get_debiteuren>
</AfasGetConnector>
</getdatawithoptionsresult>
</getdatawithoptionsresponse>
</soap:body>
</soap:envelope>