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

  • Home
  • SEARCH
  • 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 8160097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:08:13+00:00 2026-06-06T18:08:13+00:00

I’ve ran into trouble with SOAP, I’ve never had this issue before and can’t

  • 0

I’ve ran into trouble with SOAP, I’ve never had this issue before and can’t find any information on line that helps me solve it.

The following code

$wsdl = "path/to/my/wsdl";
$client = new SoapClient($wsdl, array('trace' => true));
//$$textinput is passed in and is a very large string with rows in <item></item> tags
$soapInput = new SoapVar($textinput, XSD_ANYXML);
$res = $client->dataprofilingservice(array("contents" => $soapInput));
$response = $client->__getLastResponse();

var_dump($res);//outputs null
var_dump($response);//provides the proper response as I would expect.

I’ve tried passing params into the SoapClient constructor to define soap version but that didnt’ help. I’ve also tried it with the trace param set to false and not present which as expected made $response null but $res was still null. I’ve tried the code on both a linux and windows install running Apache.

The function definition in the WSDL is (xxxx is for security reasons)

<portType name="xxxxServiceSoap">
 <operation name="dataprofilingservice">
  <input   message="tns:dataprofilingserviceSoapIn"/>
  <output message="tns:dataprofilingserviceSoapOut"/>
 </operation>
</portType>

I have it working using the __getLastResponse() but its annoying me it will not work properly.

I’ve put together a small testing script, does anyone see any issues here. Do I need a structure for the return type?

//very simplifed dataset that would normally be 
//read in from a CSV file of about 1mb
$soapInput = getSoapInput("asdf,qwer\r\nzzxvc,ewrwe\r\n23424,2113");
$wsdl = "path to wsdl";

try {
  $client = new SoapClient($wsdl,array('trace' => true,'exceptions' => true));

} catch (SoapFault $fault) {
  $error = 1;
  var_dump($fault);
} 

try {
    $res = $client->dataprofilingservice(array("contents" => $soapInput));
    $response = $client->__getLastResponse();
    echo htmlentities($client->__getLastRequest());//proper request echoed
    echo '<hr>';
    var_dump($res);//null

    echo "<hr>";
    echo(htmlentities($response));//proper response echoed
} catch (SoapFault $fault) {
    $error = 1;
    var_dump($fault);

}         
function getSoapInput($input){
$rows = array();
    $userInputs = explode("\r\n", $input);

    $userInputs = array_filter($userInputs);
    //
    $inputTemplate = " <contents>%s</contents>";
    $rowTemplate = "<Item>%s</Item>";
    //
    $soapString = "";
    foreach ($userInputs as $row) {
        // sanitize
        $row = htmlspecialchars(addslashes($row));
        $xmlStr = sprintf($rowTemplate, $row);
        $rows[] = $xmlStr;
    }
    $textinput = sprintf($inputTemplate, implode(PHP_EOL, $rows));
    $soapInput = new SoapVar($textinput, XSD_ANYXML);

   return $soapInput;

}
  • 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-06T18:08:16+00:00Added an answer on June 6, 2026 at 6:08 pm

    Ok after much digging it is related to relative namespaces, it appears that PHP doesn’t handle them well within the WSDL or the SOAP Envelope. So since I don’t have control of the SOAP Server I will continue to get the response via __getLastResponse();.

    Hopefully this will save some people some time it was hard to find.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

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.