xml parsing issue

Discussion in 'PHP' started by dizyn, Oct 30, 2006.

  1. #1
    Please see this code, I am using for web service client and been able to get correct results. Now i have problem in parsing it, I have methods available for this either get data form array which in user debug or i can parse the xml. When i put the who xml in file and try to parse it it works file, but when i try to parse it directly you can see some extra information which creates problem, please check this issue and help me out.

    Thanks

    You can see output at: http://208.109.22.111/ticketchest/nutest.php
    
    <?PHP 
    require_once('nusoap.php'); 
    // define parameter array 
    $param = array( 'APPCLIENT_ID' => '2220','EVENT_ID' => '6','STARTDATE' => '','INCDAYS' => ''); 
    // define path to server application 
    $serverpath ='http://services.Preview.EventInventory.com/webservices/TicketSearch.asmx'; 
    //define method namespace 
    $namespace="http://www.eventinventory.com/webservices/"; 
    // create client object 
    $soapclient = new soapclient($serverpath); 
    //set soap Action 
    $soapAction='http://www.eventinventory.com/webservices/GetVenueList'; 
    //to see debug messages 
    //$soapclient -> debug_flag = 1; 
    // make the call 
    $result = $soapclient->call('GetVenueList',$param,$namespace,$soapAction); 
    // if a fault occurred, output error info 
    if (isset($fault)) 
    { 
    print "Error: ". $fault; 
    } 
    else if ($result) 
    { 
    // Display the response messages 
    echo '<h2>Response</h2>'; 
    echo '' . htmlspecialchars($soapclient->response, ENT_QUOTES) . ''; 
    // Display the debug messages 
    echo '<h2>Debug</h2>'; 
    echo '<pre>' . htmlspecialchars($soapclient->debug_str, ENT_QUOTES) . '</pre>'; 
    } 
    else 
    { 
    print "No result"; 
    } 
    // kill object 
    unset($soapclient); 
    ?> 
    
    PHP:
     
    dizyn, Oct 30, 2006 IP
  2. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    above issue has been solved

    Well

    I have xml in a variable and now i need to parse it.

    xml is something like this:

    <?xml version="1.0" encoding="utf-8"?>
    <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>
    		<GetVenueListResponse xmlns="http://www.eventinventory.com/webservices/">
    			<GetVenueListResult>
    				<ROOT xmlns="">
    					<METHODINFO>
    						<channelName>Basic View</channelName>
    						<methodName>GetVenueList</methodName>
    						<parameters>APPCLIENT_ID=2220&amp;EVENT_ID=6&amp;STARTDATE=&amp;INCDAYS=</parameters>
    						<processTime type="milliseconds">4.2844</processTime>
    					</METHODINFO>
    					<DATA xmlns:sql="urn:schemas-microsoft-com:xml-sql">
    						<row THISID="945" THISNAME="Lowell Memorial Auditorium" ST="MA" />
    						<row THISID="1598" THISNAME="Stage Theatre" ST="CO" />
    						<row THISID="2963" THISNAME="Walnut Street Theatre" ST="PA" />
    					</DATA>
    				</ROOT>
    			</GetVenueListResult>
    		</GetVenueListResponse>
    	</soap:Body>
    </soap:Envelope>
    Code (markup):
    I need to parse info in data element mainly, please help me so that i can parse it
     
    dizyn, Oct 31, 2006 IP
  3. 123GoToAndPlay

    123GoToAndPlay Peon

    Messages:
    669
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    @dizyn, did you find a solution?
     
    123GoToAndPlay, Feb 10, 2007 IP
  4. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    yes after a hard work its solved now.
     
    dizyn, Feb 23, 2007 IP
  5. wira212

    wira212 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi all i am newbie, could you help me. i've got same problem like dizyn
    Please see this code, I am using for web service client and been able to get correct results. Now i have problem in parsing it, I have methods available for this either get data form array which in user debug or i can parse the xml. When i put the who xml in file and try to parse it it works file, but when i try to parse it directly you can see some extra information which creates problem, please check this issue and help me out.
    , i can't solved that.
     
    wira212, Sep 4, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    Please create a new thread for your problem and include your current code and an URL to the file you're trying to parse. It's impossible to help you when you're just saying "I have a problem and can't solve it".
     
    nico_swd, Sep 4, 2007 IP
  7. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    Hi
    I have solved Event Inventory problem, anyone interested in it may talk to me on


    thank you
    dizyn
     
    dizyn, Oct 5, 2007 IP