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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:08:56+00:00 2026-06-15T00:08:56+00:00

Am using PHP curl to do SOAP requests to a webservice, I have an

  • 0

Am using PHP curl to do SOAP requests to a webservice, I have an array of IDs of over 500 items, for each ID, I send a SOAP request and get a XML response for which I test some parameters and generate/store in a variable. Unfortunately, I can only loop through 9 IDs of the array, over which I get a “500 Server error” in firebug on a jquery post.
How do I loop through ALL these 500 items? Could it be done with parallel connections OR multi-threading? If so how do you it in PHP curl?

Here is my sample code.

<?php 
$VehicleIDs = "153,106,128,149,121,123,125,133,130,115,124,116,102,100,101,103,144,113,...........";//over 500 items
$VehicleIDsArray = explode(",", $VehicleIDs);

for($i=0; $i <= count($massVehicleIDsArray); $i++){
            $soapUrl = "http://xxx.asmx";
            $xml_post_string = '<?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>
                                <GetInUseEventsForVehicleID>
                                  <VehicleID>'.$massVehicleIDsArray[$i].'</VehicleID>
                                </GetInUseEventsForVehicleID>
                              </soap:Body>
                            </soap:Envelope>';

        $headers = array(
                    "Content-type: text/xml;charset=\"utf-8\"",
                    "Accept: text/xml",
                    "Cache-Control: no-cache",
                    "Pragma: no-cache",
                    "SOAPAction: xxx", // your op URL
                    "Content-length: ".strlen($xml_post_string),
                );
        // PHP cURL  for https connection with auth
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_URL, $soapUrl);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // xml request
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        // converting
        $response = curl_exec($ch); 
        curl_close($ch);

        // converting
        $response1 = str_replace("<soap:Body>","",$response);
        $response2 = str_replace("</soap:Body>","",$response1);

        // convertingc to XML
        $parser = simplexml_load_string($response2);   

        /*....................

        MORE CODE TO COMPARE EACH SOAP RESPONSE

        ...................*/
}
?>

Thank you

  • 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-15T00:08:57+00:00Added an answer on June 15, 2026 at 12:08 am

    I thinks base problem is in low time limit http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time, and yes curl supports parallel execution http://php.net/manual/ru/function.curl-multi-exec.php , there are some open-source libs for parallel curl executing.

    http://www.phpclasses.org/package/4091-PHP-Retrieve-multiple-pages-simultaneously.html

    https://github.com/Fivell/Utfy

    https://github.com/jmathai/php-multi-curl

    and so on.
    But you still might hit the maximum execution time or the memory limit though

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

Sidebar

Related Questions

I'm using CURL to send a SOAP request to Mondrian. This is the PHP
I'm using curl to make php send an http request to some website somewhere
I have a need to rename a file after download using php cURL. Here's
I am using a PHP script in Windows to make a curl request to
I'm using PHP's CURL MULTI to download an array of resources in parallel, and
I have to scrape this page using php curl. In this when the user
I wish to issue the following curl request using php-curl: curl http://www.example.com/ -F file=@foo.ext
I have some code that is using the PHP cURL library to upload some
I am indexing the file using php curl library. I am stuck here with
I'm trying to get character data from www.wowarmory.com using PHP and cURL. The code

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.