Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:17:31+00:00 2026-06-07T01:17:31+00:00

Calling a web service from my controller: $client = new \SoapClient(http://…/webservice/NAME_OF_PAGE.asmx?WSDL); $result = $client->EstadoHabitacionesFechas();

  • 0

Calling a web service from my controller:

$client = new \SoapClient("http://.../webservice/NAME_OF_PAGE.asmx?WSDL");
$result = $client->EstadoHabitacionesFechas();

I get this:

<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="TablaEstadoHabitacion" msdata:UseCurrentLocale="true">
        <xs:complexType>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="TablaEstadoHabitacion">
                    <xs:complexType><xs:sequence>
                        <xs:element name="IdHabitacion" type="xs:int" minOccurs="0"/>
                        <xs:element name="FechaEntrada" type="xs:string" minOccurs="0"/>
                        <xs:element name="FechaSalida" type="xs:string" minOccurs="0"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:choice>
    </xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
    <DocumentElement xmlns="">
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
            <IdHabitacion>1</IdHabitacion>
            <FechaEntrada>23/05/2012</FechaEntrada>
            <FechaSalida>31/12/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion2" msdata:rowOrder="1" diffgr:hasChanges="inserted">
            <IdHabitacion>2</IdHabitacion>
            <FechaEntrada>23/05/2012</FechaEntrada>
            <FechaSalida>29/06/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion3" msdata:rowOrder="2" diffgr:hasChanges="inserted">
            <IdHabitacion>2</IdHabitacion>
            <FechaEntrada>29/06/2012</FechaEntrada>
            <FechaSalida>01/07/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion4" msdata:rowOrder="3" diffgr:hasChanges="inserted">
            <IdHabitacion>3</IdHabitacion>
            <FechaEntrada>02/06/2012</FechaEntrada>
            <FechaSalida>03/06/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion5" msdata:rowOrder="4" diffgr:hasChanges="inserted">
            <IdHabitacion>3</IdHabitacion>
            <FechaEntrada>29/06/2012</FechaEntrada>
            <FechaSalida>01/07/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion6" msdata:rowOrder="5" diffgr:hasChanges="inserted">
            <IdHabitacion>4</IdHabitacion>
            <FechaEntrada>29/06/2012</FechaEntrada>
            <FechaSalida>01/07/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion7" msdata:rowOrder="6" diffgr:hasChanges="inserted">
            <IdHabitacion>5</IdHabitacion>
            <FechaEntrada>02/06/2012</FechaEntrada>
            <FechaSalida>03/06/2012</FechaSalida>
        </TablaEstadoHabitacion>
        <TablaEstadoHabitacion diffgr:id="TablaEstadoHabitacion20" msdata:rowOrder="19" diffgr:hasChanges="inserted">
            <IdHabitacion>10</IdHabitacion>
            <FechaEntrada>02/06/2012</FechaEntrada>
            <FechaSalida>03/06/2012</FechaSalida>
        </TablaEstadoHabitacion>
    </DocumentElement>
</diffgr:diffgram>

How can I parse this data and use it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:17:33+00:00Added an answer on June 7, 2026 at 1:17 am

    You don’t make very clear what “use” is, but you clearly need some form of XML parsing/search.

    For example, try xml-loading that string and var_dump the result. Simply enumerating the various properties should show you the opportunities.

    Later on, you might try XPath search and more advanced “tricks” to speed up the work.

        // Remove namespaces
        $xml    = str_replace(array("diffgr:","msdata:"),'', $xml);
        // Wrap into root element to make it standard XML
        $xml    = "<package>".$xml."</package>";
        // Parse with SimpleXML - probably there're much better ways
        $data   = simplexml_load_string($xml);
        $rooms  = $data->package->diffgram->DocumentElement->TablaEstadoHabitacion;
        print "We have " . count($rooms) . " rooms: \n";
        foreach($rooms as $i => $room)
        {
                print "Room {$i}: id={$room['id']} (official id: {$room->IdHabitacion}\n";
                print "Entrada {$room->FechaEntrada}, salida {$room->FechaSalida}\n...\n";
        }
    

    There are several parsers you can use, this is a quick and dirty one.

    See more here.

    Large data sets

    Note: for very large XML data sets, I’ve found out that foreach is best.

    And for large data sets where you only need a few information, and the whole file might not fit into available memory, you will probably want to use XMLParser, or XMLReader, and sift the whole file through the parser while keeping/manipulating (e.g. sending in a DB, or displaying to HTML) only the information you need.

    While this isn’t in general good practice, you can turn output buffering off before entering a long XML parsing loop, outputting HTML as soon as you have it and flush()ing once in a while. This will outsource the HTML to the HTTP server, taking up less memory in the PHP process, at the expense of slightly inferior compression (if you output chunks of HTML of more than about 40K, the difference is negligible) and proportionally better responsivity (the user “sees” something happen faster, even if overall operation completion takes a little longer. The experience is that of a faster load).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calling a web service from my android client application. After getting response
I'm calling a web service from a jax-ws java client, when i recieve a
When calling a WCF web service from a C# client (instance of System.ServiceModel.ClientBase<>) how
I'm calling a web service from an Apache Axis 1.4 Java client. The call
I am calling a WSDL web service from Python using SOAPpy . The call
I have some problem with calling web service from flex. I have service with
I'm calling a web service from a console app - all in C# on
I'm trying to retrieve product information from magento by calling its web service using
am calling a webservice from my jquery as $.ajax({ type: POST, url: /DataService.asmx/Search, contentType:
I'm having a big problem when calling a web service from my WPF application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.