note 101835 modified in soapclient.soapclient by danbrown
| From: | danbrown@php.net | Date: | Thu, 13 Jan 2011 15:05:51 +0000 |
| Subject: | note 101835 modified in soapclient.soapclient by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175706@lists.php.net to get a copy of this message | ||
a full working php .net soap configuration :
notes
1. web.config on .net server must work with basichttp binding.
2. paramaters to soap functions must be passed as :
array ('parm1_name'=>'parm1_value',
'parm2_name'=>'parm2_value'...)
<?php
header('Content-Type: text/plain');
try {
$options = array(
'soap_version'=>SOAP_1_1,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient('http://www.example.com/end_point.wsdl',
$options);
// Note where 'Get' and 'request' tags are in the XML
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
echo 'running HelloWorld :';
try {
$response=$client->HelloWorld();
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
print_r($response);
?>
good luck !
Asaf.
--was--
a full working php .net soap configuration :
notes
1. web.config on .net server must work with basichttp binding.
2. paramaters to soap functions must be passed as :
array ('parm1_name'=>'parm1_value',
'parm2_name'=>'parm2_value'...)
<?php
header('Content-Type: text/plain');
try {
$options = array(
'soap_version'=>SOAP_1_1,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient('http://www.site.com/end_point.wsdl',
$options);
// Note where 'Get' and 'request' tags are in the XML
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
echo 'running HelloWorld :';
try {
$response=$client->HelloWorld();
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
print_r($response);
?>
good luck !
Asaf.
http://php.net/manual/en/soapclient.soapclient.php