xml wsdl auslesen

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • xml wsdl auslesen

    Hallo Zusammen,

    habe folgendes Problem.

    Ich versuche einfach ein xml file per file auszulesen.
    Aber ic hhabe nur ein leeres Array.

    Was mach ich falsch?


    PHP-Code:
    function getfileXML($file) {
        
    $xml = new XMLParser();
        
    $lines file($file);
        foreach (
    $lines as $line) {
            
    $xml->input($line);
        }
        return 
    $xml->output();
    }

    $urlreader ="testi.xml";
    $res getfileXML($urlreader);

    print_r($res); 

    Hier ein Ausschnitt aus dem File:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="urn2_IncidentTransactionQueue"
    xmlns:s0="urn2_IncidentTransactionQueue"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
    <xsd:schema elementFormDefault="qualified"
    targetNamespace="urn2_IncidentTransactionQueue">
    <xsd:element name="OpGetListQueue" type="s0:GetListInputMap1"/>
    <xsd:complexType name="GetListInputMap1">
    <xsd:sequence>
    <xsd:element name="Qualification" type="xsd:string"/>
    <xsd:element name="startRecord" type="xsd:string"/>
    <xsd:element name="maxLimit" type="xsd:string"/> .....


    Input und Output sind alt bewerte Klassen methoden die funktionieren.
    Diese enthalten die gültigen xml parser function von php.

    Komisch ist, es reicht schon, wenn ich $lines von file($file); ausgeben will.
    Dann bekomme ich ein ca. 500 Elemente grosses Array das nur Keys hat, die Values sind leer???

    Danke
    gruss pedro

  • #2
    Es muss schon an der Datei oder Deiner Klasse XMLParser liegen, denn der Rest funktioniert auf meinem Webserver einwandfrei:

    PHP-Code:
    <?php
    function getfileXML($file) {
        
    $lines file($file);
        foreach (
    $lines as $line) {
            
    $result[]=$line;
        }
        return 
    $result;
    }

    $urlreader ="testi.xml";
    $res getfileXML($urlreader);

    print_r($res);
    Zuletzt geändert von SLind; 18.12.2008, 21:32.

    Kommentar

    Lädt...
    X