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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:39:29+00:00 2026-06-06T03:39:29+00:00

I been at this all day and feel like I’m getting nowhere, I need

  • 0

I been at this all day and feel like I’m getting nowhere, I need to get this to display as an xml like how it is on this page http://admin.stock.imdfulfilment.com/api/service.asmx/GetCouriers. Yet the following code

<?
try
{
    $soap_url = 'http://admin.stock.imdfulfilment.com/api/service.asmx?wsdl';
    $client = new SoapClient($soap_url, array(
                'trace' => 1,
                'exceptions'=>true,
                'GetCouriersResult' => 'xml')
            );

    $client->GetCouriers();
        $xml = simplexml_load_string($client->__getLastResponse());
        $xml->registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
        $xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
    $xml->registerXPathNamespace('xsd', 'http://www.w3.org/2001/XMLSchema');
    foreach($xml->xpath('//soap:Envelope') as $item) {
        echo "$item\n\n";
    }
}
catch (Exception $e)
{
   print_r($e);
}
?>
  • 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-06T03:39:32+00:00Added an answer on June 6, 2026 at 3:39 am

    It returns doubly encoded XML, I have no idea why someone thought that a Good Idea (perhaps someone who doesn’t want to bother with updating their wsdl):

    $soap_url = 'http://admin.stock.imdfulfilment.com/api/service.asmx?wsdl';
    $client = new SoapClient($soap_url, array(
                'trace' => 1,
                'exceptions'=>true,
                'GetCouriersResult' => 'xml')
            );
    
    $result = $client->GetCouriers();
    echo $result->GetCouriersResult->any;
    //or you can load it in DOM or simpleXML if you need to read it;
    $the_response_should_have_been = new simpleXMLElement($result->GetCouriersResult->any);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working all day and I somehow can't get this probably easy task
I've been fighting this all day. Inside my styles.xml file I have color information
I've been stomping at this all day :( I want to display a status
I'm stuck. Been messing with this all day. To me this looks like it
I've been working on this all day now, and I just can't get it
I've been stuck on this all day. I have a setup like the one
I have been struggling with this all day. I have an html table in
I've been doing this all the time: result = subprocess.call(['copy', '123*.xml', 'out_folder\\.', '/y']) if
I have been at this all day, trying to write a recursive function in
Ive been struggling with this all day, been close a couple times but nothing

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.