Scusa la mia ignoranza,
ora dopo il consiglio di Santino83_02 il mio Script è il seguente:
codice:
<?
require_once("lib/nusoap.php");
$sNamespace = "http://127.0.0.1/my-project/";
$oServer = new soap_server();
$oServer->configureWSDL('MyWebService', $sNamespace);
$oServer->wsdl->schemaTargetNamespace = $sNamespace;
//Register Function
$oServer->register(MyClass.SendMail', array(
'_sEmails' => 'xsd:string',
'_sSubject' => 'xsd:string',
'_sHtml' => 'xsd:string',
'_sFrom' => 'xsd:string'
),
array('return' => 'xsd:string'), $sNamespace);
class MyClass
{
private $m_sResult;
function SendMail($_sEmails, $_sSubject, $_sHtml, $_sFrom)
{
$this->m_sResult = '';
$aEmail = preg_split("/[|]+/", $_sEmails);
$sHeader .= "From: <$_sFrom>\n";
$sHeader .= "X-Mailer: PHP/".phpversion()."\n";
$sHeader .= "MIME-Version: 1.0\n";
$sHeader .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$sHeader .= "Content-Transfer-Encoding: 7bit\n\n";
foreach($aEmail as $sEmail)
{
if($sEmail != '')
{
if(!mail($sEmail, $_sSubject, $_sHtml, $sHeader))
{
$this->m_sResult .= "|$sEmail";
}
}
}
return new soapval('return', 'xsd:string', substr($this->m_sResult, 1, strlen($this->m_sResult)));
}
}
$oServer->service($HTTP_RAW_POST_DATA);
?>
il quale Script in C# lo richiamo cosi:
codice:
using MyNewsletter.MyWebService;
MyWebService ws = new MyWebService();
string sResult = ws.MyClassSendMail(sEmailTo, sOggetto, sHtmlDocument, sMittenteSelezionato);
mi sembra abbastanza facile???
Perche devo usare una codifica ??
Non comunicano gia in maniera Cifrata ??