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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:08:13+00:00 2026-06-09T23:08:13+00:00

I am using PHP and I use SOAP class that is bundled with PHP.

  • 0

I am using PHP and I use SOAP class that is bundled with PHP. I spent all day trying to figure out why this wasn’t working.

I wrote this on client side:

 $client = new SoapClient("Audit.wsdl");                              
 $params=array('SerialNumber'=>'PB4LAX6JLJT7M','PercentProgress'=>'50','ResultID'=>'5');
 $result=$client->__soapCall('HardDriveStatusUpdate',array($params));

I then wrote this on server side:

function HardDriveStatusUpdate($sn, $p, $rs)
{
    $serialNumber=$sn->SerialNumber;
    $percentProgress=$p->PercentProgress;
    $resultID=$rs->ResultID; 
    // process with variables 
    return array('HardDriveStatusUpdateResult' => '$result');
}

$server=new SoapServer('Audit.wsdl');
$server->addFunction('HardDriveStatusUpdate');
$server->handle();

I noticed that nothing was happening. To debug, I had the function to write to a file with “$serialNumber, $percentProgress, $resultID”. It turns out that it was getting only the first argument, but the second and third argument were empty. (it showed “PB4LAX6JLJT7M,,”) Why?

WSDL says:

 <s:element name="HardDriveStatusUpdate">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="SerialNumber" type="s:string" />
        <s:element minOccurs="1" maxOccurs="1" name="PercentProgress" type="s:int" />
        <s:element minOccurs="1" maxOccurs="1" name="ResultID" type="s:int" />
      </s:sequence>
    </s:complexType>
  </s:element>

Was there something wrong with how I constructed the parameters?

Tested with __getLastRequest():

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://127.0.0.1/soap/">
     <SOAP-ENV:Body>
         <ns1:HardDriveStatusUpdate>
             <ns1:SerialNumber>PB4LAX6JLJT7M</ns1:SerialNumber>
             <ns1:PercentProgress>50</ns1:PercentProgress>
             <ns1:ResultID>5</ns1:ResultID>
         </ns1:HardDriveStatusUpdate>
     </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The real problem is definitely the server side. The function is NOT getting the arguments even though all parameters are already been sent in SOAP request. Why is that? I tried a different method and it still fails to get the second argument. It only works with the FIRST argument.

  • 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-09T23:08:15+00:00Added an answer on June 9, 2026 at 11:08 pm

    I tried your code with the wsdl you provided, the arguments are sent in a single object, so here are the changes you need to do:

    function HardDriveStatusUpdate($myObject)
    {
        $serialNumber = $myObject->SerialNumber;
        $percentProgress = $myObject->PercentProgress;
        $resultID = $myObject->ResultID; 
        // process with variables 
        return array('HardDriveStatusUpdateResult' => true);
    }
    

    I tested it in SoapUi ( with print_r($myObject); die(); ) and here is the result

    :enter image description here

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

Sidebar

Related Questions

I'm trying to use a Web Service using PHP and SOAP. The Web Service
Using PHP ... This is for my personal use so I'm thinking maybe 3-4
I'm using this PHP framework for use with Shopify's API Can anyone help me
I am trying to use PHP session without using cookies. I have enabled session.use_trans_sid
I am using a multidimensional array and I am trying to use php to
I am trying to use WSO2' WSF for PHP and I am using a
Trying to use the Salesforce SOAP API with PHP. I am getting the following
I'm trying to send email in windows server using PHP. When I use php
I'm trying to consume a hello world AXIS2 SOAP web service using a PHP
Just to be clear before continuing: using PHP's built-in SOAP class is unfortunately not

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.