|
comp.lang.php - PHP programming language discussions
|
|
|
|
|
Posted by Peter on November 23, 2008, 12:01 am
Please log in for more thread options
$wsdl =
"http://webservice1.petersoft.com/WebServiceHelper/service.php?class=testSoapServer&wsdl"; show/hide quoted text
echo "<strong>WSDL file:</strong> ".$wsdl."<br>\n";
$options = Array('actor' =>'http://webservice1.petersoft.com',
'trace' => true);
$client = new SoapClient($wsdl, array('trace'=>true));
echo $client->helloWorld(23);
echo htmlentities($client->__getLastResponse());
My coode doesn't have error. But I cannot get the result from the web
service function call
please help
thanks
from Peter (cmk128@hotmail.com)
|
|
Posted by Curtis on November 23, 2008, 2:52 am
Please log in for more thread options
On Sun, 23 Nov 2008 13:01:06 +0800, cmk128@hotmail.com wrote:
show/hide quoted text
> $wsdl =
>
"http://webservice1.petersoft.com/WebServiceHelper/service.php?class=testSoapServer&wsdl";
show/hide quoted text
> echo "<strong>WSDL file:</strong> ".$wsdl."<br>\n";
> $options = Array('actor' =>'http://webservice1.petersoft.com',
> 'trace' => true);
You initialize "$options" here, but you don't use it below:
show/hide quoted text
> $client = new SoapClient($wsdl, array('trace'=>true));
> echo $client->helloWorld(23);
> echo htmlentities($client->__getLastResponse());
>
>
>
> My coode doesn't have error. But I cannot get the result from the web
> service function call
You don't use any error handling. Since PHP 5, you can catch SOAP
faults with exceptions. For example:
try {
show/hide quoted text
$client = new SoapClient($wsdl, array('trace'=>true));
echo $client->helloWorld(23);
echo htmlentities($client->__getLastResponse());
} catch ( SoapFault $fault ) {
trigger_error(
show/hide quoted text
"<br>",
E_USER_ERROR
);
}
I tried testing the code, and I got mixed results. Sometimes the
request succeeded, other times, it runs into a SOAP error parsing the
WSDL file. I'm guessing this is a problem on the server end.
show/hide quoted text
> please help
>
> thanks
> from Peter (cmk128@hotmail.com)
--
Curtis
$email = str_replace('sig.invalid', 'gmail.com', $from);
|
|
Posted by peter on November 26, 2008, 11:02 am
Please log in for more thread options On 11$B7n(B23$BF|(B, $B2<8a(B3$B;~(B52$BJ,(B, Curtis
show/hide quoted text
> On Sun, 23 Nov 2008 13:01:06 +0800, cmk...@hotmail.com wrote:
> > $wsdl =
> > "http://webservice1.petersoft.com/WebServiceHelper/service.php?class=t...";
> > echo "<strong>WSDL file:</strong> ".$wsdl."<br>\n";
> > $options = Array('actor' =>'http://webservice1.petersoft.com',
> > 'trace' => true);
> You initialize "$options" here, but you don't use it below:
> > $client = new SoapClient($wsdl, array('trace'=>true));
> > echo $client->helloWorld(23);
> > echo htmlentities($client->__getLastResponse());
> > My coode doesn't have error. But I cannot get the result from the web
> > service function call
> You don't use any error handling. Since PHP 5, you can catch SOAP
> faults with exceptions. For example:
> try {
> $client = new SoapClient($wsdl, array('trace'=>true));
> echo $client->helloWorld(23);
> echo htmlentities($client->__getLastResponse());
> } catch ( SoapFault $fault ) {
> trigger_error(
> "<br>",
> E_USER_ERROR
> );
> }
> I tried testing the code, and I got mixed results. Sometimes the
> request succeeded, other times, it runs into a SOAP error parsing the
> WSDL file. I'm guessing this is a problem on the server end.
> > please help
> > thanks
> > from Peter (cmk...@hotmail.com)
> --
> Curtis
> $email = str_replace('sig.invalid', 'gmail.com', $from);
thanks
|
| Similar Threads | Posted | | WSDL document | February 2, 2009, 6:28 am |
| PHP doesn't support XSD validation through WSDL? | April 21, 2007, 10:26 am |
| New to webservices, wsdl and nusoap | April 23, 2007, 9:09 am |
| Using SoapClient's non-WSDL Mode | September 17, 2008, 10:07 am |
| Status quo of WSDL 2.0 Support in PHP | November 4, 2008, 3:11 pm |
| PHP5 consume web service without wsdl | February 14, 2006, 6:41 am |
| SOAP and auto WSDL writers | October 28, 2006, 7:40 pm |
| SOAP and auto WSDL writers | October 28, 2006, 7:41 pm |
| WSDL / SOAP function namespaces | April 23, 2008, 6:20 am |
| PHP5 + soap extension + WSDL Mode | April 4, 2006, 4:44 am |
|
|
$options = Array('actor' =>'http://webservice1.petersoft.com',
'trace' => true);
$client = new SoapClient($wsdl, array('trace'=>true));
echo $client->helloWorld(23);
echo htmlentities($client->__getLastResponse());