php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23741 Problems using msxml via COM interface
Submitted: 2003-05-21 11:26 UTC Modified: 2003-08-17 15:23 UTC
From: jbelant at wpsenergy dot com Assigned:
Status: Wont fix Package: COM related
PHP Version: 4.3.2RC4 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jbelant at wpsenergy dot com
New email:
PHP Version: OS:

 

 [2003-05-21 11:26 UTC] jbelant at wpsenergy dot com
Hello

I am running Windows 2000 SP3, Apache 2.0.45, and PHP 4.3.2RC3. When I try to use the getAttribute method of MSXML, I get the following error message:

Warning: (null)(): Invoke() failed: Exception occurred. Source: Unavailable Description: Unavailable in C:\Apache2\htdocs\get_xml.php on line 198

Line 198 is where the getAttribute is called. However, this code works perfectly with PHP4.3.2RC1.

Following is a snippet of the php code:

---------start code----------

    #create a new ModbusTCP object
    $MBObj = new ModbusTcp;

    #define the path to the web server files
    $serverpath = "c:\\Apache2\\htdocs\\";

    #define the path to point data
	$XMLPath = "ModbusTCP/Points/Point";

    #get the file name
    $xsltfilename = $filename;

    if ($xmltrue)
    {
        $xmlfile = $filename;
    }
    else
    {
         #load the xslt file into an array
        $xsltfile = file($serverpath.$xsltfilename);
        #get the xml file name
        $xmlfile = $xsltfile[0];
         #get the xsl file name
        $xslfile = $xsltfile[1];
        $xsl = new COM("Msxml2.DOMDocument");
        $xsl->async = false;
        $xsl->load($serverpath.$xslfile);
    }

    $xml = new COM("Msxml2.DOMDocument");

    $xml->async = false;
    $xml->load($serverpath.$xmlfile);

    $nodes = $xml->getElementsByTagName("ModbusTCP/IP");
    $node = $nodes->item(0);
    $ip = $node->text;

    $nodes = $xml->getElementsByTagName("ModbusTCP/UnitID");
    $node = $nodes->item(0);
    $id = $node->text;

    $nodes = $xml->getElementsByTagName("ModbusTCP/NumRegisters");
    $node = $nodes->item(0);
    $NumReg = $node->text;

    $nodes = $xml->getElementsByTagName("ModbusTCP/StartAddr");
    $node = $nodes->item(0);
    $Offset = $node->getAttribute("Offset");

-------end code-----------

Any ideas on what could be causing this?

Jim

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-22 11:02 UTC] jbelant at wpsenergy dot com
I just tried PHP 4.3.2RC4, and see the same problem
 [2003-07-25 07:47 UTC] jbelant at wpsenergy dot com
Thanks for the update. Unfortunately, I'm still seeing the same symptoms.

The only version of php that seems to work with the getAttribute of MSXML is 4.3.2RC1.

I've start porting the code to use the PHP DOM model, and that seems to work better.

Jim
 [2003-08-17 15:23 UTC] iliaa@php.net
The com extension has been completely rewritten in PHP5 and the PHP4 com extension is no longer being maintained. If you find bugs with the com extension in PHP5 please report them.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC