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 7782499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:33:51+00:00 2026-06-01T19:33:51+00:00

I need to access the response from a .NET web service which returns data

  • 0

I need to access the response from a .NET web service which returns data in XML format.
How can I split the data returned? For example, I would like to parse the data into some PHP variables:

$name = "Dupont";
$email = "charles.dupont@societe.com";

I have been looking for how to do this for a long time without finding the correct way to do it.

My script is:

$result = $client->StudentGetInformation($params_4)->StudentGetInformationResult;

    echo "<p><pre>" . print_r($result, true) . "</pre></p>";

The echo in my page is:

stdClass Object
(
    [any] => 0Successful10371DupontCharlescharles.dupont@societe.com1234charles.dupont@societe.comfalsefr-FR1003FIRST FINANCE1778AAA Département
)

The webservice response format is:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <StudentGetInformationResponse xmlns="http://tempuri.org/">
      <StudentGetInformationResult>xml</StudentGetInformationResult>
    </StudentGetInformationResponse>
  </soap:Body>
</soap:Envelope>

I have tried your example. But it doesn’t do what i need.
I need to split the value returned. I would like to get the data and put them into PHP variables:

$name = “Dupont”;
$email = “charles.dupont@societe.com”;
etc…

Unfortunately the echo of your example gives:

object(stdClass)#1 (1) { ["StudentGetInformationResult"]=> object(stdClass)#11 (1) { ["any"]=> string(561) "0Successful10371DupontCharlescharles.dupont@societe.com1234charles.dupont@societe.comfalsefr-FR1003FIRST FINANCE1778AAA Département" } } 
  • 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-01T19:33:53+00:00Added an answer on June 1, 2026 at 7:33 pm

    The only class you need is SoapClient. There are a lot of examples you can use in the PHP Documentation.

    Example:

    try {
        $client = new SoapClient ( "some.aspx?wsdl" );
        $result = $client->StudentGetInformation ( $params_4 );
    
        $xml = simplexml_load_string($result->StudentGetInformationResult->any);
        echo "<pre>" ;
    
        foreach ($xml as $key => $value)
        {
            foreach($value as $ekey => $eValue)
            {
                print($ekey . " = " . $eValue . PHP_EOL);
            }
        }
    
    } catch ( SoapFault $fault ) {
        trigger_error ( "SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR );
    }
    

    Output

    Code = 0
    Message = Successful
    stud_id = 10373
    lname = Dupont
    fname = Charles
    loginid = charles.dupont@societe.com
    password = 1234
    email = charles.dupont@societe.com
    extid = 
    fdisable = false
    culture = fr-FR
    comp_id = 1003
    comp_name = FIRST FINANCE
    dept_id = 1778
    dept_name = Certification CMF (Test web service)
    udtf1 = 
    udtf2 = 
    udtf3 = 
    udtf4 = 
    udtf5 = 
    udtf6 = 
    udtf7 = 
    udtf8 = 
    udtf9 = 
    udtf10 = 
    Audiences = 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get a XML Response from a PHP Script which I access using [lastResult]
I need to consume an AXIS 1.4 Web service over SSL from a .NET
We need to consume a SOAP 1.1 Web Service, developed using Java, from within
I need access to the uint64_t typedef from stdint.h in some wrapper code that
I can't create a NT account for everyone that need access to the reports.
I need to access RMI methods from a client front end. For different reasons,
I need to access a network resource on which only a given Domain Account
I need to access the bluetooth network interface from Java. All local network interfaces
I am calling an ajax function that returns a dataset (response) with data column
I have added a service reference to my asp.net web application (originally it was

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.