Advertisement

02.16.2006 at 05:30PM PST, ID: 21740371
[x]
Attachment Details

PHP & SOAP problem

Asked by sinner in PHP Scripting Language

Tags: soap, _getlastresponse, php

Hello,
I have a "Hello World" web service written in C# running on a win2003 server.
From a Linux server I have PHP code which tries to execute the web service.
The problem is that when I print the results of the function I get "Object id #2" instead of "Hello World".

But if I inspect the response with _getLastResponse, the Hello World message is inside the XML.
What Am I missing?

Here is the code and the results afterwards.

<?
$client = new SoapClient("http://10.1.11.84/h2wspublic/test.asmx?WSDL",array("trace"=>1));

$returnStr = $client->HelloWorld();
echo "Response #1:" . $returnStr . "\n";
 
$returnStr = $client->__soapCall("HelloWorld",array());
echo "Response #2:" . $returnStr . "\n";

print($client->HelloWorld()."\n");
echo $client->__getLastResponse() . "\n";

echo "-----------------------\n";

$client = new  SoapClient("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl" );
print($client->getQuote("ibm")."\n");
?>

Results from the code:

Response #1:Object id #2

Response #2:Object id #3

Object id #2

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><HelloWorldResponse xmlns="http://tempuri.org/"><HelloWorldResult>Hello World my friend marcelo</HelloWorldResult></HelloWorldResponse></soap:Body></soap:Envelope>

-----------------------

80.7

Thanks for your helpStart Free Trial
[+][-]02.17.2006 at 10:16AM PST, ID: 15982959

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2006 at 12:56PM PST, ID: 15984585

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2006 at 01:57PM PST, ID: 15985256

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: soap, _getlastresponse, php
Sign Up Now!
Solution Provided By: TeRReF
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.17.2006 at 02:03PM PST, ID: 15985308

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2006 at 02:09PM PST, ID: 15985350

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32